Skip to content

CI Improve dataset caching for docs builds - #34769

Merged
lesteve merged 3 commits into
scikit-learn:mainfrom
betatim:fix-circleci-cache-config
Aug 19, 2026
Merged

lesteve merged 3 commits into
scikit-learn:mainfrom
betatim:fix-circleci-cache-config

Conversation

@betatim

@betatim betatim commented Aug 18, 2026

Copy link
Copy Markdown
Member

Reference Issues/PRs

Related to #34763

What does this implement/fix? Explain your changes.

This allows a CI job to re-use the cache from main or other branches from the same repository.

There is one cache used for branches within the upstream repo and then a separate cache per fork. So my fork has its own cache, and so does Loic's, etc. This means my fork can't poison the upstream repository. It also means it can't use a cache from the upstream repository. This is why I think it makes sense to have fallback keys configured. It increases the chances that a contributor's repo has some form of cache for the datasets that it can use.

This allows a CI job to re-use the cache from `main` or other branches
from the same repository.
@betatim

betatim commented Aug 18, 2026 •

Copy link
Copy Markdown
Member Author

The "Unit tests / Windows x64 pymin_conda_forge_openblas (pull_request)" job failed because some/all of the pytest workers crashed. I've seen this happen on #34763 where a restart seems to have "fixed" it. Looking at the log message I have no idea what happened/broke. However AI found #34717

I restarted the job here as well

@lesteve lesteve 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.

Seems worth a try. This will not fix all the issues since caches can not be shared across repo but this can help. Not sure how long CircleCI keep caches around.

We are already doing something like this for ccache cache in CircleCI.

Comment thread .circleci/config.yml Resolved
Comment thread .circleci/config.yml Resolved
@betatim

betatim commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

I think a cache lives for 14 days. So maybe it helps contributors who do a few PRs in series. It should help a bit more with our bots as they run every week.

Tweaking the cache keys seems like a "free" thing to try.


I investigated using a repo as cache (like you have), in a few different variations. The problem with git-lfs (needed for large files) is "bandwidth", I think we'd run out in days :-/ We could also make it a "github pages" based thing, but pages also have a bandwidth limit that we'd likely reach. AI read the terms of use for pages and thinks that hosting big files is not exactly within the terms of use. This is where I stopped searching, but AI suggested that using "releases" might be an option. It seems to have no size limits and no bandwidth limits. Maybe a bit more tricky to setup and use?

The other idea AI had was that we only really need to mirror OpenML, not other sites. And that the files for OpenML might not be that big -> no need for git-lfs. I've not investigated this more, but it could be interesting.

@betatim

betatim commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

My ~/scikit_learn_data/openml directory is about 170MB big and it looks like the files in it are all reasonably sized, just one is 66MB. So I think we could store this in a repo without needing git-lfs.

Comment thread .circleci/config.yml Resolved
Comment thread .circleci/config.yml Resolved
@lesteve
lesteve enabled auto-merge (squash) August 19, 2026 08:59
@lesteve

lesteve commented Aug 19, 2026

Copy link
Copy Markdown
Member

OK I am pretty sure a "not" was missing so I accepted my own suggestion and enabled auto-merge.

@betatim

betatim commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

Yes, you are right. A "not" was missing

@lesteve

lesteve commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

For some reason one job was taking a while, I canceled it and reran it, hopefully this will be merged eventually now 🤞 ... please 🙏 🤪

@lesteve
lesteve merged commit 6aa2f57 into scikit-learn:main Aug 19, 2026
47 of 49 checks passed
@betatim
betatim deleted the fix-circleci-cache-config branch August 19, 2026 12:28
@betatim

betatim commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

Finally!

There can always be more reviewing, but there can also always be more waiting for CI :D

prady0t pushed a commit to prady0t/scikit-learn that referenced this pull request Sep 2, 2026
@jeremiedbb jeremiedbb mentioned this pull request Sep 8, 2026
14 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants