-
Notifications
You must be signed in to change notification settings - Fork 477
ci: add pip cache to CI jobs #12876
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
ci: add pip cache to CI jobs #12876
Conversation
|
|
Bootstrap import analysisComparison of import times between this PR and main. SummaryThe average import time in this PR is: 246 ± 6 ms. The average import time in main is: 249 ± 6 ms. The import time difference between this PR and main is: -3.2 ± 0.3 ms. Import time breakdownThe following import paths have shrunk:
|
BenchmarksBenchmark execution time: 2025-03-25 16:13:20 Comparing candidate commit 835b284 in PR branch Found 2 performance improvements and 0 performance regressions! Performance is the same for 496 metrics, 2 unstable metrics. scenario:iast_aspects-format_map_aspect
scenario:iast_aspects-replace_aspect
|
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.
Pull Request Overview
This PR adds pip caching to various CI jobs to improve performance and reduce repeated downloads of packages. Key changes include:
- Adding pip cache commands and environment variables to the GitLab CI configuration for both "riot" and "hatch" runners.
- Introducing a new mechanism to generate a unique pip cache key for "riot" jobs using a SHA256 sum from requirements files.
- Updating the docs and precheck job configurations to include pip caching details.
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/gen_gitlab_config.py | Introduces pip cache configuration with dynamic key generation and environment variable setup for CI jobs. |
| .gitlab/tests.yml | Updates the hash generation for riot tests by replacing the inline command with a dedicated script. |
Files not reviewed (2)
- .gitlab/scripts/get-riot-hashes.sh: Language not supported
- .gitlab/scripts/get-riot-pip-cache-key.sh: Language not supported
Adds a pip cache to a large number of our CI jobs.
For riot: this does this by using a unique pip cache key per-job based on the sha256sum of all of the
.riot/requirements/*.txtfiles for all the venvs matching the suite name or pattern. This way if any deps change we'll invalidate the cache to ensure it doesn't grow in size forever.For hatch: this uses the job name as the key.
The goal is to cache the downloaded wheels/distributions to save on network bandwidth and effort for downloading every time. This will also help cache built wheels if the downloaded distribution is a source distribution.
Checklist
Reviewer Checklist