Skip to content

Cache downloads on CI to reduce execution time and avoid rate limiting - #318

Open
ceriottm wants to merge 8 commits into
mainfrom
bugfix/cache
Open

ceriottm wants to merge 8 commits into
mainfrom
bugfix/cache

Conversation

@ceriottm

@ceriottm ceriottm commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

The cache also works with the manual downloads within the recipes, giving some more sense to the helper package. Cache is invalidated every 10 days so that packages don't lag behind, and can be cleared if necessary for development.

Made with some help from an LLM

ceriottm and others added 2 commits November 9, 2026 11:10
The cache also works with the manual downloads within the recipes,
giving some more sense to the helper package. Cache is invalidated
every 10 days so that packages don't lag behind, and can be cleared
if necessary for development.
Lets the full cache cycle (collect, merge, save, cleanup, reuse) run on
this PR. To be reverted before merging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Here is the build version of the cookbook in this pull request: documentation.zip, you can view it locally by unzipping documentation.zip and open the index.html with your favorite browser.

@pfebrer

pfebrer commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

I think having a cache that is not aware of when it is outdated will create confusion. E.g. a bug only appearing when the cache is refreshed, or the opposite.

I think hugging face provides a cache functionality (we use it in metatrain I think) that is aware of outdated files. If the reason we are doing this is for hugging face downloads it should be possible to integrate.

But if you really really really want to have it as implemented here, I would at least make it refresh before our weekly Monday run, not every 10 days.

Comment thread src/atomistic-cookbook-utils/README.md Outdated
directory, downloads go through a cache in that directory, keyed by URL,
so a file fetched once (e.g. by another recipe) is copied from there
instead of being downloaded again. The cookbook CI uses this to share
data files across recipes. With the variable unset nothing changes, any

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does "nothing changes" mean here?

@ceriottm

ceriottm commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

I think having a cache that is not aware of when it is outdated will create confusion. E.g. a bug only appearing when the cache is refreshed, or the opposite.
I think hugging face provides a cache functionality (we use it in metatrain I think) that is aware of outdated files. If the reason we are doing this is for hugging face downloads it should be possible to integrate.
But if you really really really want to have it as implemented here, I would at least make it refresh before our weekly Monday run, not every 10 days.

I thought a lot about this. We keep getting rate limits on huggingface, zenodo, now also on conda because we download conda >40 times. The fact that there might be "delayed fails" is IMO no different from the fact that we get failures every monday morning, but it's annoying that every morning morning we need to relaunch 3 times before no runs fails because of rate limiting. I also feel bad for the insane amount of traffic that we generate downloading torch 60 times

@pfebrer

pfebrer commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

We can do it ok, but I would set the max age to 6 days or something like that, so that at least we ensure that there are no 2 consecutive builds on outdated stuff.

Also, I don't have the bandwith to review the details of the implementation, which has lots of pieces, so:

  • I just trust that you understand enough of it
  • I don't think I'll be able to maintain it

This branch has not been deployed

No deployments
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