Repository navigation
fix(apptainer): keep sandbox env out of argv - #2284
Merged
Merged
Conversation
Signed-off-by: Adam Rajfer <arajfer@nvidia.com> (cherry picked from commit 032ae51) Signed-off-by: plaszkiewicz <plaszkiewicz@nvidia.com>
AdamRajfer
approved these changes
Aug 3, 2026
laszkiewiczp
added a commit
that referenced
this pull request
Aug 3, 2026
Authored by @arajfer — I'm only carrying it to `main`. The commit keeps his authorship and `Signed-off-by`; I added mine as the submitter. ## Why this PR exists This change was written on the `cherry-pick-2259-r0.5.0` branch (commit `032ae5184`), stacked on top of the PinchBench benchmark-config cherry-pick. When #2259 merged, the bot regenerated that branch as a single squashed commit for #2283, which dropped the stacked work. The commit was never on `main` — it only ever existed on that branch — so it would have been lost. ## What it does - `nemo_gym/sandbox/providers/apptainer/provider.py` — pass sandbox environment through the environment rather than `argv`, so secrets and env values don't land in the process command line. - Adds `tavily_api_key` plumbing: `${tavily_api_key}` on the agent config, and the matching `${oc.env:PINCHBENCH_TAVILY_API_KEY,null}` top-level declaration on the benchmark config. Both are required together — the agent config interpolates the key, so the benchmark config must declare it or `gym eval prepare` fails to resolve. `PinchBenchAgentConfig` already carries `tavily_api_key: Optional[str] = None`, so nothing else is needed. - Tests: `tests/unit_tests/test_apptainer_provider.py` (+129) covering the argv/env split, and `tests/unit_tests/test_benchmarks.py` (+9) pinning the agent/benchmark tavily pairing so the two configs can't drift apart. ## Verification Cherry-picked onto current `main` (`3e210384a`) with no conflicts, then: - `pytest tests/unit_tests/test_apptainer_provider.py tests/unit_tests/test_benchmarks.py` — **101 passed**, including the new `test_pinchbench_tavily_key_is_derived_from_environment` - `pre-commit run` clean on all 5 touched files @arajfer please confirm this is the version you want on `main` — if you'd rather own the PR yourself, close this and I'll drop the branch. Once it lands it can cherry-pick to `r0.5.0` on its own, independently of #2283. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Adam Rajfer <arajfer@nvidia.com> Signed-off-by: plaszkiewicz <plaszkiewicz@nvidia.com> Co-authored-by: Adam Rajfer <arajfer@nvidia.com> (cherry picked from commit d58f6ef)
OlegSudakov
pushed a commit
to OlegSudakov/Gym
that referenced
this pull request
Aug 7, 2026
Authored by @arajfer — I'm only carrying it to `main`. The commit keeps his authorship and `Signed-off-by`; I added mine as the submitter. ## Why this PR exists This change was written on the `cherry-pick-2259-r0.5.0` branch (commit `032ae5184`), stacked on top of the PinchBench benchmark-config cherry-pick. When NVIDIA-NeMo#2259 merged, the bot regenerated that branch as a single squashed commit for NVIDIA-NeMo#2283, which dropped the stacked work. The commit was never on `main` — it only ever existed on that branch — so it would have been lost. ## What it does - `nemo_gym/sandbox/providers/apptainer/provider.py` — pass sandbox environment through the environment rather than `argv`, so secrets and env values don't land in the process command line. - Adds `tavily_api_key` plumbing: `${tavily_api_key}` on the agent config, and the matching `${oc.env:PINCHBENCH_TAVILY_API_KEY,null}` top-level declaration on the benchmark config. Both are required together — the agent config interpolates the key, so the benchmark config must declare it or `gym eval prepare` fails to resolve. `PinchBenchAgentConfig` already carries `tavily_api_key: Optional[str] = None`, so nothing else is needed. - Tests: `tests/unit_tests/test_apptainer_provider.py` (+129) covering the argv/env split, and `tests/unit_tests/test_benchmarks.py` (+9) pinning the agent/benchmark tavily pairing so the two configs can't drift apart. ## Verification Cherry-picked onto current `main` (`3e210384a`) with no conflicts, then: - `pytest tests/unit_tests/test_apptainer_provider.py tests/unit_tests/test_benchmarks.py` — **101 passed**, including the new `test_pinchbench_tavily_key_is_derived_from_environment` - `pre-commit run` clean on all 5 touched files @arajfer please confirm this is the version you want on `main` — if you'd rather own the PR yourself, close this and I'll drop the branch. Once it lands it can cherry-pick to `r0.5.0` on its own, independently of NVIDIA-NeMo#2283. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Adam Rajfer <arajfer@nvidia.com> Signed-off-by: plaszkiewicz <plaszkiewicz@nvidia.com> Co-authored-by: Adam Rajfer <arajfer@nvidia.com>
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.
Authored by @arajfer — I'm only carrying it to
main. The commit keeps his authorship andSigned-off-by; I added mine as the submitter.Why this PR exists
This change was written on the
cherry-pick-2259-r0.5.0branch (commit032ae5184), stacked on top of the PinchBench benchmark-config cherry-pick. When #2259 merged, the bot regenerated that branch as a single squashed commit for #2283, which dropped the stacked work. The commit was never onmain— it only ever existed on that branch — so it would have been lost.What it does
nemo_gym/sandbox/providers/apptainer/provider.py— pass sandbox environment through the environment rather thanargv, so secrets and env values don't land in the process command line.tavily_api_keyplumbing:${tavily_api_key}on the agent config, and the matching${oc.env:PINCHBENCH_TAVILY_API_KEY,null}top-level declaration on the benchmark config. Both are required together — the agent config interpolates the key, so the benchmark config must declare it orgym eval preparefails to resolve.PinchBenchAgentConfigalready carriestavily_api_key: Optional[str] = None, so nothing else is needed.tests/unit_tests/test_apptainer_provider.py(+129) covering the argv/env split, andtests/unit_tests/test_benchmarks.py(+9) pinning the agent/benchmark tavily pairing so the two configs can't drift apart.Verification
Cherry-picked onto current
main(3e210384a) with no conflicts, then:pytest tests/unit_tests/test_apptainer_provider.py tests/unit_tests/test_benchmarks.py— 101 passed, including the newtest_pinchbench_tavily_key_is_derived_from_environmentpre-commit runclean on all 5 touched files@arajfer please confirm this is the version you want on
main— if you'd rather own the PR yourself, close this and I'll drop the branch. Once it lands it can cherry-pick tor0.5.0on its own, independently of #2283.🤖 Generated with Claude Code