From 171c6c308dcb67f9028bbcbfadb794526c9eb74b Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 4 Jul 2022 23:10:08 +0400 Subject: [PATCH] Some fixes for push step --- .github/actions/load-image/action.yml | 5 ++ .../workflows/docker-build-test-upload.yml | 8 +-- .../workflows/docker-tag-manifest-push.yml | 9 +++ .github/workflows/docker.yml | 56 +++++++++---------- 4 files changed, 43 insertions(+), 35 deletions(-) diff --git a/.github/actions/load-image/action.yml b/.github/actions/load-image/action.yml index be3b3d4c..618e70f5 100644 --- a/.github/actions/load-image/action.yml +++ b/.github/actions/load-image/action.yml @@ -14,6 +14,11 @@ inputs: runs: using: composite steps: + # Self-hosted runners share a state (whole VM) between runs + - name: Cleanup unwanted docker images 🗑️ + run: docker system prune --all --force + shell: bash + - name: Download built image 📥 uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/docker-build-test-upload.yml b/.github/workflows/docker-build-test-upload.yml index 16126a85..8b5587ca 100644 --- a/.github/workflows/docker-build-test-upload.yml +++ b/.github/workflows/docker-build-test-upload.yml @@ -31,12 +31,6 @@ jobs: with: platform: ${{ inputs.platform }} - # Self-hosted runners share a state (whole VM) between runs - - name: Cleanup unwanted docker images 🗑️ - run: docker system prune --all --force - shell: bash - if: always() - - name: Load parent built image to Docker 📥 if: ${{ inputs.parentImage != '' }} uses: ./.github/actions/load-image @@ -67,7 +61,7 @@ jobs: retention-days: 3 # Self-hosted runners share a state (whole VM) between runs - - name: Cleanup built artifacts 🗑️ + - name: Cleanup artifacts 🗑️ run: | rm -f /tmp/${{ inputs.image }}-${{ inputs.platform }}.tar docker system prune --all --force diff --git a/.github/workflows/docker-tag-manifest-push.yml b/.github/workflows/docker-tag-manifest-push.yml index 4b39ff75..7f4e5ccc 100644 --- a/.github/workflows/docker-tag-manifest-push.yml +++ b/.github/workflows/docker-tag-manifest-push.yml @@ -69,3 +69,12 @@ jobs: if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.event_name == 'schedule' run: docker push --all-tags jupyter/${{ matrix.image }} shell: bash + + # Self-hosted runners share a state (whole VM) between runs + - name: Cleanup artifacts 🗑️ + run: | + rm -rf /tmp/hist_lines/ + rm -rf /tmp/manifests/ + docker system prune --all --force + shell: bash + if: always() diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cb2dc8a7..4b64565a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -190,6 +190,33 @@ jobs: platform: amd64 runsOn: ubuntu-latest + aarch64-images-tag-push: + needs: + [ + aarch64-base, + aarch64-minimal, + aarch64-scipy, + aarch64-r, + aarch64-pyspark, + aarch64-all-spark, + ] + uses: ./.github/workflows/docker-tag-manifest-push.yml + with: + platform: aarch64 + runsOn: self-hosted + # https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations + # The strategy property is not supported in any job that calls a reusable workflow + # Using the workaround: https://github.community/t/reusable-workflow-with-strategy-matrix/205676/2 + images: >- + [ + "base-notebook", + "minimal-notebook", + "scipy-notebook", + "r-notebook", + "pyspark-notebook", + "all-spark-notebook" + ] + amd64-images-tag-push: needs: [ @@ -221,33 +248,6 @@ jobs: "all-spark-notebook" ] - aarch64-images-tag-push: - needs: - [ - aarch64-base, - aarch64-minimal, - aarch64-scipy, - aarch64-r, - aarch64-pyspark, - aarch64-all-spark, - ] - uses: ./.github/workflows/docker-tag-manifest-push.yml - with: - platform: amd64 - runsOn: ubuntu-latest - # https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations - # The strategy property is not supported in any job that calls a reusable workflow - # Using the workaround: https://github.community/t/reusable-workflow-with-strategy-matrix/205676/2 - images: >- - [ - "base-notebook", - "minimal-notebook", - "scipy-notebook", - "r-notebook", - "pyspark-notebook", - "all-spark-notebook" - ] - wiki-update: - needs: [amd64-images-tag-push, aarch64-images-tag-push] + needs: [aarch64-images-tag-push, amd64-images-tag-push] uses: ./.github/workflows/docker-wiki-update.yml