From 2665693c5a9320e2f354a7efea617e0a9c4d93a3 Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Mon, 18 Dec 2023 11:47:37 +0100 Subject: [PATCH 1/3] Bump actions/artifact-upload to v4 --- .github/actions/create-dev-env/action.yml | 2 +- .github/actions/load-image/action.yml | 2 +- .../workflows/docker-build-test-upload.yml | 6 ++- .github/workflows/docker-merge-tags.yml | 6 +-- .github/workflows/docker-push.yml | 4 +- .github/workflows/docker.yml | 44 +------------------ 6 files changed, 12 insertions(+), 52 deletions(-) diff --git a/.github/actions/create-dev-env/action.yml b/.github/actions/create-dev-env/action.yml index 1500927c..85c46980 100644 --- a/.github/actions/create-dev-env/action.yml +++ b/.github/actions/create-dev-env/action.yml @@ -18,7 +18,7 @@ runs: if: ${{ inputs.architecture == 'amd64' }} uses: actions/setup-python@v4 with: - python-version: 3.x + python-version: 3.11 - name: Install Dev Dependencies 📦 run: | diff --git a/.github/actions/load-image/action.yml b/.github/actions/load-image/action.yml index 598c17f9..4a8665f9 100644 --- a/.github/actions/load-image/action.yml +++ b/.github/actions/load-image/action.yml @@ -16,7 +16,7 @@ runs: using: composite steps: - name: Download built image 📥 - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ inputs.image }}-${{ inputs.architecture }} path: /tmp/aiidalab diff --git a/.github/workflows/docker-build-test-upload.yml b/.github/workflows/docker-build-test-upload.yml index 68de9054..3652d615 100644 --- a/.github/workflows/docker-build-test-upload.yml +++ b/.github/workflows/docker-build-test-upload.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Checkout Repo ⚡️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create dev environment 📦 uses: ./.github/actions/create-dev-env with: @@ -63,9 +63,11 @@ jobs: if: always() - name: Upload image as artifact 💾 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ inputs.image }}-${{ inputs.architecture }} path: /tmp/aiidalab/${{ inputs.image }}-${{ inputs.architecture }}.tar retention-days: 3 + compression-level: 0 + if-no-files-found: error if: always() diff --git a/.github/workflows/docker-merge-tags.yml b/.github/workflows/docker-merge-tags.yml index d99569f9..b0d43fec 100644 --- a/.github/workflows/docker-merge-tags.yml +++ b/.github/workflows/docker-merge-tags.yml @@ -25,19 +25,19 @@ jobs: steps: - name: Checkout Repo ⚡️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create dev environment 📦 uses: ./.github/actions/create-dev-env with: architecture: amd64 - name: Download amd64 tags file 📥 - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ inputs.registry }}-${{ inputs.image }}-amd64-tags path: /tmp/aiidalab - name: Download arm64 tags file 📥 - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ inputs.registry }}-${{ inputs.image }}-arm64-tags path: /tmp/aiidalab diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index 3c776bc4..c264b1b1 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -31,7 +31,7 @@ jobs: steps: - name: Checkout Repo ⚡️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create dev environment 📦 uses: ./.github/actions/create-dev-env with: @@ -87,7 +87,7 @@ jobs: shell: bash - name: Upload tags file 📤 - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ inputs.registry }}-${{ inputs.image }}-${{ inputs.architecture }}-tags path: /tmp/aiidalab/${{ inputs.image }}-${{ inputs.architecture }}-tags.txt diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a7599294..d9d4480d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -3,53 +3,11 @@ name: Build, test and push Docker Images on: pull_request: - paths: - - ".github/workflows/docker.yml" - # We use local reusable workflows to make architecture clean an simple - # https://docs.github.com/en/actions/using-workflows/reusing-workflows - - ".github/workflows/docker-build-test-upload.yml" - - ".github/workflows/docker-merge-tags.yml" - - ".github/workflows/docker-push.yml" - - # We use local composite actions to combine multiple workflow steps within one action - # https://docs.github.com/en/actions/creating-actions/about-custom-actions#composite-actions - - ".github/actions/create-dev-env/action.yml" - - ".github/actions/load-image/action.yml" - - - "stack/base/**" - - "stack/base-with-services/**" - - "stack/lab/**" - - "stack/full-stack/**" - - "build.json" - - "docker-bake.hcl" - - "tests/**" - - "requirements-dev.txt" push: branches: - main tags: - "v*" - paths: - - ".github/workflows/docker.yml" - # We use local reusable workflows to make architecture clean an simple - # https://docs.github.com/en/actions/using-workflows/reusing-workflows - - ".github/workflows/docker-build-test-upload.yml" - - ".github/workflows/docker-merge-tags.yml" - - ".github/workflows/docker-push.yml" - - # We use local composite actions to combine multiple workflow steps within one action - # https://docs.github.com/en/actions/creating-actions/about-custom-actions#composite-actions - - ".github/actions/create-dev-env/action.yml" - - ".github/actions/load-image/action.yml" - - - "stack/base/**" - - "stack/base-with-services/**" - - "stack/lab/**" - - "stack/full-stack/**" - - "build.json" - - "docker-bake.hcl" - - "tests/**" - - "requirements-dev.txt" workflow_dispatch: # https://docs.github.com/en/actions/using-jobs/using-concurrency @@ -213,7 +171,7 @@ jobs: runs-on: ubuntu-latest needs: [merge-tags-ghcr, merge-tags-dockerhub] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create release uses: softprops/action-gh-release@v1 From 42edf54a028aade49dd6cf3ad68eeadebcb62152 Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Mon, 18 Dec 2023 12:27:48 +0100 Subject: [PATCH 2/3] Add timeout to the docker action --- .github/workflows/docker-build-test-upload.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker-build-test-upload.yml b/.github/workflows/docker-build-test-upload.yml index 3652d615..5013f284 100644 --- a/.github/workflows/docker-build-test-upload.yml +++ b/.github/workflows/docker-build-test-upload.yml @@ -23,6 +23,7 @@ on: jobs: build-test-upload: runs-on: ${{ inputs.runsOn }} + timeout-minutes: 20 steps: - name: Checkout Repo ⚡️ From 171be8d2144c726b9bf1f7dfd8fb14d8cff6b101 Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Mon, 18 Dec 2023 14:25:48 +0100 Subject: [PATCH 3/3] Remove compression level setting --- .github/workflows/docker-build-test-upload.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker-build-test-upload.yml b/.github/workflows/docker-build-test-upload.yml index 5013f284..bfa6ac78 100644 --- a/.github/workflows/docker-build-test-upload.yml +++ b/.github/workflows/docker-build-test-upload.yml @@ -69,6 +69,5 @@ jobs: name: ${{ inputs.image }}-${{ inputs.architecture }} path: /tmp/aiidalab/${{ inputs.image }}-${{ inputs.architecture }}.tar retention-days: 3 - compression-level: 0 if-no-files-found: error if: always()