Skip to content

feat: use GitHub Actions cache to persist the CernVM-FS cache#61

Open
vvolkl wants to merge 8 commits intocvmfs-contrib:mainfrom
vvolkl:cache-cvmfs-cache
Open

feat: use GitHub Actions cache to persist the CernVM-FS cache#61
vvolkl wants to merge 8 commits intocvmfs-contrib:mainfrom
vvolkl:cache-cvmfs-cache

Conversation

@vvolkl
Copy link
Copy Markdown
Collaborator

@vvolkl vvolkl commented Mar 8, 2026

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.

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
@vvolkl vvolkl requested a review from wdconinc March 8, 2026 16:08
Comment thread action.yml
sudo mkdir -p "${{ inputs.cvmfs_cache_base }}"
sudo chmod a+rwx "${{ inputs.cvmfs_cache_base }}"
shell: bash
- uses: actions/cache@v5
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Right, for sure the cache should be updated. maybe also why this didn't work in my testing in https://github.com/vvolkl/podio

Comment thread action.yml Outdated
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'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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>

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.

2 participants