-
Notifications
You must be signed in to change notification settings - Fork 12
feat: use GitHub Actions cache to persist the CernVM-FS cache #37
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
base: main
Are you sure you want to change the base?
Changes from all commits
facf4a7
6e32f63
474f50f
4a786d4
557e438
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: cache | ||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '44 4 * * *' | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-24.04] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: mkdir -p ${{ github.workspace }}/.cvmfs | ||
- uses: ./ | ||
with: | ||
actions_cache: true | ||
cvmfs_cache_base: ${{ github.workspace }}/.cvmfs | ||
- name: Test CernVM-FS | ||
run: | | ||
source /cvmfs/sft.cern.ch/lcg/views/LCG_107/x86_64-ubuntu2404-gcc13-opt/setup.sh | ||
root -l -q -b |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -8,6 +8,10 @@ inputs: | |||||
description: 'Location (directory) of the user-space apt cache.' | ||||||
required: false | ||||||
default: 'apt_cache' | ||||||
actions_cache: | ||||||
description: 'Enable a GitHub Actions cache for the CernVM cache.' | ||||||
required: false | ||||||
default: 'false' | ||||||
cvmfs_alien_cache: | ||||||
description: 'If set, use an alien cache at the given location.' | ||||||
required: false | ||||||
|
@@ -351,6 +355,12 @@ runs: | |||||
key: cvmfs-apt-cache-${{ steps.lsb-release.outputs.id-release }}-${{ steps.lsb-release.outputs.arch }}-${{ hashFiles('action.yml') }} | ||||||
path: | | ||||||
${{ inputs.apt_cache }} | ||||||
- uses: actions/cache@v4 | ||||||
if: ${{ inputs.actions_cache == 'true' }} | ||||||
with: | ||||||
key: cvmfs-cache-${{ steps.lsb-release.outputs.id-release }}-${{ steps.lsb-release.outputs.arch }}-${{ hashFiles('action.yml') }} | ||||||
path: | | ||||||
${{ inputs.cvmfs_cache_base }} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
One further issue may be that the cache directory is used for a number of locks and marker files that we may not want to cache. I think in the end you only want to keep the actual data files in the hash directories ./00/ ... ./ff and maybe the ./cachedb file. I'll test a few configurations to see what works best. |
||||||
- run: | | ||||||
${{ github.action_path }}/setup-cvmfs.sh | ||||||
shell: bash | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as seen in #40, using
${{ hashFiles('action.yml') }}
as part of the key is not reliable as the file being hashed as very unlikely to appear in other repositories and causes caches to always miss.