You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when using explicit cache a single cache image can be specified to read from. It could be useful to have a priority-ordered list of images to check for cache hits. @mattste provided this use case:
Use Case
I'm attempting to do pull request previews where each pull request has its own Docker image. For pull requests that update a dependency (such as a package.json or mix.lock), these builds can be super slow.
FWIW, there is already a SAVE IMAGE --cache-from, which could be used as a workaround, which should work theoretically, if placed, for example in the target being called directly. But this isn't very elegant, as there's no image actually being saved.
Currently, when using explicit cache a single cache image can be specified to read from. It could be useful to have a priority-ordered list of images to check for cache hits. @mattste provided this use case:
Use Case
I'm attempting to do pull request previews where each pull request has its own Docker image. For pull requests that update a dependency (such as a package.json or mix.lock), these builds can be super slow.
Current Options
Per-branch cache
The suggested fix would be to have the pull request's branch use its own cache instead of using the main branch cache. earthly --remote-cache=us-west1-docker.pkg.dev/my-org/my-repo/build-cache:cache-$branch-name-v1 --push +build.
The downside of this approach is that it can be very slow for the very first commit's build as it has to start from nothing.
CircleCI Approach
On CircleCI, we can do the following:
This can speed up builds dramatically.
Conclusion
I'd love to see Earthly better handle this use case. I'm not sure how to have this play nicely with CACHE and --remote-cache.
For more information, see this Slack thread
The text was updated successfully, but these errors were encountered: