-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
Add a goal to introspect and garbage collect caches. #11167
Comments
This comment has been minimized.
This comment has been minimized.
I've added some information about clearing caches to https://www.pantsbuild.org/v2.3/docs/troubleshooting#cache-or-pantsd-invalidation-issues. |
Following on from https://pantsbuild.slack.com/archives/C0105PY6BM5/p1612892422002100 It could be handy to have some goal (or standalone utility, or flag, or something), to perform a garbage collection of the lmdb store, but rather than being time-based, using local action cache entries as GC roots, and only keeping digests referenced by these roots. Allows us to prune "we made a copy of every input file" while preserving "we can avoid doing expensive work". Ideally we could order the action cache entries by time, too, so that there's some LRU cut-off. |
Great idea. I'm going to go ahead and drop the |
Re: the command name. I think Since you're thinking of doing multiple interesting things with the caches, perhaps this would become
|
That is actually what is happening when the store is garbage collected:
|
#13991 made further improvements to |
Relatedly: it's probably time for named caches to evolve actual infrastructure backed by a For example: a reified named cache for PEX could incorporate the advice from #14364 and more aggressively cleanup |
Highlighted Changelogs: * https://github.com/pex-tool/pex/releases/tag/v2.17.0 * https://github.com/pex-tool/pex/releases/tag/v2.18.0 * https://github.com/pex-tool/pex/releases/tag/v2.19.0 ``` Lockfile diff: 3rdparty/python/user_reqs.lock [python-default] == Upgraded dependencies == idna 3.8 --> 3.10 pex 2.16.2 --> 2.19.0 ``` ref pantsbuild#18294 pantsbuild#11167
Highlighted Changelogs: * https://github.com/pex-tool/pex/releases/tag/v2.17.0 * https://github.com/pex-tool/pex/releases/tag/v2.18.0 * https://github.com/pex-tool/pex/releases/tag/v2.19.0 * https://github.com/pex-tool/pex/releases/tag/v2.19.1 ``` Lockfile diff: 3rdparty/python/user_reqs.lock [python-default] == Upgraded dependencies == idna 3.8 --> 3.10 pex 2.16.2 --> 2.19.1 ``` ref pantsbuild#18294 pantsbuild#11167
Highlighted Changelogs: * https://github.com/pex-tool/pex/releases/tag/v2.17.0 * https://github.com/pex-tool/pex/releases/tag/v2.18.0 * https://github.com/pex-tool/pex/releases/tag/v2.19.0 * https://github.com/pex-tool/pex/releases/tag/v2.19.1 ``` Lockfile diff: 3rdparty/python/user_reqs.lock [python-default] == Upgraded dependencies == idna 3.8 --> 3.10 pex 2.16.2 --> 2.19.1 ``` ref #18294 #11167
For pex named-cache management specifically, see pex-tool/pex#2586 (comment) about the new |
This might look like:
Because this will need to access APIs which should not be available to
@rules
, this should likely be a "builtin" goal:./pants gc
(similar to./pants help
).A suggested series of four-ish PRs for this one.
gc
/garbage
/storage
/etc (depending on the default of the--check
flag)--check
mode which reports the disk usage in the two storage locations:--no-check
mode, which will collect garbage in both locationsnamed_caches_dir
(probably? cc @jsirois) delete the oldest top-level directory that gets you below a hardcoded targetlocal_store_dir
, call garbage_collect_storelocal_store_dir
andnamed_caches_dir
local_store_dir
, but the "target" size (i.e., the size that garbage collection should attempt to collect down to) is hardcoded.The text was updated successfully, but these errors were encountered: