Skip to content

Use a single dataset cache for all the runner OSes - #4772

Merged
alejoe91 merged 2 commits into
SpikeInterface:mainfrom
h-mayorquin:ci-single-gin-cache
Sep 10, 2026
Merged

alejoe91 merged 2 commits into
SpikeInterface:mainfrom
h-mayorquin:ci-single-gin-cache

Conversation

@h-mayorquin

Copy link
Copy Markdown
Contributor

I am still trying to figure out what exactly is failing on the caching cron job. It looks like multiple fetch requests are being denied on gin. While I think about a better solution that makes less fetch requests, one big thing we can do is reduce our cache footprint by using the same cache for all the OSes which will in turn reduce or requests. To do this we can use the new CI feature called enableCrossOsArchive which was released in actions/cache v3.2.3 in January 2023:
https://github.com/actions/cache/releases/tag/v3.2.3

I have been using it on neuroconv successfully for over a year now:
catalystneuro/neuroconv#1385

So this PR builds the cache once on Linux and shares it with macOS and Windows. I also made the hash step exit when git ls-remote comes back empty. Right now it silently produces the key datasets-, guarantees a miss and forces the full download that gin just refused.

I will be watching the first run to check for annex symlink behavior.

@h-mayorquin

Copy link
Copy Markdown
Contributor Author

This is ready @alejoe91

Ok, as you know the caching mechanism only lets a run restore caches from its own branch or from the default branch:
https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#restrictions-for-accessing-a-cache

There is no datasets- cache on main yet, so every job here misses and the CI is red. But this is already tested and validated.

I tested it on a branch instead, where the cron job and all-tests can run back to back on the same ref. All six jobs green, macOS, Windows and Ubuntu on 3.10 and 3.13:
https://github.com/SpikeInterface/spikeinterface/actions/runs/34401959163

One cache built on Linux, restored and used everywhere else.

An important change to make this work is the introduction of a new environment variable that lets the CI specify the location of the testing dataset: SPIKEINTERFACE_DATASET_FOLDER. This is done because the default is ~/spikeinterface_datasets and that sits outside the workspace. actions/cache stores such a path as ../.., which resolves to home on Linux and macOS but to D:\a\ on Windows. The cache was restoring to the wrong drive there. Moving it inside the workspace fixes it, and the variable is what points the tests at the new location.

This is a good thing in itself as it will allow our power users (like moi : P) to point to other directories.

@h-mayorquin h-mayorquin self-assigned this Sep 9, 2026
@h-mayorquin h-mayorquin added testing Related to test routines continuous integration Related to CI labels Sep 9, 2026

@alejoe91 alejoe91 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @h-mayorquin !!! Amazing!

@alejoe91
alejoe91 merged commit 297da5e into SpikeInterface:main Sep 10, 2026
18 of 24 checks passed
@h-mayorquin
h-mayorquin deleted the ci-single-gin-cache branch September 10, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

continuous integration Related to CI testing Related to test routines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants