Skip to content

Commit b6428cb

Browse files
authored
fix(build): align container engine selection (#1944)
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent ce788b5 commit b6428cb

8 files changed

Lines changed: 716 additions & 70 deletions

File tree

‎architecture/build.md‎

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ packages share the same host portability floor. Supervisor binaries remain
6464
static musl and use `cargo zigbuild` when available, including native CPU
6565
architectures, so C dependencies are compiled for the musl target instead of the
6666
host GNU libc target. Local Docker image tasks infer the target architecture from
67-
`DOCKER_PLATFORM` when set, otherwise from the container engine host metadata
68-
with the kernel architecture as the fallback. CI invokes the same staging step
69-
via the `rust-native-build.yml` workflow (per-architecture, per-component) and
70-
uploads the result as an artifact that the image build job downloads back into
71-
the staging directory before running Buildx.
67+
`DOCKER_PLATFORM` when set. Otherwise, they require valid container engine host
68+
metadata and fail when the engine query is unavailable or reports an unsupported
69+
architecture, avoiding host-kernel fallbacks that can target the wrong
70+
architecture. CI invokes the same staging step via the `rust-native-build.yml`
71+
workflow (per-architecture, per-component) and uploads the result as an artifact
72+
that the image build job downloads back into the staging directory before running
73+
Buildx.
7274

7375
Runtime layout:
7476

@@ -94,6 +96,23 @@ the macOS user's shared home directory.
9496
Local image work should use `mise` tasks rather than direct Docker commands so
9597
the same staging and tagging assumptions are used locally and in CI.
9698

99+
Container-engine selection is centralized in `tasks/scripts/container-engine.sh`.
100+
`CONTAINER_ENGINE=docker|podman` is the only explicit override. Docker- and
101+
Podman-backed e2e wrappers validate that override against their lane, set
102+
`OPENSHELL_E2E_DRIVER`, and reject the removed
103+
`OPENSHELL_E2E_CONTAINER_ENGINE` selector so build helpers and Rust e2e support
104+
containers use the same engine. When no explicit override is present, an e2e
105+
driver requirement wins, then a local-cluster requirement, then host
106+
auto-detection.
107+
108+
Local Kubernetes image workflows opt into cluster-aware selection with
109+
`CONTAINER_ENGINE_TARGET=local-k8s-cluster`. The hint is intentionally scoped to
110+
Skaffold-style `push: false` builds where the image must land in the engine
111+
backing the active local cluster: `k3d-*` contexts require Docker, `kind-*`
112+
contexts use `KIND_EXPERIMENTAL_PROVIDER=docker|podman` when set, and ambiguous
113+
or unknown contexts require an explicit `CONTAINER_ENGINE`. Other image builds
114+
do not infer from kube context.
115+
97116
## CI and E2E
98117

99118
Required checks run on GitHub Actions. Workflows that use NVIDIA self-hosted runners trigger from copy-pr-bot mirror branches, so trusted PRs are mirrored into `pull-request/<N>` branches before those workflows run.

‎deploy/helm/openshell/skaffold.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ build:
2626
context: ../../..
2727
custom:
2828
buildCommand: |
29-
CONTAINER_ENGINE=docker \
29+
CONTAINER_ENGINE_TARGET=local-k8s-cluster \
3030
IMAGE_NAME="${IMAGE%:*}" \
3131
IMAGE_TAG="${IMAGE##*:}" \
3232
tasks/scripts/docker-build-image.sh gateway
@@ -43,7 +43,7 @@ build:
4343
context: ../../..
4444
custom:
4545
buildCommand: |
46-
CONTAINER_ENGINE=docker \
46+
CONTAINER_ENGINE_TARGET=local-k8s-cluster \
4747
IMAGE_NAME="${IMAGE%:*}" \
4848
IMAGE_TAG="${IMAGE##*:}" \
4949
tasks/scripts/docker-build-image.sh supervisor

0 commit comments

Comments
 (0)