Skip to content

fix(supervisor): preserve standard sbin paths in sandbox shells - #2846

Open
elezar wants to merge 1 commit into
feat/1606-derive-cdi-sandbox-requirements/elezarfrom
codex/orin-nvidia-smi-path
Open

elezar wants to merge 1 commit into
feat/1606-derive-cdi-sandbox-requirements/elezarfrom
codex/orin-nvidia-smi-path

Conversation

@elezar

@elezar elezar commented Aug 20, 2026

Copy link
Copy Markdown
Member

Summary

Preserve standard sbin directories in supervisor-launched sandbox child shells when CDI exposes tools such as /usr/sbin/nvidia-smi on Orin systems.

Related Issue

No issue required: small localized regression fix discovered while validating stacked PR #2265 on an Orin Docker GPU gateway.

Changes

  • Added supervisor child PATH normalization helpers for /usr/local/sbin, /usr/sbin, and /sbin.
  • Gated the standard-sbin PATH repair on both the expected CDI context and an effective policy path under a standard sbin directory, such as /usr/sbin/nvidia-smi.
  • Installed the idempotent profile.d/.bashrc repair only when the CDI/policy gate is active.
  • Hardened startup-file repair so it skips symlinks, parent-directory symlinks, and non-regular startup files instead of following image-controlled paths as root.
  • Wrapped supervisor-launched shell -c entrypoints and SSH exec/login-shell commands only when the CDI/policy gate is active.
  • Normalized provider-supplied PATH values on both entrypoint and SSH execution paths only when the CDI/policy gate is active.
  • Added focused unit tests for gate behavior, PATH normalization, startup snippet idempotency, startup symlink handling, entrypoint shell wrapping, provider PATH handling, and SSH child env handling.

Testing

  • mise x -- cargo test -p openshell-supervisor-process standard_sbin
  • mise x -- cargo test -p openshell-supervisor-process startup_snippet
  • mise x -- cargo test -p openshell-supervisor-process symlink
  • mise x -- cargo test -p openshell-supervisor-process inject_provider_env
  • mise x -- cargo test -p openshell-supervisor-process apply_child_env
  • mise x -- cargo clippy -p openshell-supervisor-process --all-targets -- -D warnings
  • Static arm64 supervisor rebuild via PREBUILT_ARCH=arm64 bash tasks/scripts/stage-prebuilt-binaries.sh supervisor-output
  • GPU sandbox probe on Orin against local dev gateway: PATH includes /usr/sbin, command -v nvidia-smi resolves /usr/sbin/nvidia-smi, and nvidia-smi -L reports the Orin GPU
  • Non-GPU sandbox probe against the same gateway: PATH=/sandbox/.venv/bin:/usr/local/bin:/usr/bin:/bin, confirming the CDI gate leaves ordinary sandboxes untouched
  • Docker GPU e2e on Orin against local dev gateway before the CDI gate: 10 passed / 0 failed
  • mise run pre-commit passes
    • Attempted again on 2026-08-21; blocked by existing local setup issues: Helm lint reports chart metadata missing postgresql, and workspace Rust lint hits a stale sqlx_macros artifact requiring GLIBC_2.39.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)

@elezar
elezar requested review from a team, derekwaynecarr, mrunalp and sjenning as code owners August 20, 2026 18:58
@elezar
elezar force-pushed the feat/1606-derive-cdi-sandbox-requirements/elezar branch 2 times, most recently from 51875a7 to 93efb9f Compare September 1, 2026 09:37
@elezar
elezar force-pushed the feat/1606-derive-cdi-sandbox-requirements/elezar branch from 93efb9f to 770c455 Compare September 8, 2026 13:08
@elezar
elezar force-pushed the codex/orin-nvidia-smi-path branch from 1c6b125 to 3db9ff5 Compare September 8, 2026 13:09
@elezar
elezar force-pushed the feat/1606-derive-cdi-sandbox-requirements/elezar branch from 770c455 to 41e019c Compare September 9, 2026 08:29
@elezar
elezar force-pushed the codex/orin-nvidia-smi-path branch from 3db9ff5 to d4ddb87 Compare September 9, 2026 08:29
@elezar elezar added the test:e2e-gpu Requires GPU end-to-end coverage label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Label test:e2e-gpu applied for d4ddb87. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute GPU E2E after building the required supervisor image once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

