move the BinaryCacheIndex location into the user home dir#22500
move the BinaryCacheIndex location into the user home dir#22500tgamblin merged 1 commit intospack:developfrom
Conversation
|
I think this will then supersede #20137, right? |
|
Oh yes!! This actually makes use of a spack/lib/spack/spack/binary_distribution.py Line 449 in dc5b244 |
|
@vvolkl: do you need this to be configurable? I'm trying to figure out why we'd need to move it/share it. If we can get away wtih sticking it in the |
|
|
|
ok given that, @cosmicexplorer can you just remove the separate config option for this, and assume it lives under misc_cache? |
|
@cosmicexplorer True that it is usually a good idea to be very careful with deprecations. But in this case, this option was not mentioned in the default config or documented, so I would say if @mslacken agrees I'd say it's fine to remove |
|
I am fine with it. I just added the option as before that it could point to a non writable directory for the user. |
scottwittenburg
left a comment
There was a problem hiding this comment.
I didn't pull this and try it, but in general, I have no objection to the cache living under misc cache in the absence of configuring a specific config:binary_index_root.
And because we used write transaction locking to write the binary index cache files, it should be fine that this is now in a location that could be shared among several spack instances. Thanks for explicitly pointing that out in the description, I would not have picked up on that detail otherwise 👍.
|
@mslacken -- thanks so much for putting that PR in! I am glad this would address the issue :D. @vvolkl thank you for the deprecation context -- that seems quite reasonable. @scottwittenburg -- thanks so much for the feedback and the point about write transaction locking!! I hadn't considered that and since I'm planning to make some other changes it was helpful to understand what makes this safe. I'm waiting on @tgamblin (who is very very busy today) to confirm that some others he said he'd contact aren't specifically relying on |
|
@cosmicexplorer: we're good -- go ahead with it |
Remote buildcache indices need to be stored in a place that does not require writing to the Spack prefix. Move them from the install_tree to the misc_cache.
dc5b244 to
f03cebd
Compare
|
@tgamblin looks like this is green -- can we merge it? |
Problem
BinaryCacheIndexwill pull downindex.jsonfiles from mirrors, then create aDatabasefrom it in a temporary directory to list remote specs. We would like this location to be shared among Spack instances which may share mirrors. Additionally, we would like to ensure that the default location for theseDatabaseinstances is definitely a user-writable directory.This is step 1 of addressing #19085, for which we plan to eventually create a separate
Databasewith its own TTL for "all specs Spack has ever seen", including the results ofspack specandspack solve.Solution
*_cache_location()methods (which return the cache's filesystem path) from private_*_cache()methods (which return the python object representing the cache).config:binary_index_rootis unset, use a subdirectory ofconfig:misc_cache(which defaults to~/.spack/cache).Result
After running
spack buildcache list, we now find a new directory~/.spack/cache/indiceshas been created, with the following contents: