-
-
Notifications
You must be signed in to change notification settings - Fork 83
Caching in pytest #242
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
base: main
Are you sure you want to change the base?
Caching in pytest #242
Conversation
@zakwatts you ok to look at this? |
Yes happy to review |
python-version: 3.11 | ||
|
||
- name: Cache pip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the slow down is largely due to needed to download a model rather than pip caching.
Pip caching is currently included in workflow: https://github.com/openclimatefix/.github/blob/095e2489f12ba5269e4a6382b3db09d79c236ab6/.github/workflows/python-test.yml#L65
What we really want to cache is the model/data being downloaded |
Looking into adding caching into the existing workflow: https://github.com/actions/cache |
Think it might be easiest to copy the openclimatefix/.github workflow and then we can modify it in the Open Quartz repo so that we can set up some custom caching and keep it all in the same job run. Looking into this |
I think the primary issue is downloading the v2 model |
The model is unzipped each time the test runs which i think takes a decent amount of time |
The more detail on the tests is quite useful. Looks like the test forecast with no ts test is taking up a lot of time. Given it's a unit test, need to figure out why it takes so much longer in all tests than just unit tests. |
@zakwatts so from your review what I understand is that one of the unit tests is actually downloading and unpacking a large model on every run (models/v2/model_10_202405.ubj.zip) and simply caching pip will not help with that. We effectively have two main approaches in that case,
What do you think @zakwatts @peterdudfield ? |
@aryanbhosale did you try implementing caching of the huggingface model? |
Pull Request
Description
@peterdudfield we will need to update the reusable workflow: openclimatefix/.github/.github/workflows/python-test.yml@issue/pip-all
to have something like this:
so that whenever we call that reusable workflow we will benefit from pip caching automatically.
Fixes #231