E

SAT Prune Logic Inquiry

Summary

The user is inquiring about how to make the SAT prune logic less aggressive, as it currently deletes everything. They want it to only delete items that are not referenced by the most recent builds.

Status
open
Tags
  • SAT
  • Prune Logic
  • Builds
Source
#earthly
    b

    brett.higgins

    10/7/2024

    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?

    c

    corey

    10/7/2024

    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?

    m

    me1548

    10/7/2024

    oh, there's no logic for making "GC roots" pointing to the results of the most recent builds?

    c

    corey

    10/7/2024

    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.

    https://docs.earthly.dev/docs/earthly-command#earthly-prune

    m

    me1548

    10/7/2024

    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