Skip to content

Conversation

kfindeisen
Copy link
Member

@kfindeisen kfindeisen commented Jun 11, 2024

This PR adds a dataset cache to ensure the local repo never exceeds a configured size. The implementation is quite messy and may need to be replaced later, but the basic configuration hooks should be permanent.

Copy link
Contributor

@erinleighh erinleighh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looked good, only one minor comment on a comment.

This class will track which datasets should be kept in the local repo.
Allowing multiple implementations lets us adjust strategies for
external factors like detector affinity without investing in support
up front.
The new spec is not only easier to implement, it's also more robust for
segmented or rapid-demotion type eviction strategies, which could
otherwise throw out incoming objects before they even get a chance to
be used.
This implementation of EvictingSet chooses eviction candidates at
random. This implementation is appropriate for caching when the access
pattern is itself random, as in the absence of affinity.
This callback allows optional access to the dataset list without
breaking the existing API. It's a stop-gap prior to refactoring
the function.
This class stores a configurable cache of DatasetRefs, but does not
directly link them to Butler datasets. It is a Collection but otherwise
supports a bare minimum of methods.
The LOCAL_REPO_CACHE_SIZE envvar sets the number of regular datasets
(e.g., calibs) to hold in the repo at once. Most runs need multiple
templates and refcats, so these get a multiplier.
The hack was a workaround for not being able to manage the local repo
properly. Now that we can remove contents more precisely, there's no
need to keep it around.
@kfindeisen kfindeisen merged commit 09425cb into main Jun 14, 2024
@kfindeisen kfindeisen deleted the tickets/DM-40193 branch June 14, 2024 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants