-
Notifications
You must be signed in to change notification settings - Fork 2.1k
ci: cache QEMU binfmt image in checks job to prevent matrix cache contention #10572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
javorszky
wants to merge
13
commits into
main
Choose a base branch
from
chore/cache-qemu-image-once
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9c188ad
ci: cache QEMU binfmt image in checks job to prevent matrix cache con…
javorszky 67efe2b
Move qemu setup to after gates
javorszky b584400
ci: simplify QEMU cache guard condition and enable cache-image explic…
javorszky 5d80046
ci: cache QEMU binfmt image before matrix builds
javorszky 177903c
ci: qemu cache miss will not fail jobs
javorszky eb64f8d
ci: tune renovate to update qemu image
javorszky cdb7b3a
ci: cache vs tags vs digest
javorszky 08f98c1
Merge branch 'main' into chore/cache-qemu-image-once
javorszky 9380d28
ci: tag freshly pulled image so it can be saved
javorszky f874f73
Merge branch 'main' into chore/cache-qemu-image-once
javorszky 17a9118
Merge branch 'main' into chore/cache-qemu-image-once
javorszky 5dafe64
Merge branch 'main' into chore/cache-qemu-image-once
javorszky 7dc3cf5
Merge branch 'main' into chore/cache-qemu-image-once
javorszky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: Setup Cached QEMU | ||
| description: Restores a cached binfmt image and installs the requested QEMU emulators | ||
|
|
||
| inputs: | ||
| cache-mode: | ||
| description: Use prime to populate a missing cache, or restore to require it | ||
| default: restore | ||
| image: | ||
| description: Binfmt image to load and install | ||
| default: docker.io/tonistiigi/binfmt@sha256:400a4873b838d1b89194d982c45e5fb3cda4593fbfd7e08a02e76b03b21166f0 # renovate: datasource=docker depName=tonistiigi/binfmt | ||
| platforms: | ||
| description: Comma-separated emulators to install | ||
| default: arm64 | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Restore binfmt image | ||
| id: cache | ||
| uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | ||
| with: | ||
| path: ${{ runner.temp }}/qemu-binfmt | ||
| key: qemu-binfmt-${{ runner.os }}-${{ runner.arch }}-${{ inputs.image }} | ||
| fail-on-cache-miss: ${{ inputs.cache-mode == 'restore' }} | ||
|
|
||
| - name: Pull binfmt image | ||
| if: steps.cache.outputs.cache-hit != 'true' | ||
| shell: bash | ||
| env: | ||
| QEMU_CACHE_DIR: ${{ runner.temp }}/qemu-binfmt | ||
| QEMU_IMAGE: ${{ inputs.image }} | ||
| run: | | ||
| mkdir -p "$QEMU_CACHE_DIR" | ||
| docker pull "$QEMU_IMAGE" | ||
| docker save --output "$QEMU_CACHE_DIR/binfmt.tar" "$QEMU_IMAGE" | ||
|
|
||
| - name: Save binfmt image | ||
| if: steps.cache.outputs.cache-hit != 'true' | ||
| uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | ||
| with: | ||
| path: ${{ runner.temp }}/qemu-binfmt | ||
| key: qemu-binfmt-${{ runner.os }}-${{ runner.arch }}-${{ inputs.image }} | ||
|
|
||
| - name: Load binfmt image | ||
| shell: bash | ||
| run: docker load --input "${{ runner.temp }}/qemu-binfmt/binfmt.tar" | ||
|
|
||
| - name: Install QEMU emulators | ||
| shell: bash | ||
| env: | ||
| QEMU_IMAGE: ${{ inputs.image }} | ||
| QEMU_PLATFORMS: ${{ inputs.platforms }} | ||
| run: docker run --rm --privileged "$QEMU_IMAGE" --install "$QEMU_PLATFORMS" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.