Skip to content

Commit 67deef6

Browse files
committed
refactor: generalize container build tooling for Docker and Podman compatibility
Rename Docker-branded env vars, scripts, and mise tasks to generic container terminology while preserving full backwards compatibility. - Add ce_resolve_containerfile() helper to container-engine.sh that auto-detects Containerfile.X or Dockerfile.X (Containerfile preferred) - Rename build scripts from docker-* to container-* (4 files) - Add CONTAINER_* env var equivalents with DOCKER_* fallbacks (9 vars) - Create tasks/container.toml with canonical build:container:* task names - Convert tasks/docker.toml to pure alias file for backwards compat - Update all cross-references in shell scripts, TOML task files, CI workflow, architecture docs, and agent files - Fix pre-existing bug: remove exec keyword from container-build-ci.sh (exec does not work with bash functions) Closes NVIDIA#968 Signed-off-by: Adam Miller <[email protected]> refactor: move deploy/docker to deploy/container Rename the build artifact directory from deploy/docker to deploy/container to reflect engine-neutral naming (Docker and Podman are both supported). Updates all 37 references across CI workflows, task scripts, Skaffold config, Dockerfiles, docs, and .gitignore. refactor: replace docker.toml shims with native mise aliases in container.toml Use mise's alias property on each build:container:* task instead of maintaining a separate docker.toml file with depends-based redirects. Adds build:container:prebuilt (migrated from docker.toml) and drops docker.toml entirely.
1 parent 294c64e commit 67deef6

38 files changed

Lines changed: 492 additions & 328 deletions

‎.claude/agent-memory/arch-doc-writer/MEMORY.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
- Four runtime images: sandbox (5 stages), gateway (2 stages), cluster (k3s base), pki-job (Alpine)
6363
- Two build-only images: python-wheels (Linux multi-arch), python-wheels-macos (osxcross cross-compile)
6464
- CI image: Dockerfile.ci (Ubuntu 24.04, pre-installs docker/buildx/aws/kubectl/helm/mise/uv/sccache/socat)
65-
- Cross-compilation: `deploy/docker/cross-build.sh` shared by sandbox + gateway Dockerfiles
65+
- Cross-compilation: `deploy/container/cross-build.sh` shared by sandbox + gateway Dockerfiles
6666
- Sandbox image has coding-agents stage: Claude CLI (native installer), OpenCode, Codex (npm)
6767
- Helm chart deploys a StatefulSet (NOT Deployment), PVC 1Gi at /var/openshell
6868
- Cluster image does NOT bundle image tarballs -- components pulled at runtime from distribution registry

‎.github/workflows/ci-image.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [main]
66
paths:
7-
- 'deploy/docker/Dockerfile.ci'
7+
- 'deploy/container/Dockerfile.ci'
88
- 'mise.toml'
99
- 'mise.lock'
1010
- 'tasks/**'
@@ -72,7 +72,7 @@ jobs:
7272
--cache-to "type=gha,mode=max,scope=ci-image-${{ matrix.arch }}" \
7373
--push \
7474
-t "$ARCH_IMAGE" \
75-
-f deploy/docker/Dockerfile.ci \
75+
-f deploy/container/Dockerfile.ci \
7676
.
7777
7878
- name: Smoke check CI image

‎.github/workflows/docker-build.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ jobs:
222222
set -euo pipefail
223223
binary="${{ needs.resolve.outputs.binary_name }}"
224224
download_dir="prebuilt-rust-binary"
225-
stage="deploy/docker/.build/prebuilt-binaries/${{ matrix.arch }}"
225+
stage="deploy/container/.build/prebuilt-binaries/${{ matrix.arch }}"
226226
found="$(find "$download_dir" -type f -name "$binary" -print -quit)"
227227
if [[ -z "$found" ]]; then
228228
echo "missing downloaded artifact file: $binary" >&2
@@ -238,7 +238,7 @@ jobs:
238238
DOCKER_BUILDER: openshell
239239
run: |
240240
set -euo pipefail
241-
mise exec -- tasks/scripts/docker-build-image.sh "${{ inputs.component }}" \
241+
mise exec -- tasks/scripts/container-build-image.sh "${{ inputs.component }}" \
242242
--cache-from "type=gha,scope=${{ inputs.component }}-${{ matrix.arch }}" \
243243
--cache-to "type=gha,mode=max,scope=${{ inputs.component }}-${{ matrix.arch }}"
244244

‎.github/workflows/driver-vm-macos.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193
run: |
194194
set -euo pipefail
195195
docker buildx build \
196-
--file deploy/docker/Dockerfile.driver-vm-macos \
196+
--file deploy/container/Dockerfile.driver-vm-macos \
197197
--build-arg OPENSHELL_CARGO_VERSION="${{ inputs['cargo-version'] }}" \
198198
--build-arg OPENSHELL_IMAGE_TAG="${{ inputs['image-tag'] }}" \
199199
--build-arg CARGO_TARGET_CACHE_SCOPE="${{ github.sha }}" \

‎.github/workflows/release-dev.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ jobs:
352352
run: |
353353
set -euo pipefail
354354
docker buildx build \
355-
--file deploy/docker/Dockerfile.cli-macos \
355+
--file deploy/container/Dockerfile.cli-macos \
356356
--build-arg OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" \
357357
--build-arg OPENSHELL_IMAGE_TAG=dev \
358358
--build-arg CARGO_TARGET_CACHE_SCOPE="${{ github.sha }}" \
@@ -512,7 +512,7 @@ jobs:
512512
run: |
513513
set -euo pipefail
514514
docker buildx build \
515-
--file deploy/docker/Dockerfile.gateway-macos \
515+
--file deploy/container/Dockerfile.gateway-macos \
516516
--build-arg OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" \
517517
--build-arg OPENSHELL_IMAGE_TAG=dev \
518518
--build-arg CARGO_TARGET_CACHE_SCOPE="${{ github.sha }}" \