@elezar
elezar force-pushed the feat/1606-derive-cdi-sandbox-requirements/elezar branch from 41e019c to 38b5531 Compare September 10, 2026 06:37
@elezar
elezar force-pushed the codex/orin-nvidia-smi-path branch from d4ddb87 to 1e5116c Compare September 10, 2026 06:37
@elezar
elezar force-pushed the feat/1606-derive-cdi-sandbox-requirements/elezar branch from 38b5531 to 8f977b5 Compare September 15, 2026 12:00
@elezar
elezar force-pushed the codex/orin-nvidia-smi-path branch from 1e5116c to a45c6f3 Compare September 15, 2026 12:00
@elezar
elezar force-pushed the feat/1606-derive-cdi-sandbox-requirements/elezar branch from 8f977b5 to ab5268c Compare September 15, 2026 14:48
@elezar
elezar force-pushed the codex/orin-nvidia-smi-path branch from a45c6f3 to e2c6cc7 Compare September 15, 2026 14:48
@sandl99

sandl99 commented Sep 15, 2026

Copy link
Copy Markdown

AGX Thor validation update

We reproduced the Jetson CUDA failure and passed the NemoClaw onboarding GPU gate on an NVIDIA AGX Thor through OpenShell's native Docker CDI route.

✓ GPU proof passed: nvidia-smi when available
✓ GPU proof passed: /proc/<pid>/task/<tid>/comm write
✓ GPU proof passed: cuInit(0) via libcuda.so.1
✓ Sandbox CUDA usability proven (cuInit succeeded).

The isolation result was:

host                                      cuInit(0)=0
plain Docker CDI                          cuInit(0)=0
same container and non-root UID/GIDs      cuInit(0)=0
OpenShell supervisor without /sys access  cuInit(0)=801
OpenShell supervisor with /sys read-only  cuInit(0)=0

This confirms that #2846 fixes the Jetson PATH issue: /usr/sbin/nvidia-smi was found and passed. It also shows two separate gaps outside this PR's current scope:

  1. Thor CUDA initialization requires sysfs access that is not present in the CDI-enriched Landlock policy. We used a test-only read-only /sys grant. A production fix should define the minimum safe sysfs contract or explicitly approve the broader read-only grant.
  2. The Thor CDI enrichment generated 301 filesystem paths, which exceeded the current 256-path policy limit. We used a local 512-path limit for this test.

The tested binary was based on OpenShell 1e5116ca8 plus the local path-limit change, not the current #2846 commit e2c6cc7d29df69ca5cefad107cd989de605127ec. The result should therefore be repeated on the final upstream stack after the sysfs and policy-capacity gaps are resolved. This comment records GPU-stage evidence only; it does not claim that full NemoClaw onboarding exited successfully.

The sysfs and path-capacity work appears best tracked under #1606 or a focused child issue, while #2846 remains the PATH fix.

@elezar
elezar force-pushed the codex/orin-nvidia-smi-path branch from e2c6cc7 to c8b4e7e Compare September 18, 2026 11:18
@elezar
elezar force-pushed the feat/1606-derive-cdi-sandbox-requirements/elezar branch 2 times, most recently from 35981a6 to 5e6241d Compare September 18, 2026 11:50
@elezar
elezar force-pushed the codex/orin-nvidia-smi-path branch 2 times, most recently from 0bac791 to f452e9f Compare September 18, 2026 12:24
@elezar
elezar force-pushed the codex/orin-nvidia-smi-path branch from f452e9f to 6e19022 Compare September 23, 2026 06:37
@elezar
elezar force-pushed the feat/1606-derive-cdi-sandbox-requirements/elezar branch from 5e6241d to 1178d92 Compare September 23, 2026 06:37
Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar
elezar force-pushed the feat/1606-derive-cdi-sandbox-requirements/elezar branch from 1178d92 to d5ba607 Compare September 23, 2026 07:35
@elezar
elezar force-pushed the codex/orin-nvidia-smi-path branch from 6e19022 to b533713 Compare September 23, 2026 07:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:e2e-gpu Requires GPU end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants