-
Notifications
You must be signed in to change notification settings - Fork 387
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
Allow not persisting CACHE mount #3510
Conversation
Thanks for the PR; it should be |
Hey @alexcb - note that currently, the behavior is to always persist. So then the default should remain |
Either way, the existence of this new option still requires a feature flag. Something like |
That's what I tried to say, but words are hard.... thanks for clarifying this :) I understood the question as which of the two boolean flag names do we want:
I think we'll want
I wonder if we really need that in this case, because old users of |
It's best to add a feature flag for new commands and new options, even if they're backwards compatible. The reasoning is that every 0.7 Earthly should be able to build any VERSION 0.7 Earthfile. |
BTW should be call the flag --no-persist? It's a little more consistent |
A friendly reminder, stemming from the discussion in #3510 (comment) Signed-off-by: Alex Couture-Beil <[email protected]>
A friendly reminder, stemming from the discussion in #3510 (comment) Signed-off-by: Alex Couture-Beil <[email protected]>
A friendly reminder, stemming from the discussion in #3510 (comment) Signed-off-by: Alex Couture-Beil <[email protected]>
Adding extra flag seems ok.. So to summarise. When build with:
Would persist cache as currently (so would not be a breaking change). If build with:
Would not persist it (not a breaking change because guarded by option). If build with:
Would persist it. |
This would mean when users upgrade to |
Yeah, it feels like a good decision. It is sometimes surprising to users that this auto-persisting is taking place, and sometimes it affects performance due to the size of the cache. |
Co-authored-by: Alex Couture-Beil <[email protected]>
Thats something I didn't take into account.. ps. what are the use cases when saving cache is essential? |
Wrong button :) |
Sometimes users will want to populate some cache in one target, and reuse most of it in another target. For example: download dependencies in one target, but then have those dependencies around when compiling in another target. The pattern is very common in some languages. |
But as far as its in earthly its way faster to just mount cache in that other target. |
Adds option to disable persist cache.
See #3509 for details.
Im not sure if by default should be
persist
ornot-persist
.Persisting data seems bad idea in most "global" caches, cause they will grow and it takes ages to persist them.
And caches are well, caches and I assume in most cases are not needed in image..
And if someone wants to persist it it can enable it.