Skip to content
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

Pip caching should include Python version in cache key #304

Closed
2 of 5 tasks
reuben opened this issue Dec 17, 2021 · 1 comment · Fixed by #303
Closed
2 of 5 tasks

Pip caching should include Python version in cache key #304

reuben opened this issue Dec 17, 2021 · 1 comment · Fixed by #303
Labels
bug Something isn't working

Comments

@reuben
Copy link

reuben commented Dec 17, 2021

Description:
Caching with cache: 'pip' will not include the Python version in the cache key, which leads to a cache that only speeds up the Python version that happened to create the original cache.

Action version:
v2

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
N/A

Repro steps:
I'm fixing the pip caching for the coqui-ai/TTS repo to speed-up the initial setup. We use matrix strategies to test across Python 3.6, 3.7, 3.8 and 3.9. I replaced an older broken actions/cache@v1 setup with the new caching functionality here, and saw a significant speed-up for Python 3.9 tasks, because it was a Py 3.9 job that happened to finish first and write the cache:

Before: https://github.com/coqui-ai/TTS/runs/4559378226?check_suite_focus=true
After: https://github.com/coqui-ai/TTS/runs/4559480121?check_suite_focus=true

On a different job running on Python 3.7, changing to the caching funcionality in setup-python actually slowed things down:

Before: https://github.com/coqui-ai/TTS/runs/4559377735?check_suite_focus=true
After: https://github.com/coqui-ai/TTS/runs/4559592755?check_suite_focus=true

This is because we spend extra time downloading the cache, but then can't use it.

Expected behavior:
The pip cache should be keyed by Python version.

Actual behavior:
The pip cache is shared between Python versions, leading to cached wheels not being used in subsequent runs with different Python versions.

@reuben reuben added bug Something isn't working needs triage labels Dec 17, 2021
@nikita-bykov
Copy link
Contributor

Hello @reuben, thanks for your request!
The related PR for including Python version in pip cache key was recently created.
We'll review it as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants