-
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
docker: improve Rust dependency caching in CI to avoid rebuilding #6169
Comments
--link
option with COPY
This has become a cost issue, so we should prioritize it. |
As caching is not working as expected, and using it takes the build more time as it's also pushing the cache to the registry, we decided to remove this here: https://github.com/ZcashFoundation/zebra/pull/8374/files#diff-5a5111df219975ea6b3b69567752b89fa0c670d5a67598674ad411da2ed96985L174-L187 in PR #8374 as it's generating costs for storing the artifacts without an actual value added. This must be taken into consideration when working towards a solution. |
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.
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.
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.
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.
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.
* 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 #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]>
* 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
When files are copied into the Dockerfile with the
COPY
command, the cache can get invalidated. We could improve this by using the--link
option which creates more independent layers to avoid rebuilding when not neededSpecifications
Documentation: https://docs.docker.com/engine/reference/builder/#copy---link
The text was updated successfully, but these errors were encountered: