Skip to content

Bake CI pytest deps into the built Docker image - #7193

Merged
AntoineRichard merged 5 commits into
isaac-sim:developfrom
mataylor-nvidia:mataylor/layer-ci-test-deps
Aug 20, 2026
Merged

AntoineRichard merged 5 commits into
isaac-sim:developfrom
mataylor-nvidia:mataylor/layer-ci-test-deps

Conversation

@mataylor-nvidia

@mataylor-nvidia mataylor-nvidia commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

Every CI test run installed the pytest harness (pytest, pytest-mock,
junitparser, flaky, coverage>=7.6.1) from PyPI before it could start —
once per test job in run_tests.sh, and again on each multi-GPU shard host in
multi_gpu_shard_runner.sh. That puts a network round-trip on the critical
path of every lane and makes runs fail on transient PyPI errors.

This bakes those packages into the image instead:

  • docker-build/action.yml gains a step that layers the pytest deps onto
    the freshly built image (FROM <image-tag> on stdin, no build context). It
    only runs when a real build happened — cache hits already carry the layer.
    The layer installs as root and restores the image's own default USER
    afterwards, read back from docker image inspect.
  • _lib/compute-deps-hash/action.yml now hashes
    .github/actions/docker-build/action.yml, so editing the package list
    invalidates the local deps-cache tag and forces a rebuild instead of
    silently reusing an image without the new packages.
  • run_tests.sh and multi_gpu_shard_runner.sh drop their now-redundant
    installs. The with-python-package-retries.sh wrapper added in [CI] Retry transient Python package downloads #7144 stays in
    place for the remaining TEST_EXTRA_PIP_PACKAGES / TEST_EXTRA_UV_PACKAGES
    installs, which are still per-run by design.

The deps stay out of the tracked Dockerfile.* files on purpose: those build
the local dev containers that ship via publish-images.yaml, and the pytest
harness is a CI-only concern.

Fixes # (issue)

Type of change

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

Validation

  • uv run isaaclab -f
  • bash -n on both modified shell scripts
  • YAML parse of both modified composite actions
  • uv run --no-project python tools/changelog/cli.py check develop

Screenshots

N/A — CI-only change.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation — N/A, no user-facing docs cover the CI image build
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works — N/A, CI itself is the test: every lane that pulls the image must still collect and run pytest
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package — N/A, no source/<pkg>/ files are touched; tools/changelog/cli.py check develop passes
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Every CI test run installed pytest, pytest-mock, junitparser, flaky and
coverage from PyPI before it could start — once per test job, and again
on each multi-GPU shard host. That put a network round-trip on the
critical path of every lane and made runs fail on transient PyPI errors.

Layer those packages onto the image in the docker-build action instead,
immediately after a real build, so the install happens once per image
and every cache hit inherits it. The layer runs as root and restores the
image's own default user afterwards.

The docker-build action file joins the deps-hash input set, so editing
the package list invalidates the local deps-cache tag and forces a
rebuild rather than silently reusing an image without the new packages.

Drop the now-redundant installs from run_tests.sh and
multi_gpu_shard_runner.sh. The retry wrapper stays in place for the
remaining TEST_EXTRA_PIP_PACKAGES and TEST_EXTRA_UV_PACKAGES installs.
@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR moves the common pytest harness installation from each test invocation into the freshly built CI image, while preserving per-run installation of optional test packages.

  • Adds a post-build image layer containing pytest, pytest-mock, junitparser, flaky, and coverage.
  • Includes the Docker build action in the dependency hash so changes to the baked package layer invalidate cached dependency images.
  • Removes redundant dependency installation from the standard and multi-GPU test runners.

Confidence Score: 5/5

The PR appears safe to merge because current test-image build and cache paths consistently provide the newly baked pytest dependencies.

The dependency hash changes with the image-layer definition, newly built images are tagged only after the harness is installed, and current test runners consume those layered images with the same Python environment.

Important Files Changed

Filename Overview
.github/actions/docker-build/action.yml Adds a post-build pytest dependency layer, restores the inherited default user, and caches the resulting image.
.github/actions/_lib/compute-deps-hash/action.yml Adds the Docker build action to dependency-hash inputs so edits to the baked test harness invalidate cached images.
.github/actions/run-tests/run_tests.sh Removes the redundant runtime installation of dependencies now supplied by the CI image.
.github/actions/multi-gpu/multi_gpu_shard_runner.sh Removes the shared runtime pytest installation and updates the documented multi-GPU startup sequence accordingly.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    H[Compute dependency hash] --> C{Matching CI image cache?}
    C -->|Yes| U[Reuse layered image]
    C -->|No| B[Build base CI image]
    B --> P[Install pytest harness as root]
    P --> R[Restore image default user]
    R --> T[Tag layered image for dependency cache]
    U --> S[Run standard or multi-GPU tests]
    T --> S
    S --> E[Install only optional per-run packages]
Loading

Reviews (1): Last reviewed commit: "Bake CI pytest deps into the built Docke..." | Re-trigger Greptile

@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 CI image-layering approach coherently moves the pytest harness ahead of the local dependency-cache tag and removes matching per-run installs. However, the new composite-action script contains an empty GitHub Actions expression that can prevent workflows from evaluating the step.

  • Design and architecture: Baking CI-only test dependencies into the built image and including the build action in the dependency hash preserves the intended cache-hit behavior. The layer is added only after a real build and before the dependency-cache tag is created. Keying on the entire action is conservative but not a merge-blocking design problem.
  • API: No public API is changed. The test runners continue using the image’s Isaac Sim Python environment, into which the same pytest dependencies are now installed during image construction.
  • Implementation: The root installation, restoration of the image’s configured user, quoted heredoc, and removal of redundant runner installs are consistent. At .github/actions/docker-build/action.yml:191, the literal ${{ }} in the run scalar is still parsed by GitHub Actions despite appearing in a shell comment; as an empty expression, it can fail template evaluation. Reword the comment to avoid the expression delimiters.

Significant concerns. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

Comment thread .github/actions/docker-build/action.yml Resolved
The comment above the layering step spelled the interpolation syntax
literally. Inside a `run: |` block scalar a leading `#` is only a shell
comment — the runner still parses the whole block as a template string,
so it read the empty braces as an expression and failed to load the
action with "An expression was expected", taking the base and cuRobo
image builds down before they started.

Describe the substitution in prose instead.
@AntoineRichard
AntoineRichard merged commit 470dce0 into isaac-sim:develop Aug 20, 2026
75 of 77 checks passed
kellyguo11 added a commit that referenced this pull request Aug 21, 2026
## Summary

Cherry-picks the following merged PRs from `develop` onto
`release/3.0.0`, preserving each as an individual commit with `-x`
provenance:

- #7193 — Bake CI pytest deps into the built Docker image
- #7077 — Add OVPhysX support to Franka deformable lift tasks
- #7175 — Raise on unsupported camera renderer outputs
- #7174 — Fix benchmark play inference scope
- #7173 — Report resolved backend for play benchmarks
- #7172 — Add video recording to play benchmarks
- #7215 — Reduce GearAssembly default environment count
- #7214 — Remove Kamino preset from open drawer
- #7213 — Fix OvPhysX scene gravity randomization
- #7212 — Fix OVPhysX material binding device selection
- #7189 — Make preview surfaces renderer agnostic
- #7206 — Fix OVPhysX benchmark articulation setup

All cherry-picks and the final rebase onto the latest `release/3.0.0`
tip completed without conflicts.

## Validation

- Verified all 12 backported commits have patch IDs identical to their
source squash commits and retain their `cherry picked from` footers.
- `git diff --check upstream/release/3.0.0..HEAD`
- Bash syntax validation for the modified CI shell scripts.
- YAML parsing for the modified composite actions.
- Changelog validation against `release/3.0.0`.
- Targeted pytest coverage for benchmark APIs/play, video recording,
GearAssembly defaults, OVPhysX presets and runtime semantics, and
renderer-agnostic materials: **81 passed, 4 skipped, 1 deselected**.
- The deselected case is an unchanged test that hard-codes a POSIX
`/tmp` path and fails on Windows path normalization.
- `uv run isaaclab -f` passed all hooks except the changelog hook's
known release-branch baseline finding for
`source/isaaclab/changelog.d/core-test-config-fixtures.skip`; the
targeted release-base changelog check passed.

---------

Co-authored-by: Matthew Taylor <[email protected]>
Co-authored-by: Antoine RICHARD <[email protected]>
Co-authored-by: Mike Yan Michelis <[email protected]>
Co-authored-by: Maximilian Krause <[email protected]>
Co-authored-by: Octi Zhang <[email protected]>
Co-authored-by: Mustafa H <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants