Skip to content

Commit

Permalink
Merge pull request CCI-MOC#49 from QuanMPhm/43/alias
Browse files Browse the repository at this point in the history
Several small fixes: Bumped up versions for Docker build action, reordered Dockerfile, and added constant for PI file
  • Loading branch information
QuanMPhm authored May 10, 2024
2 parents db73e28 + afc2924 commit f64762c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -46,7 +46,7 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
Expand All @@ -60,7 +60,7 @@ jobs:
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ WORKDIR /app

RUN apt-get update && apt-get install -y git

COPY tools/ tools/
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY tools/ tools/
COPY process_report/process_report.py process_report/
COPY process_report/institute_map.json process_report/

RUN pip install -r requirements.txt

CMD ["tools/clone_nonbillables_and_process_invoice.sh"]
6 changes: 4 additions & 2 deletions process_report/process_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
BALANCE_FIELD = "Balance"
###

PI_S3_FILEPATH = "PIs/PI.csv"


def get_institution_from_pi(institute_map, pi_uname):
institution_key = pi_uname.split("@")[-1]
Expand Down Expand Up @@ -376,13 +378,13 @@ def apply_credits_new_pi(dataframe, old_pi_file):
def fetch_s3_old_pi_file():
local_name = "PI.csv"
invoice_bucket = get_invoice_bucket()
invoice_bucket.download_file("PIs/PI.csv", local_name)
invoice_bucket.download_file(PI_S3_FILEPATH, local_name)
return local_name


def upload_to_s3_old_pi_file(old_pi_file):
invoice_bucket = get_invoice_bucket()
invoice_bucket.upload_file(old_pi_file, "PIs/PI.csv")
invoice_bucket.upload_file(old_pi_file, PI_S3_FILEPATH)


def add_institution(dataframe: pandas.DataFrame):
Expand Down

0 comments on commit f64762c

Please sign in to comment.