feat: use GitHub Actions cache to persist the CernVM-FS cache#61
feat: use GitHub Actions cache to persist the CernVM-FS cache#61vvolkl wants to merge 8 commits intocvmfs-contrib:mainfrom
Conversation
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
| sudo mkdir -p "${{ inputs.cvmfs_cache_base }}" | ||
| sudo chmod a+rwx "${{ inputs.cvmfs_cache_base }}" | ||
| shell: bash | ||
| - uses: actions/cache@v5 |
There was a problem hiding this comment.
Do we need an explicit cache restore and save? https://github.com/actions/cache/tree/main/save
I think right now we'll just not pick up a cache the first time, fill the cache and save it, and then every future time we'll reuse that cache but (crucially) not save it.
There was a problem hiding this comment.
Right, for sure the cache should be updated. maybe also why this didn't work in my testing in https://github.com/vvolkl/podio
| actions_cache: | ||
| description: 'Enable a GitHub Actions cache for persistent CernVM-FS cache contents under cvmfs_cache_base. With the default shared cache, cachedb and object directories live under the shared subdirectory.' | ||
| required: false | ||
| default: 'true' |
There was a problem hiding this comment.
If default enabled, so we want to set a max size and allow that to change? Some users may be relying on their 10 GB github workflow cache allocation for other purposes. So, I imagine they might get surprised if some large geant4 data file read causes their caching strategy to fall to pieces suddenly.
There was a problem hiding this comment.
Yes, probably we want to start by introducing this feature with default off, I mostly changed this for convenience as I was testing it in https://github.com/vvolkl/podio
A max size for this cache is a good idea. We can shrink the cvmfs cache to a certain size MB before saving the cache with cvmfs_talk -i my.repo.org cleanup <MB>
Continuation of #37
I think the action just needed to restrict itself to the data directories and cache db. Plus, I was fighting some permission issues to get the cvmfs user to see the workspace dir, so finally I opted to put the cache in /opt/cvmfs-cache and make that world readable. May need some further testing in a production repo, but looks good to me overall.