Repository navigation
chore(server): request the ray extra from servers that use Ray - #4301
Merged
Merged
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
ananthsub
force-pushed
the
ananthsub/tolerate-missing-ray
branch
from
October 9, 2026 17:06
684d7ec to
86aac2a
Compare
ananthsub
force-pushed
the
ananthsub/ray-servers-request-extra
branch
from
October 9, 2026 17:06
107be62 to
13087fa
Compare
ananthsub
force-pushed
the
ananthsub/tolerate-missing-ray
branch
from
October 9, 2026 17:17
86aac2a to
8bba52b
Compare
ananthsub
force-pushed
the
ananthsub/ray-servers-request-extra
branch
from
October 9, 2026 17:17
13087fa to
5ae24f8
Compare
This was referenced Oct 9, 2026
hemildesai
previously approved these changes
Oct 9, 2026
Contributor
|
🌿 Preview your docs: https://nvidia-preview-pr-4301-352a1d642154.docs.buildwithfern.com/nemo/gym |
Every server implementation that declares ray_enabled = True now asks for nemo-gym's `ray` extra in its own manifest: - requirements.txt: `-e nemo-gym[dev,ray]` (or `[dev,ray,sandbox]`) - pyproject.toml and setup.py: `nemo-gym[dev,ray]` Ray is still a core dependency, so nothing installs differently yet. Once Ray moves out of the core dependencies, these servers keep getting Ray in their venvs, pinned to the parent's version by the existing constraint. Add an audit that fails when a server declaring ray_enabled = True doesn't request the extra, and document the convention in the FAQ. Part of #3669. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
ananthsub
force-pushed
the
ananthsub/ray-servers-request-extra
branch
from
October 9, 2026 18:56
5ae24f8 to
352a1d6
Compare
hemildesai
approved these changes
Oct 9, 2026
kajalj22
approved these changes
Oct 9, 2026
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37981983559 |
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Oct 14, 2026
Closes #4316. ## What changed `ray[default]` and its `jinja2` pin move out of nemo-gym's core dependencies and live only in the `ray` extra (also part of `all`). A plain `pip install nemo-gym` no longer installs Ray. - **Packaging:** `pyproject.toml` and `uv.lock`. The lockfile change is metadata only; Ray and `jinja2` stay locked through the extra, and no package versions move. - **CI:** - `scripts/ci/core_unit_tests.sh`, plus the unit-test and full-test-suite syncs, add `--extra ray`, so Ray code paths stay tested and stay in the coverage gate. - The wheel smoke test still installs the plain wheel, which now also covers the path without Ray. - Server-test setup stays without the extra, because each Ray server's own venv requests it. - **Docker:** the image builds add `--extra ray`. The `ray_dist.jar` removal for the CVE is unchanged. - **Tests:** two tests skip when Ray isn't installed: - `tests/unit_tests/test_ray_serve_gateway.py`, because the gateway imports Ray Serve at module level; - the Super 3.5 launcher's prebuilt-environment check, because its generated dependency check imports Ray, which the evaluation image provides. - **Docs:** the installation and development-setup pages explain when to add the `ray` extra, and the FAQ no longer says Ray is a core dependency. ## Why This is the last step of #3669. Earlier changes made Gym run without Ray (#4300), had Ray servers request the extra (#4301), and made servers run without Ray unless they declare `ray_enabled = True` (#4307). The only remaining reason every install got Ray was nemo-gym's own core dependency. ## Validation - **Package metadata:** `uv build --wheel` gives `Requires-Dist: ray[default]>=2.58.0; extra == "ray"` and `Requires-Dist: jinja2>=3.1; extra == "ray"`, with no unconditional Ray requirement. - **Without the extra:** `uv sync --locked --extra dev` gives an environment where neither `ray` nor `jinja2` is importable, and `gym --version` reports `"ray": "not installed"`. - **Full `tests/unit_tests/` run, `-m "not sandbox"` as in the core CI job.** I built the core CI job's environment (`dev`, `telemetry`, `mlflow`, `wandb`) twice: - With `--extra ray`, everything passes. - Without it, only the Ray-specific tests above skip. One timing-sensitive OpenSandbox cleanup test failed once under parallel load, and passed three times out of three on its own. - `fern check` passes. - `pre-commit run` scoped to the changed files. ## Rollout evidence N/A. This changes which packages a default install includes. It doesn't change prompts, model requests, trajectories, verification or rewards. #4300 smoke-tested `gym env start` with Ray uninstalled. ## Compatibility This is a breaking packaging change and needs a release note (#4317): - **Ray-backed servers after a plain install:** anyone running a server that declares `ray_enabled = True` (such as `local_vllm_model`, `genrm_model` or the SWE agents) needs `pip install "nemo-gym[ray]"`, or `uv sync --extra ray`, where `gym` runs. Without it, `gym env start` stops before launching anything and says so. - **Built-in Ray servers' own venvs:** they keep getting Ray through their manifests, pinned to the version where `gym` runs. - **NeMo RL:** brings its own Ray, so nothing changes there. - **External servers that use Ray:** should request `nemo-gym[ray]` in their manifests. Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
JeffPengCoder
added a commit
to JeffPengCoder/Gym
that referenced
this pull request
Oct 20, 2026
Merge upstream main d96b337. Keep main's server startup environment, Ray auto-connect guard, reserved control-client pool, archived-audio splicing and requested Gym extras alongside this branch's runtime contracts. - Setup: main now pins the parent's Ray version as a constraint (head_server_constraints) rather than a dependency. Keep its -c flag and also write the constraints into the per-venv parent-runtime overrides file, so a stale exact Ray pin in a server dependency is replaced instead of making the solve unsatisfiable; a server that does not require Ray still does not install it. Include the constraints in the environment identity. - HTTP lifecycle: close the reserved control client together with the data client on the owner loop. - vLLM proxy: keep the purpose marker where it was, before the new audio-splicing helper. Validation: the core unit suite plus the vLLM, simple/compaction-agent and OSWorld server tests ran against this merge and against main d96b337 in the same environments (Python 3.13.14, aiohttp 3.14.4, yarl 1.25.1, FastAPI 0.135.2, real E2B SDK 2.46.0). On a Linux x86_64 CPU node, 10617 passed (main: 10563); every remaining failure also fails on main (optional mlflow/wandb absent, a symlinked work directory, and the OSWorld requirements assertion left by main NVIDIA-NeMo#4301), except one load-sensitive 10 s subprocess timeout in test_slurm_script that passes in isolation on both trees. On macOS ARM64, no test that passes on main fails here. The focused regression selection passed 3031 of 3034; its 3 failures are identical on main. pre-commit run --all-files, uv lock --check --offline and the main-relative git diff --check passed. No live GPU rollout or training run was launched. Signed-off-by: Jeff Peng <jepeng@nvidia.com>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4314.
What changed
Every server implementation that declares
ray_enabled = Truenow requests nemo-gym'srayextra (added in #4300) in its own manifest:requirements.txt-e nemo-gym[dev,ray] @ ../../code_gen,evalplus,legal_agent_bench,longmt_eval,spider2_lite,swerl_gen,wmt_translation,mini_swe_agent,osworld_agent,stirrup_agent,swe_agentsrequirements.txt-e nemo-gym[dev,ray,sandbox] @ ../../anyterminal_agent,harbor_agent,mini_swe_agent_2pyproject.toml"nemo-gym[dev,ray]"code_fim,harbor_agent_generalsetup.py"nemo-gym[dev,ray]"local_vllm_model,genrm_modelA new audit in
tests/unit_tests/test_ray_opt_out.pyfails when a server directory containing a class that declaresray_enabled = Truedoesn't request the extra in any of its manifests. The FAQ's "Installing Ray" section now describes the convention.Why
This is the third step of making Ray optional (#3669). After #4300, a server venv gets Ray only when the server's own dependencies ask for it; the parent's version is applied as a constraint, not installed. Once Ray leaves nemo-gym's core dependencies, these servers need to request it themselves, and #4295 makes sure the extra survives PyPI installs.
Validation
pytest tests/unit_tests/test_ray_opt_out.py. With the manifests reverted, the new audit lists every Ray server.uv pip install --dry-runfrom each server's directory resolves with Ray included, for one server per manifest format:code_gen(requirements.txt),anyterminal_agent(requirements.txtwithsandbox),code_fim(pyproject.toml), andlocal_vllm_model(setup.py).pytest responses_api_agents/osworld_agent/tests/test_dependency_policy.py, which reads that server's dependency files.fern checkpasses.pre-commit runscoped to the changed files.Rollout evidence
N/A. Ray is still a core dependency of nemo-gym, so these servers install the same packages as before. This doesn't change prompts, model requests, trajectories, verification or rewards.
Compatibility
No change for any install today. External servers that use Ray should request
nemo-gym[ray]the same way before Ray becomes optional.