-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Proof of concept: Cache Conda env and add ccache #45698
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
Conversation
If this works and is robust it'll be great. |
It should be pretty robust. For the Conda caching part the key is to come up with a proper cache key, ie. something that changes whenever the deps are changed. (Strictly speaking it should be invalidated every time Anaconda/Conda-forge is updated but that would invalidate the cache every few minutes.) For ccache I don't think we'll have to take care of anything as ccache is an incredibly robust and widely-used tool. |
How are we gaining 10 minutes? The env setup takes around 4 |
By caching the C compilation using ccache, which takes around 6-8 minutes |
Does the compilation recognize, that it is already there when you try recompiling it? |
Can you please clarify the question? |
Maybe something like |
Can you elaborate please? How would you export an env before it's been installed? |
Sorry I was wrong... It should be something like this |
I see, that makes more sense. But it would also invalidate the cache whenever there is a minor version update of any of the (transitive) dependencies, so the cache would likely not survive more than a couple of hours. |
Could you clarify which part of the setup this is caching? Package download and/or c compilation? Does this skip the dependency solve step as well? (Off-topic: I'd like to eventually see the CI use conda-lock files as I've been trying to align/share dependency files. Not sure how this intersects with this change. https://github.com/conda-incubator/conda-lock) |
This implements env caching and C compilation caching. Env caching = caching the entire |
Re conda-lock: that definitely makes sense and also makes env setup faster. |
We could set up a daily CI job to generate a lock file for each build. |
see https://github.com/ibis-project/ibis/blob/master/poetry.lock @cpcloud has spent a bit of time setting up using these lock file with github actions on ibis. maybe can offer a good roadmap here. |
The way this works for ibis is that whenever someone submits a PR that modifies files related to dependencies, we trigger a PR comment
This setup was adapted from https://github.com/pangeo-data/pangeo-docker-images/blob/master/.github/workflows/ChatOpsDispatcher.yml. |
Caching Conda environments should gain another ~4 minute cut (and more on Windows). |
Closing this (splitting work into multiple PRs) |
Proof of concept to speed up GH actions builds by ~10 minutes.
I wonder what everyone thinks about this and whether you think this is worth spending more effort on (eg. porting it also to Azure).