‎.github/workflows/release-tag.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ jobs:
385385
run: |
386386
set -euo pipefail
387387
docker buildx build \
388-
--file deploy/docker/Dockerfile.cli-macos \
388+
--file deploy/container/Dockerfile.cli-macos \
389389
--build-arg OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" \
390390
--build-arg OPENSHELL_IMAGE_TAG="${{ needs.compute-versions.outputs.semver }}" \
391391
--build-arg CARGO_TARGET_CACHE_SCOPE="${{ github.sha }}" \
@@ -631,7 +631,7 @@ jobs:
631631
run: |
632632
set -euo pipefail
633633
docker buildx build \
634-
--file deploy/docker/Dockerfile.gateway-macos \
634+
--file deploy/container/Dockerfile.gateway-macos \
635635
--build-arg OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" \
636636
--build-arg OPENSHELL_IMAGE_TAG="${{ needs.compute-versions.outputs.semver }}" \
637637
--build-arg CARGO_TARGET_CACHE_SCOPE="${{ github.sha }}" \

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ _build/
186186
rootfs/
187187

188188
# Docker build artifacts (image tarballs, packaged helm charts)
189-
deploy/docker/.build/
189+
deploy/container/.build/
190190

191191
# Helm subchart tarballs (regenerated by `helm dependency build`)
192192
deploy/helm/openshell/charts/

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ ocsf_emit!(event);
179179

180180
- Always use `uv` for Python commands (e.g., `uv pip install`, `uv run`, `uv venv`)
181181

182-
## Docker
182+
## Containers
183183

184-
- Always prefer `mise` commands over direct docker builds (e.g., `mise run docker:build` instead of `docker build`)
184+
- Always prefer `mise` commands over direct container builds (e.g., `mise run build:container` instead of `docker build` or `podman build`)
185185

186186
## Cluster Infrastructure Changes
187187

‎architecture/build.md‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ OpenShell builds these main artifacts:
1212
|---|---|
1313
| Gateway binary | `crates/openshell-server` |
1414
| CLI package and Python SDK | `python/openshell` plus Rust binaries where packaged |
15-
| Gateway container image | `deploy/docker/Dockerfile.gateway` |
16-
| Supervisor container image | `deploy/docker/Dockerfile.supervisor` |
15+
| Gateway and supervisor container images | `deploy/container/Dockerfile.images` |
1716
| Helm chart | `deploy/helm/openshell` |
1817
| VM driver/runtime assets | `crates/openshell-driver-vm` |
1918
| Published docs site | `docs/` rendered by Fern config in `fern/` |
@@ -50,12 +49,10 @@ glibc 2.31 floor.
5049

5150
## Container Builds
5251

53-
The Docker image pipeline is a two-step flow: build the Rust binary natively
54-
for the target architecture, then assemble the container image from the
55-
prebuilt binary. The gateway image is built from `deploy/docker/Dockerfile.gateway`
56-
and the supervisor image from `deploy/docker/Dockerfile.supervisor`. Neither
57-
Dockerfile compiles Rust — both copy a staged binary out of
58-
`deploy/docker/.build/prebuilt-binaries/<arch>/` into the final image.
52+
The container image pipeline stages prebuilt Rust binaries, then builds container
53+
images from `deploy/container/Dockerfile.images`. CI builds native artifacts on the
54+
target architecture, stages them under `deploy/container/.build/`, and then uses
55+
Buildx to publish per-architecture images and multi-architecture tags.
5956

6057
Binary staging is driven by `tasks/scripts/stage-prebuilt-binaries.sh`. Gateway
6158
binaries use `cargo zigbuild` with GNU targets pinned to glibc 2.31, including
@@ -80,7 +77,6 @@ Runtime layout:
8077
Static linkage is required because the image is mounted/extracted into
8178
sandbox environments (Docker extraction, Podman image volumes, Kubernetes
8279
init-container copy-self) and cannot rely on a dynamic loader.
83-
8480
Gateway image builds bake the corresponding supervisor image tag into the
8581
gateway binary so Docker sandboxes do not depend on `:latest` by default.
8682
Package formulas also pin Docker supervisor extraction to the matching release

‎crates/openshell-driver-podman/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ sequenceDiagram
125125
C->>C: entrypoint: /opt/openshell/bin/openshell-sandbox
126126
```
127127

128-
The supervisor image from `deploy/docker/Dockerfile.supervisor` copies the static
129-
`openshell-sandbox` binary to `/openshell-sandbox`.
128+
The `supervisor` target in `deploy/container/Dockerfile.images` copies the
129+
`openshell-sandbox` binary to `/openshell-sandbox` in the supervisor image.
130130
Mounting that image at `/opt/openshell/bin` makes the binary available as
131131
`/opt/openshell/bin/openshell-sandbox`.
132132

@@ -385,4 +385,4 @@ matter compared to cluster or rootful runtimes:
385385
netns, proxy, and relay behavior shared by all drivers.
386386
- Container engine abstraction: `tasks/scripts/container-engine.sh` for
387387
build/deploy support across Docker and Podman.
388-
- Supervisor image build: `deploy/docker/Dockerfile.supervisor`.
388+
- Supervisor image build: `deploy/container/Dockerfile.images`.

0 commit comments

Comments
 (0)