Skip to content

Cache pip and uv downloads in GitHub Actions - #7287

Merged
mataylor-nvidia merged 4 commits into
isaac-sim:developfrom
mataylor-nvidia:mataylor/ci-cache-pip-uv
Aug 24, 2026
Merged

mataylor-nvidia merged 4 commits into
isaac-sim:developfrom
mataylor-nvidia:mataylor/ci-cache-pip-uv

Conversation

@mataylor-nvidia

Copy link
Copy Markdown
Contributor

Description

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.

astral-sh/setup-uv — enable-cache: true

Location Covers
docs.yaml (both jobs) uv sync --extra test
kitless-docker.yml uv run --with pytest --with pyyaml
.github/actions/install-ci-run uv venv --seed + managed 3.12

The 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 via arm-ci.yml.

actions/setup-python — cache: pip

Added to changelog-check.yml, skills-check.yml, tools-tests.yml, wheel.yml. Each pins cache-dependency-path: pyproject.toml; the action's **/requirements.txt default would otherwise key off tools/template/requirements.txt, which is unrelated to what these jobs install.

Deliberately left uncached

  • resolve-ov-pins and nightly-changelog install nothing with pip (stdlib tomllib / tools/changelog/cli.py only), so a cache round-trip would be pure overhead.
  • test-multi-gpu.yaml runs ./isaaclab.sh --install on 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 quota build.yaml notes was exhausted once before.

Note that the Docker-side --mount=type=cache on pip in docker/Dockerfile.base does not persist across runs: docker-build creates a per-job docker-container builder and removes it in a trap, and BuildKit does not export type=cache mount contents through --cache-to. That is unchanged here; the deps-hash image short-circuit already covers that path.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

CI-only change: no source package touched, so no changelog fragment is required (tools/changelog/cli.py check passes clean).

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-apps

greptile-apps Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR enables pip and uv caching across CI workflows and replaces the wheel workflow’s pip-installed uv bootstrap with setup-uv.

  • Enables uv caching for documentation, kitless-container, wheel-resolution, and composite CI jobs.
  • Enables pip caching for skills, tools, and wheel workflows with workflow-specific dependency keys.
  • Leaves changelog checking uncached because its pip installation is conditional.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
.github/workflows/wheel.yml Adds pip and uv cache setup and removes the explicit pip-based uv bootstrap.
.github/actions/install-ci-run/action.yml Explicitly enables setup-uv caching for hosted and self-hosted action consumers.
.github/workflows/docs.yaml Enables uv caching in both documentation jobs.
.github/workflows/kitless-docker.yml Enables uv caching for the conditional kitless validation path.
.github/workflows/skills-check.yml Adds a pip cache keyed to the workflow’s fixed installation list.
.github/workflows/tools-tests.yml Adds a pip cache keyed to the workflow’s tool-test dependencies.
.github/workflows/changelog-check.yml Documents why caching remains disabled for the conditional pip path.

Reviews (2): Last reviewed commit: "Fix pip cache key collisions and uncache..." | Re-trigger Greptile

Comment thread .github/workflows/wheel.yml Resolved

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Aug 21, 2026
# 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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we don't really edit this file directly so this may not be too important to include

@mataylor-nvidia
mataylor-nvidia merged commit d508d95 into isaac-sim:develop Aug 24, 2026
46 of 47 checks passed
mataylor-nvidia added a commit that referenced this pull request Aug 24, 2026
…#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants