Repository navigation
fix(orchestration): reuse a venv under skip_venv_if_present only when setup completed - #5797
Conversation
… setup completed Cancelling a run during its venv install leaves bin/python and bin/activate without the packages. skip_venv_if_present reused such a venv because it only checked those two files, and the server then died at spinup. Reuse a venv only when it also has the completion marker that venv_setup writes after a successful install. Otherwise log a warning naming the venv and reinstall in place under the existing setup lock. Venvs without the marker, including ones built before the marker existed, reinstall once. Signed-off-by: Christian Munley <[email protected]>
|
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. |
|
/ok to test 03a14c9 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found. I checked both setup paths, the completion-marker and lock lifecycle, affected launch callers, and the regression tests. Markerless venvs now enter serialized setup, while complete venvs retain lock-free reuse.
Static review only; I didn't execute tests.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
Resolve conflicts with main. Signed-off-by: Christian Munley <[email protected]>
|
/ok to test c3e1447 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found in this follow-up. I compared the changes since the prior clean review and checked the relocated setup helpers, launch integration, and regression tests.
The completion-marker fix is preserved: markerless venvs enter serialized setup, while complete venvs retain lock-free reuse. I found no introduced regression in the inspected paths.
Static review only; I didn’t execute tests.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
yaoyu-33
left a comment
There was a problem hiding this comment.
Reviewed at c3e1447. The marker-based check is right: venv_setup removes the marker before each install and writes it only after a successful one under the setup lock, so the lock-free reuse path can no longer pick up an interrupted install, and the updated tests would fail on main. One compatibility point is inline; with that called out this looks good to me.
yaoyu-33
left a comment
There was a problem hiding this comment.
LGTM. The inline points from my earlier review are small and can be handled here or in a follow-up.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43101281510 |
The warning now names the touch command for a known-good venv, and AGENTS.md no longer says a bare .venv skips setup. Signed-off-by: Christian Munley <[email protected]>
|
/ok to test 5f785cc |
Signed-off-by: Christian Munley <[email protected]>
|
/ok to test e4921b7 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43308806274 |
What broke
Cancelling a run during its venv install leaves
bin/pythonandbin/activatewithout the packages. Withskip_venv_if_present=truethe next run reused that venv, because it only checked those two files, and the server died at spinup ("policy_model finished unexpectedly").Fix
Reuse a venv only when it also has the
.nemo-gym-setup-completemarker thatvenv_setupalready writes after a successful install. Otherwise log a warning naming the venv and reinstall in place under the existing setup lock. No directory is deleted. Venvs without the marker, including ones built before it existed, reinstall once.Test
test_server_venv.py: a venv without the marker rebuilds and warns, a venv with it skips (legacy and locked paths).tests/unit_tests/orchestration+cli/test_cli.py: 3395 passed. The 6test_eval_resubmit.pyfailures also fail on main.Compatibility
This reverses the #3551 behavior for prebuilt venvs without the marker. Such a venv is no longer reused. Gym reinstalls it under
<venv>.setup.lockin its parent directory, which fails on a read-only mount (for example a squashfs image built before the marker landed on 2026-09-18) or on an offline cluster. To adopt a known-good venv, runtouch <venv>/.nemo-gym-setup-complete, or rebuild the image. The warning prints this command, and AGENTS.md is updated.