Skip to content

fix: only skip venv setup when the venv was setup - #2388

Open
tdene wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
tdene:tde/venv_completion_marker
Open

tdene wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
tdene:tde/venv_completion_marker

Conversation

@tdene

@tdene tdene commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

skip_venv_if_present trusts based on the existence of bin/python and bin/activate.

Both these files appear long before the venv is actually built. This allows for zombie venvs to be left behind which pass the skip check but are unusable.

This PR adds a completion marker.

@tdene

tdene commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test e04eacf

@ananthsub

Copy link
Copy Markdown
Contributor

/claude review

@claude

claude Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

SHIP — no reliability concerns.

Correctly closes the mid-install-death gap in setup_env_command. uv venv creates bin/python and bin/activate in seconds, so the old skip check (skip_venv_if_present + those two files) would reuse a venv whose uv pip install had crashed halfway — a silently-incomplete environment that later fails obscurely at import/runtime.

The fix is sound:

  • .nemo_gym_venv_complete is touched only as the final &&-gated step, so it appears only on a fully-installed venv.
  • rm -f clears it first in the rebuild chain, so a death anywhere before touch leaves no marker and the next run rebuilds instead of skipping.
  • Skip now additionally requires the marker.

Backward compat is fine: pre-existing markerless venvs rebuild once (uv venv --allow-existing absorbs the re-create), a one-time cost rather than any correctness risk. Tests updated across all command-shape assertions plus a dedicated regression test for the partial-build case. No verifier/scorer, async, config, or dependency surface touched.

@tdene

tdene commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 45b436a

Comment thread nemo_gym/cli/setup_command.py Resolved
Comment thread nemo_gym/cli/setup_command.py Resolved
Comment thread nemo_gym/cli/setup_command.py Resolved
Comment thread nemo_gym/cli/setup_command.py Resolved
@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Aug 26, 2026
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
@tdene
tdene force-pushed the tde/venv_completion_marker branch from 43ee085 to bfa7500 Compare October 2, 2026 04:20
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 2, 2026 04:21
@tdene

tdene commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@ananthsub I've rebased, and the solution is now much simpler. Please take a look; this PR is very thin now.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:cli Command-line interfaces and user-facing command behavior bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer labels Oct 20, 2026

This branch was previously deployed

1 inactive deployment
public — bfa75002 Deployed Oct 2, 2026 by copy-pr-bot[bot] via release / finalize / notify #4158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli Command-line interfaces and user-facing command behavior bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants