Summary
The user is seeking guidance on adjusting the SAT prune logic to be less aggressive, aiming to prevent the deletion of all items and instead only remove those not referenced by the latest builds. They note existing flags for controlling target size and age for pruning but express concern over the lack of controls on a per-build basis. The user suggests using the time since the last build for age-based pruning and questions the absence of logic for making "GC roots" point to the results of the most recent builds. They mention the possibility of creating their own "GC roots" by running different earthly-buildkitd
daemons with separate docker volumes, although this may be cumbersome. Additionally, they reference a hidden argument, --installation-name
/EARTHLY_INSTALLATION_NAME
, which could simplify using multiple daemons but comes with the caveat of managing multiple configurations at the CLI.
brett.higgins
I've been confused by the cache expiry behavior as well. It seems like least-recently-used ought to be the default, but instead it's least-recently-created? Is that correct?
corey
No, unfortunately. You might be able to create your own "GC roots" by running different earthly-buildkitd
daemons, which would use different docker volumes to hold the cache and manage per-purpose that way. It... might be annoying to have to specify that each time though.
We do have a hidden argument to make this easier that we use in development sometimes - --installation-name
/EARTHLY_INSTALLATION_NAME
that can control the name of the docker container, volume, and the config directory used for that specific invocation. It might make using multiple daemons easier; at the expense of managing multiple config/accounts at the CLI. Be warned that this is for our internal use, so YMMV. We also haven't really changed this option recently, so it may remain stable for the forseeable future?
me1548
oh, there's no logic for making "GC roots" pointing to the results of the most recent builds?
corey
We have flags to control the target size (--size
), which prunes the cache down to a specific size, or age-based(--age
), which prunes the cache older than the specified duration. We do not offer controls on a per-build basis.
If this is automated, I might see if I can use time time since the last build to help decide the value to use for --age
.
me1548
is there a way to make the sat prune logic less aggressive? it deletes everything, but I want it to only delete things not referenced by the most recent builds