diff --git a/.github/workflows/_docker-build.yml b/.github/workflows/_docker-build.yml index d36076444746..19dfc210bae6 100644 --- a/.github/workflows/_docker-build.yml +++ b/.github/workflows/_docker-build.yml @@ -38,6 +38,8 @@ jobs: name: Build server image runs-on: ubuntu-22.04 timeout-minutes: 60 + outputs: + build-id: ${{ steps.build-id.outputs.id }} strategy: fail-fast: true matrix: @@ -48,6 +50,17 @@ jobs: { qemu: "arm64", docker: "linux/arm64" }, ] steps: + - name: Create build id + id: build-id + shell: python + run: | + import hashlib + import os + + hash = hashlib.sha256('''${{ inputs.build-args }}'''.encode()) + with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: + print(f"id={hash.hexdigest()}", file=fh) + - name: Set up QEMU if: matrix.platform.qemu != '' uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 @@ -87,7 +100,7 @@ jobs: - name: Upload digest uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: - name: digests + name: digests-${{ steps.build-id.outputs.id }} path: /tmp/digests/* if-no-files-found: error retention-days: 1 @@ -103,7 +116,7 @@ jobs: - name: Download digests uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: - name: digests + name: digests-${{ needs.build.outputs.build-id }} path: /tmp/digests - name: Docker meta diff --git a/.github/workflows/docker-base.yml b/.github/workflows/docker-base.yml index 7b23340ec7d2..fe276585a3bd 100644 --- a/.github/workflows/docker-base.yml +++ b/.github/workflows/docker-base.yml @@ -43,9 +43,9 @@ jobs: uses: ./.github/workflows/_docker-build.yml needs: parameters strategy: - fail-fast: true + fail-fast: false matrix: - python-version: [3.8, 3.9, 3.10, 3.11] + python-version: ["3.8", "3.9", "3.10", "3.11"] with: namespace-repository: flwr/base file-dir: src/docker/base