Skip to content

Commit

Permalink
ci: fix race on container image name
Browse files Browse the repository at this point in the history
We had a race on the container image name when the prepare job was
running a day before the build job was triggered.

Example:
- a prepare job generated image name on 2023/08/01:

  2023-08-01T23:59:32.9711845Z ++ date -u +%Y-%m-%d
  2023-08-01T23:59:32.9713485Z + echo image=image-fedora:37-2023-08-01

- a few seconds later, the build jobs tried to use a different image
  name on 2023/08/02:

  2023-08-02T00:01:29.9103180Z ++ date -u +%Y-%m-%d
  2023-08-02T00:01:29.9113486Z + echo image=image-fedora:37-2023-08-02

Fix this by directly reusing the prepare job output.

Fixes: b35c4b0 ("ci: add Fedora 35 container in GHA")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
  • Loading branch information
david-marchand committed Aug 4, 2023
1 parent 0767ed9 commit 9836014
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ jobs:
prepare-container-images:
name: ${{ join(matrix.config.*, '-') }}
runs-on: ubuntu-latest
outputs:
image: ${{ steps.get_keys.outputs.image }}

strategy:
fail-fast: false
Expand Down Expand Up @@ -214,14 +216,13 @@ jobs:
id: get_keys
run: |
echo 'ccache=ccache-${{ matrix.config.image }}-${{ matrix.config.compiler }}-'$(date -u +%Y-w%W) >> $GITHUB_OUTPUT
echo 'image=image-${{ matrix.config.image }}-'$(date -u +%Y-%m-%d) >> $GITHUB_OUTPUT
echo 'logs=meson-logs-${{ join(matrix.config.*, '-') }}' | tr -d ':' >> $GITHUB_OUTPUT
- name: Retrieve image cache
id: image_cache
uses: actions/cache@v3
with:
path: ~/.image
key: ${{ steps.get_keys.outputs.image }}
key: ${{ needs.prepare-container-images.outputs.image }}
- name: Fail if no image (not supposed to happen)
if: steps.image_cache.outputs.cache-hit != 'true'
run: |
Expand Down

0 comments on commit 9836014

Please sign in to comment.