Repository navigation
Cache pip and uv downloads in GitHub Actions - #7287
Conversation
Python packages were re-downloaded from PyPI on every CI run. Only license-check.yaml enabled a package cache; every other workflow that installs Python dependencies did so uncached. Enable astral-sh/setup-uv's cache in docs.yaml (both jobs), kitless-docker.yml, and the install-ci-run composite action. The latter sets enable-cache explicitly rather than relying on the default `auto`, which turns the cache on only for GitHub-hosted runners -- that action also runs on the self-hosted arm64 runner via arm-ci.yml. Enable actions/setup-python's pip cache in changelog-check.yml, skills-check.yml, tools-tests.yml, and wheel.yml. Each pins cache-dependency-path to pyproject.toml; the action's `**/requirements.txt` default would otherwise key off tools/template/requirements.txt, which is unrelated to what these jobs install. Left uncached: resolve-ov-pins and nightly-changelog install nothing with pip (stdlib only), and test-multi-gpu.yaml runs `isaaclab.sh --install` on a self-hosted runner, where a multi-GB torch cache would compete with the Warp kernel cache for the 10 GB per-repository quota.
Greptile SummaryThe PR enables pip and uv caching across CI workflows and replaces the wheel workflow’s pip-installed uv bootstrap with
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "Fix pip cache key collisions and uncache..." | Re-trigger Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
The change enables pip and uv download caching across seven CI definitions while leaving dependency installation commands, job gating, and source packages unchanged. The selected cache dependency path is available after checkout in each affected setup-python job, and no actionable issue was identified.
- Design and architecture: Caching is added at the existing Python and uv setup boundaries rather than introducing a separate caching layer. The explicit uv cache override also covers the composite action’s self-hosted arm64 execution path, while the intentionally excluded large installer workflow remains unaffected.
- API: No public Python API, CLI contract, extension manifest, or documented user behavior changes. The only behavioral adjustment is internal to CI: the composite action explicitly enables setup-uv caching instead of retaining its runner-dependent automatic default.
- Implementation: Each setup-python cache step runs after checkout, so pyproject.toml is present for cache-key hashing, including the conditionally executed wheel build path. The cached uv setup steps feed existing uv sync, uv run, or uv venv commands that use the uv cache. A non-blocking tradeoff is that ad hoc pip package-list changes do not alter the pyproject.toml-based key, although pip still resolves and downloads any missing artifacts as needed.
No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.
Automated review; human maintainers own approval decisions.
CI evidence from the first run of this PR surfaced three problems. All four setup-python jobs hashed the same cache-dependency-path on the same Python and runner OS, so they computed one shared key. Only the first to finish saved; the others logged "Failed to save: Unable to reserve cache with key", and the surviving entry held just that job's downloads. Key each on its own workflow file instead, which both de-collides them and ties invalidation to the install list rather than to unrelated pyproject.toml churn. changelog-check installs pytest only when the PR touches tools/changelog/. On every other run pip never executes, ~/.cache/pip is never created, and setup-python's post-job save fails the job outright. Drop the cache there. wheel.yml resolves the wheel's extras with `uv pip install --dry-run`, whose downloads land in ~/.cache/uv and so were untouched by the pip cache. Provision uv with setup-uv and enable its cache, which also removes the ~24 MB `pip install --user uv` bootstrap. Caching matters here beyond wall-clock: an index outage currently fails the job after with-python-package-retries.sh exhausts its retries, while a warm cache removes the network dependency entirely.
The wheel job's new setup-uv step pins no python-version, so it computed the same `-unknown-` cache key as kitless-docker and the two would race to save one entry. Give it a cache-suffix: this job caches the wheel's full extras resolution, kitless caches a two-package test run, and neither should evict the other. The fragment is a .skip: this change touches no source package and needs no release note.
| # otherwise identical across every 3.12 ubuntu job here, so they collide | ||
| # and all but the first fail to save. Covers the `build` and `wheel` | ||
| # packages that tools/wheel_builder/build.sh installs with pip. | ||
| cache-dependency-path: .github/workflows/wheel.yml |
There was a problem hiding this comment.
you mentioned the build package here but did not include it in the dependency paths, should we also include tools/wheel_builder/build.sh here?
There was a problem hiding this comment.
I guess we don't really edit this file directly so this may not be too important to include
…#7321) ## Summary - Backport of #7287 (squash commit `d508d95`), cherry-picked with `-x`; applied with no conflicts and the diff is identical to develop. - Enable `enable-cache: true` for `astral-sh/setup-uv` in `docs.yaml` (both jobs), `kitless-docker.yml`, and `.github/actions/install-ci-run`. The composite action sets it explicitly rather than relying on the default `auto`, which enables the cache only on GitHub-hosted runners. - Enable `cache: pip` for `actions/setup-python` in `skills-check.yml`, `tools-tests.yml`, and `wheel.yml`, each keyed on its own workflow file so the jobs do not collide on one cache key. - Provision uv in the wheel job through `setup-uv` under a `wheel-extras` cache suffix, replacing the `pip install --user uv` bootstrap. - `resolve-ov-pins`, `nightly-changelog`, `changelog-check.yml`, and `test-multi-gpu.yaml` stay uncached; the inline comments explain why. CI-only change: no source package touched, so the changelog fragment is a `.skip`. ## Test plan - [x] `git diff` of this commit is byte-identical to the diff of `d508d95` on develop. - [x] Verified the `wheel.yml` context this depends on exists on `release/3.0.0` (`steps.changes.outputs.run_build`, and the `uv pip install` calls that now rely on `setup-uv` for `uv`). - [x] `uv run isaaclab -f` passes. `check-changelog-fragments` reports a pre-existing failure unrelated to this change (it defaults to `origin/develop`; with `ISAACLAB_CHANGELOG_BASE_REF=release/3.0.0` it reports all fragments valid). - [ ] Cache hit/save behavior confirmed by the CI runs on this PR. ## Follow-up (not in this backport) `install-ci-run`, both `docs.yaml` jobs, and the existing `license-check.yaml` all resolve to the same uv cache key (`setup-uv-1-x86_64-unknown-linux-gnu-3.12-pruned-<deps hash>`), since the hash covers the repo's dependency files rather than the job. Only one of them can save per ref; the others restore a mismatched payload and skip saving. That needs a `cache-suffix` fix on develop first, then a separate backport.
Description
Python packages were re-downloaded from PyPI on every CI run. Only
license-check.yamlenabled a package cache; every other workflow that installs Python dependencies did so uncached.astral-sh/setup-uv—enable-cache: truedocs.yaml(both jobs)uv sync --extra testkitless-docker.ymluv run --with pytest --with pyyaml.github/actions/install-ci-runuv venv --seed+ managed 3.12The composite action sets this explicitly rather than relying on the default
auto, which enables the cache only on GitHub-hosted runners — that action also runs on the self-hosted arm64 runner viaarm-ci.yml.actions/setup-python—cache: pipAdded to
changelog-check.yml,skills-check.yml,tools-tests.yml,wheel.yml. Each pinscache-dependency-path: pyproject.toml; the action's**/requirements.txtdefault would otherwise key offtools/template/requirements.txt, which is unrelated to what these jobs install.Deliberately left uncached
resolve-ov-pinsandnightly-changeloginstall nothing with pip (stdlibtomllib/tools/changelog/cli.pyonly), so a cache round-trip would be pure overhead.test-multi-gpu.yamlruns./isaaclab.sh --installon a self-hosted runner. Its pip cache would be multi-GB (torch, Isaac Sim wheels) and would compete with the Warp kernel cache for the 10 GB per-repository quota — the same quotabuild.yamlnotes was exhausted once before.Note that the Docker-side
--mount=type=cacheon pip indocker/Dockerfile.basedoes not persist across runs:docker-buildcreates a per-jobdocker-containerbuilder and removes it in a trap, and BuildKit does not exporttype=cachemount contents through--cache-to. That is unchanged here; the deps-hash image short-circuit already covers that path.Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists thereCI-only change: no source package touched, so no changelog fragment is required (
tools/changelog/cli.py checkpasses clean).