ci: speed up Docker builds with native arm64 runners and cargo-chef caching - #710
Open
Jon-Becker wants to merge 1 commit into
Open
ci: speed up Docker builds with native arm64 runners and cargo-chef caching#710Jon-Becker wants to merge 1 commit into
Jon-Becker wants to merge 1 commit into
Conversation
…aching - Build each platform on its native runner (arm64 on ubuntu-24.04-arm) instead of under QEMU emulation, then merge into a manifest list. This removes the ~1h arm64 emulation cost from every build. - Split dependency compilation from source compilation via cargo-chef so source-only edits reuse the cached dependency layer, and cache layers to a platform-scoped GHCR registry ref instead of the fragile type=gha cache. - Drop redundant RUSTFLAGS/CARGO_PROFILE_RELEASE_LTO overrides; fat LTO and codegen-units=1 are already defined in Cargo.toml's [profile.release]. - Only build on main, tags, and manual dispatch (not every branch push), and cancel superseded runs for the same ref via a concurrency group. - Keep non-build assets out of the build context via .dockerignore.
Contributor
❌ Eval Report for c46459e
|
Contributor
✅ Coverage Report for c46459e
|
Contributor
Benchmark for c46459eClick to view benchmark
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changed? Why?
Docker builds were taking 60 to 66 minutes because the linux/arm64 build ran under QEMU, the GitHub Actions cache repeatedly failed with
not_found, and source changes invalidated the full Rust compile layer.This PR builds each architecture on a native runner, uses platform-scoped GHCR registry caches, separates Rust dependency compilation with cargo-chef, removes duplicated release flags, narrows Docker pushes to main and tags, and cancels superseded runs. The runtime image, entrypoint, and amd64/arm64 output are unchanged.
Notes to reviewers
ubuntu-24.04-armis required for the native arm64 job.Cargo.toml: fat LTO, one codegen unit, and non-incremental compilation.How has it been tested?
actionlint .github/workflows/docker.yml: 0 findingspython3YAML parse: passed; triggers and concurrency verifiedcargo metadata: passed;heimdallbinary target confirmedCargo.tomlrelease profile: optimization settings preserved