From e1f6aca9de6a893c12b6cc5ae7d06cd87df480b6 Mon Sep 17 00:00:00 2001 From: stevenhorsman Date: Thu, 12 Dec 2024 16:50:56 +0000 Subject: [PATCH 1/2] workflows: Remove potential timing issues with artifacts With the code I originally did I think there is potentially a case where we can get a failure due to timing of steps. Before this change the `build-asset-shim-v2` job could start the `get-artifacts` step and concurrently `remove-rootfs-binary-artifacts` could run and delete the artifact during the download and result in the error. In this commit, I try to resolve this by making sure that the shim build waits for the artifact deletes to complete before starting. Signed-off-by: stevenhorsman --- .github/workflows/build-kata-static-tarball-amd64.yaml | 4 ++-- .github/workflows/build-kata-static-tarball-arm64.yaml | 4 ++-- .github/workflows/build-kata-static-tarball-ppc64le.yaml | 4 ++-- .github/workflows/build-kata-static-tarball-s390x.yaml | 5 ++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-kata-static-tarball-amd64.yaml b/.github/workflows/build-kata-static-tarball-amd64.yaml index d2dac9d4b..22767316e 100644 --- a/.github/workflows/build-kata-static-tarball-amd64.yaml +++ b/.github/workflows/build-kata-static-tarball-amd64.yaml @@ -217,7 +217,7 @@ jobs: build-asset-shim-v2: runs-on: ubuntu-22.04 - needs: [build-asset, build-asset-rootfs] + needs: [build-asset, build-asset-rootfs, remove-rootfs-binary-artifacts] steps: - name: Login to Kata Containers quay.io if: ${{ inputs.push-to-registry == 'yes' }} @@ -274,7 +274,7 @@ jobs: create-kata-tarball: runs-on: ubuntu-22.04 - needs: [build-asset, build-asset-rootfs, build-asset-shim-v2, remove-rootfs-binary-artifacts] + needs: [build-asset, build-asset-rootfs, build-asset-shim-v2] steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/build-kata-static-tarball-arm64.yaml b/.github/workflows/build-kata-static-tarball-arm64.yaml index b8adde4c2..d3399424e 100644 --- a/.github/workflows/build-kata-static-tarball-arm64.yaml +++ b/.github/workflows/build-kata-static-tarball-arm64.yaml @@ -155,7 +155,7 @@ jobs: build-asset-shim-v2: runs-on: arm64-builder - needs: [build-asset, build-asset-rootfs] + needs: [build-asset, build-asset-rootfs, remove-rootfs-binary-artifacts] steps: - name: Login to Kata Containers quay.io if: ${{ inputs.push-to-registry == 'yes' }} @@ -210,7 +210,7 @@ jobs: create-kata-tarball: runs-on: arm64-builder - needs: [build-asset, build-asset-rootfs, build-asset-shim-v2, remove-rootfs-binary-artifacts] + needs: [build-asset, build-asset-rootfs, build-asset-shim-v2] steps: - name: Adjust a permission for repo run: | diff --git a/.github/workflows/build-kata-static-tarball-ppc64le.yaml b/.github/workflows/build-kata-static-tarball-ppc64le.yaml index 5f552b0db..132b403b7 100644 --- a/.github/workflows/build-kata-static-tarball-ppc64le.yaml +++ b/.github/workflows/build-kata-static-tarball-ppc64le.yaml @@ -163,7 +163,7 @@ jobs: build-asset-shim-v2: runs-on: ppc64le - needs: [build-asset, build-asset-rootfs] + needs: [build-asset, build-asset-rootfs, remove-rootfs-binary-artifacts] steps: - name: Prepare the self-hosted runner run: | @@ -223,7 +223,7 @@ jobs: create-kata-tarball: runs-on: ppc64le - needs: [build-asset, build-asset-rootfs, build-asset-shim-v2, remove-rootfs-binary-artifacts] + needs: [build-asset, build-asset-rootfs, build-asset-shim-v2] steps: - name: Adjust a permission for repo run: | diff --git a/.github/workflows/build-kata-static-tarball-s390x.yaml b/.github/workflows/build-kata-static-tarball-s390x.yaml index 699e9598f..d3f554d5d 100644 --- a/.github/workflows/build-kata-static-tarball-s390x.yaml +++ b/.github/workflows/build-kata-static-tarball-s390x.yaml @@ -219,7 +219,7 @@ jobs: # We don't need the binaries installed in the rootfs as part of the tarball, so can delete them now we've built the rootfs remove-rootfs-binary-artifacts: runs-on: ubuntu-22.04 - needs: build-asset-rootfs + needs: [build-asset-rootfs, build-asset-boot-image-se] strategy: matrix: asset: @@ -233,7 +233,7 @@ jobs: build-asset-shim-v2: runs-on: s390x - needs: [build-asset, build-asset-rootfs] + needs: [build-asset, build-asset-rootfs, remove-rootfs-binary-artifacts] steps: - name: Login to Kata Containers quay.io if: ${{ inputs.push-to-registry == 'yes' }} @@ -295,7 +295,6 @@ jobs: - build-asset-rootfs - build-asset-boot-image-se - build-asset-shim-v2 - - remove-rootfs-binary-artifacts steps: - uses: actions/checkout@v4 with: From cf8b82794ab1e9a102371956e42dedfd2aff4151 Mon Sep 17 00:00:00 2001 From: stevenhorsman Date: Thu, 12 Dec 2024 17:38:17 +0000 Subject: [PATCH 2/2] workflows: Only remove artifacts in release builds Due to the agent-api tests requiring the agent to be deployed in the CI by the tarball, so in the short-term lets only do this on the release stage, so that both kata-manager works with the release and the agent-api tests work with the other CI builds. In the longer term we need to re-evaluate what is in our tarballs (issue #10619), but want to unblock the tests in the short-term. Fixes: #10630 Signed-off-by: stevenhorsman --- .github/workflows/build-kata-static-tarball-amd64.yaml | 3 ++- .github/workflows/build-kata-static-tarball-arm64.yaml | 3 ++- .github/workflows/build-kata-static-tarball-ppc64le.yaml | 3 ++- .github/workflows/build-kata-static-tarball-s390x.yaml | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-kata-static-tarball-amd64.yaml b/.github/workflows/build-kata-static-tarball-amd64.yaml index 22767316e..519d6c1a7 100644 --- a/.github/workflows/build-kata-static-tarball-amd64.yaml +++ b/.github/workflows/build-kata-static-tarball-amd64.yaml @@ -200,7 +200,7 @@ jobs: retention-days: 15 if-no-files-found: error - # We don't need the binaries installed in the rootfs as part of the tarball, so can delete them now we've built the rootfs + # We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs remove-rootfs-binary-artifacts: runs-on: ubuntu-22.04 needs: build-asset-rootfs @@ -212,6 +212,7 @@ jobs: - pause-image steps: - uses: geekyeggo/delete-artifact@v5 + if: ${{ inputs.stage == 'release' }} with: name: kata-artifacts-amd64-${{ matrix.asset}}${{ inputs.tarball-suffix }} diff --git a/.github/workflows/build-kata-static-tarball-arm64.yaml b/.github/workflows/build-kata-static-tarball-arm64.yaml index d3399424e..7385c0265 100644 --- a/.github/workflows/build-kata-static-tarball-arm64.yaml +++ b/.github/workflows/build-kata-static-tarball-arm64.yaml @@ -140,7 +140,7 @@ jobs: retention-days: 15 if-no-files-found: error - # We don't need the binaries installed in the rootfs as part of the tarball, so can delete them now we've built the rootfs + # We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs remove-rootfs-binary-artifacts: runs-on: ubuntu-22.04 needs: build-asset-rootfs @@ -150,6 +150,7 @@ jobs: - agent steps: - uses: geekyeggo/delete-artifact@v5 + if: ${{ inputs.stage == 'release' }} with: name: kata-artifacts-arm64-${{ matrix.asset}}${{ inputs.tarball-suffix }} diff --git a/.github/workflows/build-kata-static-tarball-ppc64le.yaml b/.github/workflows/build-kata-static-tarball-ppc64le.yaml index 132b403b7..8a0cf7cd0 100644 --- a/.github/workflows/build-kata-static-tarball-ppc64le.yaml +++ b/.github/workflows/build-kata-static-tarball-ppc64le.yaml @@ -148,7 +148,7 @@ jobs: retention-days: 1 if-no-files-found: error - # We don't need the binaries installed in the rootfs as part of the tarball, so can delete them now we've built the rootfs + # We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs remove-rootfs-binary-artifacts: runs-on: ubuntu-22.04 needs: build-asset-rootfs @@ -158,6 +158,7 @@ jobs: - agent steps: - uses: geekyeggo/delete-artifact@v5 + if: ${{ inputs.stage == 'release' }} with: name: kata-artifacts-ppc64le-${{ matrix.asset}}${{ inputs.tarball-suffix }} diff --git a/.github/workflows/build-kata-static-tarball-s390x.yaml b/.github/workflows/build-kata-static-tarball-s390x.yaml index d3f554d5d..8443cea76 100644 --- a/.github/workflows/build-kata-static-tarball-s390x.yaml +++ b/.github/workflows/build-kata-static-tarball-s390x.yaml @@ -216,7 +216,7 @@ jobs: retention-days: 1 if-no-files-found: error - # We don't need the binaries installed in the rootfs as part of the tarball, so can delete them now we've built the rootfs + # We don't need the binaries installed in the rootfs as part of the release tarball, so can delete them now we've built the rootfs remove-rootfs-binary-artifacts: runs-on: ubuntu-22.04 needs: [build-asset-rootfs, build-asset-boot-image-se] @@ -228,6 +228,7 @@ jobs: - pause-image steps: - uses: geekyeggo/delete-artifact@v5 + if: ${{ inputs.stage == 'release' }} with: name: kata-artifacts-s390x-${{ matrix.asset}}${{ inputs.tarball-suffix }}