Repository navigation
[FIX] Caching changes in CI - #722
Open
CozySocksAlways wants to merge 3 commits into
Open
CozySocksAlways wants to merge 3 commits into
CozySocksAlways wants to merge 3 commits into
Conversation
Switch cache paths to .ci-data relative to $GITHUB_WORKSPACE. Add retry logic and hash validation when fetching dataset SHA. Show restored cache key in action logs for easier debugging.
Closed
3 tasks done
Collaborator
CozySocksAlways
requested review from
kohlerca
and removed request for
mdenker
November 9, 2026 10:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Desc
CI is meant to run against a cached copy of
elephant-data, and never actually contact GIN, which nowadays answers GitHub runners mostly withHTTP Error 403: Forbidden. But several places still contacted GIN, i.e there are leaks~/elephant-datawithenableCrossOsArchive: true. The archive stores the path relative to the workspace (../../../elephant-data), so on Windows it was extracted toD:\elephant-data, while the export step looked in$env:USERPROFILE\elephant-data, found nothing and silently skipped settingELEPHANT_DATA_LOCATION. Every data test on Windows then downloaded from GIN.docsjob had norestore-elephant-datastep, so the tutorial notebooks (load_data()) downloaded from GIN duringmake html.git ls-remoteon GIN to build the cache key. On a 403 error the step still succeeded with an empty hash, so the key silently becamedatasets-cache_elephant_data.ymlsaved a stray cache under the keydatasets-whengit ls-remotefailed.Changes
.ci-data/elephant-datain bothcache_elephant_data.ymland the restore action. It is relative to$GITHUB_WORKSPACE, so it is the same on all OSes.git ls-remoteto GIN. It uses a primary key that is never hits (use-restore-key) and so falls back torestore-keys: datasets-, which picks the newestdatasets-*cache.(Usingkey: datasets-directly would prefer an exact match, i.e. the straydatasets-entry,over newer hashed ones.) A new step prints the restored key.
cache_elephant_data.yml:git ls-remoteis retried 3 times , then the result hash is checked for sanityCI.yml:restore-elephant-datastep added to thedocsjob.To-Do
Note
test-only cache for this PR: A
pull_requestrun can only restore caches from its own ref (refs/pull/722/merge), the base branch (in INM6), or the default branch (master on NeuralEnsemble). Caches onmasterstill use the old~/elephant-datapath, which gives a different cache version, so they don't match.To test the restore path in this PR, I temporarily added a
pull_request:trigger tocache_elephant_data.yml. That run saveddatasets-<hash>with the new.ci-data/elephant-datapath onrefs/pull/722/merge, and I then re-ran the CI jobs against it.