Skip to content

feat(sandbox): add Apptainer sandbox provider - #1694

Merged
arti4nvj merged 8 commits into
mainfrom
artij/apptainer_provider_cvdp
Jun 25, 2026
Merged

feat(sandbox): add Apptainer sandbox provider#1694
arti4nvj merged 8 commits into
mainfrom
artij/apptainer_provider_cvdp

Conversation

@arti4nvj

Copy link
Copy Markdown
Contributor

Add an ApptainerProvider implementing the SandboxProvider protocol via the local apptainer CLI: persistent instance lifecycle, exec with user/fakeroot mapping, bind-mount file transfer, status, readiness probe, and teardown. Register it under the name "apptainer" and add unit tests plus a README.

Add an ApptainerProvider implementing the SandboxProvider protocol via the
local apptainer CLI: persistent instance lifecycle, exec with user/fakeroot
mapping, bind-mount file transfer, status, readiness probe, and teardown.
Register it under the name "apptainer" and add unit tests plus a README.

Signed-off-by: Arti Jain <artij@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@arti4nvj
arti4nvj requested a review from hemildesai June 24, 2026 00:06
@arti4nvj
arti4nvj requested a review from cmunley1 June 24, 2026 00:08
Signed-off-by: Arti Jain <artij@nvidia.com>
@cwing-nvidia cwing-nvidia linked an issue Jun 24, 2026 that may be closed by this pull request
5 tasks
arti4nvj added 3 commits June 24, 2026 19:57
Signed-off-by: Arti Jain <artij@nvidia.com>
Parse Claude Code's authoritative num_turns from the stream-json result
event and include it in the returned metadata.

Signed-off-by: Arti Jain <artij@nvidia.com>
Comment thread nemo_gym/sandbox/providers/apptainer/provider.py
Comment thread nemo_gym/sandbox/providers/apptainer/provider.py Outdated
@arti4nvj
arti4nvj requested a review from adil-a June 25, 2026 18:26
Signed-off-by: Christian Munley <cmunley@nvidia.com>

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

tested with terminalbench

@cmunley1
cmunley1 marked this pull request as ready for review June 25, 2026 22:42
@arti4nvj
arti4nvj merged commit ed61c67 into main Jun 25, 2026
15 checks passed
adil-a pushed a commit to adil-a/Gym that referenced this pull request Jun 26, 2026
…iders + flat-only harnesses (NVIDIA-NeMo#1249)

PR NVIDIA-NeMo#1694 (feat(sandbox): add Apptainer sandbox provider) adds an apptainer provider at the
same paths as ours. We use docker for all evals, so drop our apptainer entirely and let NVIDIA-NeMo#1694
own it on main; the swe_env-specific apptainer nested-grading is deferred to a follow-up PR
that re-wires it onto NVIDIA-NeMo#1694's provider (tracked in APPTAINER_PR3_TRACKER.md).

- Remove our ApptainerSandboxProvider + the registry apptainer loader (keep docker + opensandbox).
- swebench/r2egym harnesses -> flat-only (host-side grading via swebench's official per-repo
  parser); remove the nested run_local_evaluation path + the apptainer supports_provider gate.
  The docker flat-grading fix is preserved (gold re-grade 3/3 on docker; swe_env tests 134 passed).
- model_endpoint: drop the apptainer egress branch (docker branch is functionally identical).
- run_swebench_verified.py: docker-only (drop --provider apptainer + .sif build).
- Delete apptainer-only tests; rewrite swebench/r2egym/flat_eval tests flat-only.

Note: r2egym is now flat-only without an eval_script source (was nested-only) -> masks as
eval_error until the follow-up PR; no active eval config uses r2egym.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Codex <codex@openai.com>
adil-a pushed a commit to adil-a/Gym that referenced this pull request Jun 26, 2026
…bed) (NVIDIA-NeMo#1249)

Re-add the apptainer sandbox provider (owned by NVIDIA-NeMo#1694 on main) and register it,
then wire anyswe onto it so both docker and apptainer backends run end-to-end:

- registry: register the apptainer provider loader (was intentionally docker-only
  pending NVIDIA-NeMo#1694; NVIDIA-NeMo#1694 is now on main).
- _instance_image: resolve a local .sif container_formatter verbatim (raw
  instance_id, no _1776_ tag mangle, no :latest) so the apptainer provider can
  instance-start an on-disk image with no registry pull.
- _provider: for apptainer, bind /trajectories_mount, /nemo_gym_mount and
  /agent_deps_mount (via exec.default_binds, symmetric with docker run_args) and
  add --writable-tmpfs so the agent can edit /testbed (read-only sif otherwise).
- _grading_provider: add --writable-tmpfs for the nested-grading sandbox too.

Verified: anyswe_hermes (gpt-5.5) on 2 SWE-bench Verified instances grades 1/2
resolved identically on docker (local images) and apptainer (local sifs), all
rows unmasked. Docker behavior unchanged (backward-compatible _instance_image).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Codex <codex@openai.com>
adil-a pushed a commit to adil-a/Gym that referenced this pull request Jun 27, 2026
Align docstrings with the current code: all built-in families grade host-side
(flat), so correct the lingering 'nested/apptainer-only supports_provider' narrative
in harness.py, harnesses/__init__.py and flat_eval.py (the nested path was removed
in PR NVIDIA-NeMo#1694; with_flat_eval() is a no-op returning self). Document the docker/
apptainer split in anyswe _provider; note is_eval is accepted but unused; fix test
docstrings (FakeSandbox -> _FakeProvider, 'three layers' -> two, swe_rebench gate).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Codex <codex@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(sandbox): Apptainer sandbox provider

4 participants