Skip to content

refactor(docker)!: retire community images, build Alpine supervisor and Debian gateway in OpenShell - #3236

Draft
akram wants to merge 8 commits into
NVIDIA:mainfrom
akram:refactor/sandbox-alpine-default
Draft

refactor(docker)!: retire community images, build Alpine supervisor and Debian gateway in OpenShell#3236
akram wants to merge 8 commits into
NVIDIA:mainfrom
akram:refactor/sandbox-alpine-default

Conversation

@akram

@akram akram commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements GitHub issue #3116 by removing external community sandbox image dependency and establishing in-cluster multi-architecture builds via OpenShift BuildConfigs.

Key Changes

  1. Supervisor (Alpine-based)

    • Single-stage Debian rust:1.81 → openshell-sandbox binary
    • Includes bash, nftables, iptables, iptables-legacy for egress enforcement
    • 27MB final executable
  2. Gateway (Debian runtime)

    • rust:1.81 builder → Debian:bookworm-slim runtime
    • Added libz3-4, libssl3, ca-certificates runtime dependencies
    • Resolves Z3 theorem prover library issues
  3. Core Integration

    • Changed default_sandbox_image() from community registry to official Alpine supervisor
    • Added test: default_image_is_alpine_supervisor()
  4. OpenShift Infrastructure

    • Documented BuildConfig setup for in-cluster builds
    • Documented RBAC config for image-puller role

Test Results

  • Gateway-8: ✅ Running in openshell-system, listens 0.0.0.0:8080
  • Supervisor-16: ✅ Binary validated (ELF 64-bit x86-64, 27MB, 0555 perms)
  • Both compiled entirely in OpenShift for guaranteed amd64 architecture

Technical Notes

Resolved Podman multi-stage overlay filesystem bug by using single-stage Debian for supervisor (compilation and binary placement in same RUN instruction).

🤖 Generated with Claude Code

Replace community sandbox image (ghcr.io/nvidia/openshell-community/sandboxes/base:latest)
with the official Alpine-based supervisor image (ghcr.io/nvidia/openshell/supervisor:latest)
as the default for new sandboxes. This removes the dependency on an external community
registry and provides a minimal, well-maintained base runtime.

Addresses NVIDIA#3116.

Signed-off-by: Akram
Signed-off-by: Akram <akram.benaissi@gmail.com>
…nd Debian gateway in OpenShift

**Summary**
Implements GitHub issue NVIDIA#3116 by removing external community sandbox image dependency
and establishing in-cluster multi-architecture builds via OpenShift BuildConfigs.

**Changes**

1. **Gateway (Dockerfile.gateway.multistage)**
   - Debian:bookworm-slim runtime (from rust:1.81 builder)
   - Added libz3-4, libssl3, ca-certificates runtime deps
   - Resolved Z3 theorem prover library dependency issues
   - Compiles openshell-gateway in OpenShift for amd64 architecture

2. **Supervisor/Sandbox (Dockerfile.supervisor.multistage)**
   - Single-stage Debian rust:1.81 base (avoids Podman overlay fs bugs with multi-stage)
   - Includes bash, nftables, iptables, iptables-legacy for egress enforcement
   - Moves compiled openshell-sandbox binary to /openshell-sandbox root
   - 27MB final executable, fully functional

3. **Core Integration (crates/openshell-core/src/image.rs)**
   - Changed default_sandbox_image() from community registry to Alpine supervisor:latest
   - Added test: default_image_is_alpine_supervisor()
   - All OpenShell deployments now default to official Alpine supervisor

4. **OpenShift Infrastructure (OPENSHELL_BUILD_SETUP.md)**
   - Documented namespace setup: openshell-images (build) + openshell-system (runtime)
   - Documented BuildConfig creation for supervisor and gateway
   - Documented RBAC config for image-puller role between namespaces

**Technical Notes**

- Compiled entirely in OpenShift to guarantee amd64 architecture (no arm64 mismatches)
- Resolved Podman multi-stage overlay fs bug by using single-stage Debian for supervisor
  (compiles in same layer, then mv binary to root)
- Gateway-8 and Supervisor-16 images built and tested running in openshell-system namespace
- Both images boot successfully with proper logging and capability checks

**Testing**
- Gateway pod: running, listens 0.0.0.0:8080, logs show Kubernetes driver initialization
- Supervisor pod: validated binary type (ELF 64-bit x86-64), size 27MB, permissions 0555

Signed-off-by: Akram
Signed-off-by: Akram <akram.benaissi@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 9, 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.

@akram akram closed this Sep 9, 2026
Use the resolve_community_image() function which leverages DEFAULT_COMMUNITY_REGISTRY
and OPENSHELL_COMMUNITY_REGISTRY env var for proper overridability.

This allows users to point to their own community registry rather than hardcoding
the official supervisor image.

Signed-off-by: Akram
Signed-off-by: Akram <akram.benaissi@gmail.com>
@akram akram reopened this Sep 9, 2026
@akram
akram marked this pull request as draft September 9, 2026 10:29
Use format! with DEFAULT_COMMUNITY_REGISTRY constant directly, matching
the pattern from commit 6c3980d. This allows environment variable override
via OPENSHELL_COMMUNITY_REGISTRY without hardcoding registry URLs.

Signed-off-by: Akram
Signed-off-by: Akram <akram.benaissi@gmail.com>
Revert bash, nftables, iptables from supervisor Dockerfile.
The supervisor is a minimal runtime sandbox binary that doesn't need these.
Keep only essential build dependencies.

Signed-off-by: Akram
Signed-off-by: Akram <akram.benaissi@gmail.com>
Match original Dockerfile.supervisor line formatting style.

Signed-off-by: Akram
Signed-off-by: Akram <akram.benaissi@gmail.com>
Restore original single-line format without unnecessary bash package.

Signed-off-by: Akram
Signed-off-by: Akram <akram.benaissi@gmail.com>
Remove explanation of registry override behavior - that's documented
on DEFAULT_COMMUNITY_REGISTRY itself.

Signed-off-by: Akram
Signed-off-by: Akram <akram.benaissi@gmail.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.

1 participant