Skip to content

Openshell driver podman#904

Open
maxamillion wants to merge 1 commit intoNVIDIA:mainfrom
maxamillion:openshell-driver-podman
Open

Openshell driver podman#904
maxamillion wants to merge 1 commit intoNVIDIA:mainfrom
maxamillion:openshell-driver-podman

Conversation

@maxamillion
Copy link
Copy Markdown

Summary

Adds a Podman compute driver (openshell-driver-podman) that runs sandboxes as rootless Podman containers on a local workstation. The driver communicates with the Podman REST API via a gRPC bridge, preserving the full OpenShell control-plane model while supporting Podman-native and rootless environments.

Related Issue

Closes #882

Changes

  • Add crates/openshell-driver-podman crate: Podman REST API client, container lifecycle management, event watcher, gRPC bridge, and driver binary
  • Abstract container engine in build tooling (tasks/scripts/container-engine.sh) to support both Docker and Podman
  • Harden SSRF checks in SSH tunnel and server; close loopback bypass and tighten Host endpoint validation
  • Fix rootless sandbox startup: sideload supervisor binary via image volume mount, grant SETUID/SETGID/DAC_READ_SEARCH caps, skip drop_privileges in SSH pre_exec
  • Add E2E test script (e2e/rust/e2e-podman.sh) covering full sandbox lifecycle against the Podman driver
  • Add architecture doc (architecture/podman-driver.md) and update debug skill

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (e2e/rust/e2e-podman.sh — full lifecycle: create, connect, exec, delete)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (architecture/podman-driver.md)

@maxamillion maxamillion requested a review from a team as a code owner April 21, 2026 15:24
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Apr 21, 2026

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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

All contributors have signed the DCO ✍️ ✅
Posted by the DCO Assistant Lite bot.

@maxamillion
Copy link
Copy Markdown
Author

I have read the DCO document and I hereby sign the DCO.

@maxamillion
Copy link
Copy Markdown
Author

recheck

Adds openshell-driver-podman, a new compute driver that manages OpenShell
sandboxes as rootless Podman containers via the Podman REST API over a
Unix socket. Enables local workstation sandboxes without Kubernetes.

Driver features:
- Bridge networking with ephemeral host-port mapping for rootless SSH reachability
- Named volumes for workspace storage, Podman native health checks, GPU via CDI
- Supervisor binary sideloaded via image volume mount (BYOC-compatible)
- SSH handshake secret injected via Podman secrets API (not plaintext env)
- Typed ContainerSpec structs, input validation, and path-traversal guards
- Cgroups v2 required; fails fast on v1 hosts
- Bounded event stream buffer; watch stream reconnection handled by server watch_loop
- Graceful shutdown and standalone driver binary with gRPC bridge

Rootless-specific fixes:
- Skip drop_privileges when user namespace lacks SETUID/SETGID/DAC_READ_SEARCH caps
- Add /run/netns tmpfs mount for ip netns in rootless containers
- Use secret_env map (not secrets array) for env-var injection in libpod API
- Resolve SSH endpoint to 127.0.0.1:<host_port> instead of unreachable bridge IP

Server/sandbox hardening:
- Split loopback and link-local SSRF gates; Podman/VM drivers allow loopback
- Close SSRF bypass in SSH tunnel Host path by resolving DNS before connecting
- Prevent OPENSHELL_* env var override by user-supplied spec environment maps
- Disable SQLite pool idle_timeout/max_lifetime for in-memory databases
- Emit deleted_event on 404-during-inspect instead of regressing sandbox phase
- Key delete cleanup by stable sandbox_id to survive container label drift

CLI fixes:
- Restore --name as a named flag on sandbox create (not positional)
- Fix exec command arg parsing to not consume sandboxed-command flags
- Propagate SSH verbosity via OPENSHELL_SSH_LOG_LEVEL

Build tooling:
- Add tasks/scripts/container-engine.sh: auto-detects Podman or Docker, exposes
  unified ce_* helpers; all build/cluster/VM scripts updated to use it
- Add docker:build:supervisor mise task for standalone supervisor image
- Add openshell-driver-podman to Dockerfile.images pre-fetch/build stages
- Add e2e/rust/e2e-podman.sh and e2e:podman mise task for full lifecycle testing

Signed-off-by: Adam Miller <admiller@redhat.com>
@maxamillion maxamillion force-pushed the openshell-driver-podman branch from 316f06d to d50420b Compare April 21, 2026 21:12
@drew drew added the test:e2e Requires end-to-end coverage label Apr 22, 2026
@drew drew self-assigned this Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Podman Driver for Local Workstation Sandboxes

3 participants