Skip to content

fix(customizer): vendor nemo-gym in the RL image so native-v1 can install - #1856

Merged
anubhutivyas merged 3 commits into
release/0.5from
anubhutiv/native-v1-env
Sep 7, 2026
Merged

fix(customizer): vendor nemo-gym in the RL image so native-v1 can install#1856
anubhutivyas merged 3 commits into
release/0.5from
anubhutiv/native-v1-env

Conversation

@anubhutivyas

@anubhutivyas anubhutivyas commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

For every Gym server, Gym checks whether it is an editable install in the working directory. If it is not, it installs nemo-gym from a wheel pinned to the parent venv's version: https://github.com/soluwalana/Gym/blob/nmp/customizer/nemo_gym/cli/setup_command.py#L80

A staged environment FileSet is never an editable install, so every native-v1 server takes that path and asks an index for nemo-gym==0.5.0rc0. That is our fork's version and it is not published anywhere, PyPI has 0.5.0 and 0.5.1, no rc0. So the server venv never builds and the job fails at spin-up

    No solution found when resolving dependencies:
    Because there is no version of nemo-gym==0.5.0rc0 ...

This affects every native-v1 environment.

Related Issue

Changes

  • Build the wheel from the Gym submodule already in the image and set UV_FIND_LINKS=/opt/gym-wheels. Gym's install then finds it locally, and everything else still comes from the index as before.
  • Letting it fall through to PyPI's 0.5.0 is not an option, the server venv would run upstream Gym while the actor runs our fork.
  • UV_FIND_LINKS is additive and takes multiple paths, so it does not change how any other dependency resolves. It holds one wheel: nemo-gym.
  • Gym relies on setuptools-scm's git file-finder to put configs in the wheel, and there is no git in this build. The build script declares that data explicitly and fails if it is missing, so we cannot ship a wheel that installs cleanly but has no YAML in it.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with documentation updates
  • Documentation only
  • Contributor tooling or automation
  • CI, build, or test infrastructure

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Documentation updated for user-visible behavior
  • Documentation not applicable — justification:

Verification

  • Pull request title follows the repository's Conventional Commit format
  • Every commit includes an appropriate Signed-off-by: trailer
  • uv run pre-commit run -a passes, or any blocked checks are identified below
  • Targeted tests pass, or tests are marked not applicable above
  • No secrets, API keys, or credentials are included

Targeted validation:

Summary by CodeRabbit

  • New Features

    • NeMo-Gym is now packaged and included in the RL base image, allowing installations to use the bundled wheel.
    • Required Gym configuration and documentation resources are included with the packaged component.
  • Bug Fixes

    • Improved package validation helps ensure the bundled wheel is complete, correctly versioned, and contains required files.
  • Chores

    • Updated the NeMo-RL base image to a newer pinned source revision.

@anubhutivyas
anubhutivyas requested review from a team as code owners September 7, 2026 19:58
@github-actions github-actions Bot added the fix label Sep 7, 2026
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 43da653d-add4-4c23-9d7c-5d841f9815e5

📥 Commits

Reviewing files that changed from the base of the PR and between 51c8237 and aca026d.

📒 Files selected for processing (1)
  • docker-bake.hcl

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

Changes

The RL image pins a newer immutable RL commit. Its Docker build creates and validates a NeMo-Gym wheel, copies it into /opt/gym-wheels, and configures UV_FIND_LINKS for local package resolution.

NeMo-Gym wheel packaging

Layer / File(s) Summary
Build and validate the NeMo-Gym wheel
docker-bake.hcl, docker/rl/Dockerfile.nmp-rl-base, docker/rl/scripts/build-gym-wheel.sh
The build uses the updated RL pin. The script patches package data, builds one wheel with uv --no-config, and validates its version and required sandbox configuration.
Publish the wheel for runtime installation
docker/rl/Dockerfile.nmp-rl-base
The publish stage copies the wheel to /opt/gym-wheels and sets UV_FIND_LINKS for local resolution while retaining package-index resolution.

Sequence Diagram(s)

sequenceDiagram
  participant DockerBuild as Docker build
  participant GymSource as Pinned Gym source
  participant BuildScript as build-gym-wheel.sh
  participant WheelStore as /opt/gym-wheels
  participant ServerInstall as Server installation
  DockerBuild->>GymSource: copy pinned source
  DockerBuild->>BuildScript: build and validate wheel
  BuildScript->>WheelStore: publish validated wheel
  ServerInstall->>WheelStore: resolve nemo-gym locally
Loading

Suggested reviewers: mckornfield, crookedstorm

Merge Risk: ⚪ Minimal · up to aca02

The RL image now provides the fork-specific nemo-gym package locally, allowing native-v1 environments to install it without requiring an unavailable index version. The packaged wheel includes build-time validation for versioning and required configuration resources, with no remaining merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: vendoring nemo-gym in the RL image so native-v1 can install it.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch anubhutiv/native-v1-env

Comment @coderabbitai help to get the list of available commands.

@gabwow gabwow 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.

nit: I think some of the agent comments are hurting readability rather than helping (particularly in the nmp-rl-base). If you agree feel free to remove the ones you fine unneeded. However, this is non-blocking and if you find them helpful, leave them in.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 35555/45376 78.4% 62.9%
Integration Tests 21167/43151 49.0% 22.3%

…tall

Signed-off-by: anubhutiv <anubhutiv@nvidia.com>
lint-copyright-headers flagged the new build script, which failed "Lint all" and the
aggregate CI status with it.

Also trims the comment block flagged in review. One of those lines was wrong as well: it
claimed the environment package's own wheelhouse wins because configure_environment_wheelhouse
prepends it, but uv resolves find-links by name and version, not by entry order, so the
image's wheel wins either way.

Signed-off-by: anubhutiv <anubhutiv@nvidia.com>
Signed-off-by: anubhutiv <anubhutiv@nvidia.com>
@anubhutivyas
anubhutivyas force-pushed the anubhutiv/native-v1-env branch from 51c8237 to aca026d Compare September 7, 2026 20:31
@anubhutivyas
anubhutivyas added this pull request to the merge queue Sep 7, 2026
Merged via the queue into release/0.5 with commit b15cb90 Sep 7, 2026
59 checks passed
@anubhutivyas
anubhutivyas deleted the anubhutiv/native-v1-env branch September 7, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants