From 22560489b9ac53ffd60d02f1a583a67b024a156d Mon Sep 17 00:00:00 2001 From: Alexis Lucattini Date: Wed, 8 Nov 2023 15:25:49 +1100 Subject: [PATCH 1/5] Rename Check Changelog job --- .github/workflows/check_changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_changelog.yml b/.github/workflows/check_changelog.yml index 48c9e73..a44cf28 100644 --- a/.github/workflows/check_changelog.yml +++ b/.github/workflows/check_changelog.yml @@ -1,4 +1,4 @@ -name: Create and Upload Release And Docker Container(s) +name: Check Changelog on: pull_request: From 249424d4ebeee7b2d2e72e8e06e71c2305e91ec0 Mon Sep 17 00:00:00 2001 From: Alexis Lucattini Date: Wed, 8 Nov 2023 15:26:58 +1100 Subject: [PATCH 2/5] Added build docker container on ghcr.io GH action --- .github/workflows/build_docker_container.yml | 74 ++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/build_docker_container.yml diff --git a/.github/workflows/build_docker_container.yml b/.github/workflows/build_docker_container.yml new file mode 100644 index 0000000..d4248da --- /dev/null +++ b/.github/workflows/build_docker_container.yml @@ -0,0 +1,74 @@ +name: build_container + +on: + push: + branches: + - "dev" + - "main" + # workflow_call: + # inputs: + # git_tag: + # required: true + # type: string + # docker_container_uri_str_list: + # required: true + # type: string + # index_url: # Use test pypi index when downloading from dev + # required: true + # type: string + +jobs: + build_container: + runs-on: ubuntu-latest + steps: + # Checkout repo + - uses: actions/checkout@v4 + + # Extract branch name + - name: Extract branch name + id: get_branch_name + shell: bash + run: | + echo "branch_name=${GITHUB_REF#refs/heads/}" >> "${GITHUB_OUTPUT}" + + # Get tag name + - name: Get Tag Name + id: get_tag_name + shell: bash + run: | + if [[ "${{ steps.get_branch_name.outputs.branch_name }}" == "main" ]]; then + echo "tag_name=latest" >> "${GITHUB_OUTPUT}" + else + echo "tag_name=dev" >> "${GITHUB_OUTPUT}" + fi + + # Use qemu to perform multiplatform builds + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + # Use docker buildx to build multi-platform containers + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + use: true + install: true + config-inline: | + [worker.oci] + max-parallelism = 2 + + # Log in to GitHub Container registry + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + + # Build and push docker images + - name: Build and Push Docker Image + uses: docker/build-push-action@v5 + with: + context: ./ + platforms: linux/amd64 + push: true + tags: ghcr.io/umccr/cttso-ica-to-pieriandx:${{ steps.get_tag_name.outputs.tag_name }} \ No newline at end of file From 685edfc75e9ac11598f9624efca88a2949a64ff7 Mon Sep 17 00:00:00 2001 From: Alexis Lucattini Date: Wed, 8 Nov 2023 15:19:30 +1100 Subject: [PATCH 3/5] Quote label input for reference df query --- utils/micro_classes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/micro_classes.py b/utils/micro_classes.py index 6c4ba04..c5a3568 100644 --- a/utils/micro_classes.py +++ b/utils/micro_classes.py @@ -68,7 +68,7 @@ def get_code_from_label(self): :return: """ try: - return self.REFERENCE_DF.query(f"Label=={self.label}")['Code'].item() + return self.REFERENCE_DF.query(f"Label=='{self.label}'")['Code'].item() except ValueError: logger.error(f"Could not find unique label {self.label} in the csv") raise ValueError From 507c408ad59c9c54c71bd6830c2bb9c5651520ba Mon Sep 17 00:00:00 2001 From: Alexis Lucattini Date: Wed, 8 Nov 2023 15:56:50 +1100 Subject: [PATCH 4/5] Add concurrency to GH build Resolves #180 --- .github/workflows/build_docker_container.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build_docker_container.yml b/.github/workflows/build_docker_container.yml index d4248da..e47c752 100644 --- a/.github/workflows/build_docker_container.yml +++ b/.github/workflows/build_docker_container.yml @@ -17,6 +17,10 @@ on: # required: true # type: string +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build_container: runs-on: ubuntu-latest From 3ae850dda02c6b98978282184395b7321f98aea7 Mon Sep 17 00:00:00 2001 From: Alexis Lucattini Date: Wed, 8 Nov 2023 16:07:50 +1100 Subject: [PATCH 5/5] Updated changelog --- Changelog.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Changelog.md b/Changelog.md index 078c9bf..ecc76bb 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,22 @@ Changes in this log refer only to changes that make it to the 'main' branch. and For changes in deployment, please see the [deployment changelog](deploy/cttso-ica-to-pieriandx-cdk/Changelog.md) +## 2023-11-08 + +> Author: Alexis Lucattini +> Email: [Alexis.Lucattini@umccr.org](mailto:alexis.lucattini@umccr.org) + +### Enhancements + +* Build containers with ghcr.io (yet to move) +* Dont build containers concurrently (https://github.com/umccr/cttso-ica-to-pieriandx/pull/181) + * Resolves https://github.com/umccr/cttso-ica-to-pieriandx/issues/180 + +### Hotfixes + +* Quote label input when no disease id (https://github.com/umccr/cttso-ica-to-pieriandx/pull/179) + * Resolves https://github.com/umccr/cttso-ica-to-pieriandx/issues/176 + ## 2023-11-07 > Author: Alexis Lucattini