-
Notifications
You must be signed in to change notification settings - Fork 107
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
ref(docker): use cache mounts for build cache #8796
Conversation
a134823
to
99f1eb6
Compare
85ad65a
to
bd923da
Compare
This update eliminates the need for external tools like `cargo-chef` to leverage caching layers, resulting in an average build time reduction of 4m30s (~36% improvement). While this solution doesn't fully resolve the issues mentioned in #6169 (comment), it represents the best possible approach without resorting to custom solutions, which we'd prefer to avoid.
50d53ca
to
2bd886c
Compare
@arya2 this one is ready now |
Do we want to close #6169 with this PR or are we planning on making any other improvements in the short term? |
I've just linked #6169, for automatic closure. This is not solving the underlying issue, but this is as far as we can get right now, until the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good!
* ref(docker): leverage cache mount with bind mounts This update eliminates the need for external tools like `cargo-chef` to leverage caching layers, resulting in an average build time reduction of 4m30s (~36% improvement). While this solution doesn't fully resolve the issues mentioned in ZcashFoundation#6169 (comment), it represents the best possible approach without resorting to custom solutions, which we'd prefer to avoid. * chore: remove extra `WORKDIR` and imp comments * chore: improve comment legibility Co-authored-by: Arya <[email protected]> --------- Co-authored-by: Pili Guerra <[email protected]> Co-authored-by: Arya <[email protected]>
Motivation
We've been using external tools and custom approaches to improve the caching layers in Rust, and avoid invalidating the caches if no Rust-code is changed.
This update eliminates the need for external tools like cargo-chef to leverage caching layers, resulting in an average build time reduction of 4m30s (~36% improvement).
While this solution doesn't fully resolve the issues mentioned in #6169 (comment), it represents the best possible approach without resorting to custom solutions, which we'd prefer to avoid.
Depends-On: #8817
Closes #6169
Specifications & References
Solution
cargo-chef
rsync
stepsOthers
RUST_VERSION
arg so we don't invalidate our cache so frequently with Rust upgrades--link
in ourruntime
stage, to reduce the resulting artifactTests
Follow-up Work
runtime
stage with the root userPR Author's Checklist
PR Reviewer's Checklist