Repository navigation
fix(e2e): align container engine selection across helpers #1481
Description
Agent Diagnostic
The container engine selection behavior differs between the Rust e2e harness and the shell build helper:
e2e/rust/src/harness/container.rsreadsOPENSHELL_E2E_CONTAINER_ENGINE, then derives Podman only whenOPENSHELL_E2E_DRIVER=podman, otherwise it defaults to Docker.tasks/scripts/container-engine.shreadsCONTAINER_ENGINE, then auto-detects Podman first when installed, then falls back to Docker.
This means a host with both Docker and Podman installed can run Rust e2e helper code with Docker while shell build scripts select Podman by default.
Description
Actual behavior: OpenShell has multiple container engine selection paths with different environment variables and default behavior. Rust e2e helpers and shell build helpers can select different engines on the same host.
Expected behavior: Container engine selection should have one documented precedence order across Rust e2e helpers and shell scripts. The same environment should select the same engine unless a caller explicitly overrides it.
Reproduction Steps
- Use a host with both
dockerandpodmaninstalled. - Leave
OPENSHELL_E2E_CONTAINER_ENGINE,OPENSHELL_E2E_DRIVER, andCONTAINER_ENGINEunset. - Observe that Rust e2e helper logic defaults to Docker.
- Observe that
tasks/scripts/container-engine.shauto-detects Podman first.
Environment
- OS: Linux host with Docker and Podman installed
- Docker: any installed version
- Podman: any installed version
- OpenShell: current
main
Logs
Rust helper:
OPENSHELL_E2E_CONTAINER_ENGINE -> OPENSHELL_E2E_DRIVER=podman -> docker fallback
Shell helper:
CONTAINER_ENGINE -> podman if installed -> docker fallback
Suggested Fix
Define and document a single precedence order, then update both implementations. One possible order:
- explicit
OPENSHELL_E2E_CONTAINER_ENGINE - explicit
CONTAINER_ENGINE - driver-derived default from
OPENSHELL_E2E_DRIVER - auto-detect an available engine
- fail clearly if neither Docker nor Podman is available
Update:
e2e/rust/src/harness/container.rstasks/scripts/container-engine.sh- relevant e2e/build documentation
Related Work
This came up while designing #1476. The GPU workload image build task should use the existing shell helper for now and avoid introducing another container-engine selector.
Activity
TaylorMutch commentedon May 20, 2026
I've run into this as well. Thank you for the issue!
jganoff commentedon May 21, 2026
I just ran into this as well, and also with the Helm / Skaffold dev setup scripts. Including some Claude-gathered context below for reference, since it may be helpful to fix/align in 1 pass.
This also bites outside the e2e harness, in the helm/Skaffold local dev path. Sharing the repro in case it tightens the fix scope.
Repro
macOS with Docker Desktop running and Podman installed but its machine not running:
Output:
Workaround:
CONTAINER_ENGINE=docker mise run helm:skaffold:dev.Why this case adds something to the precedence design
The order proposed in the issue body would fix the inconsistency between the Rust e2e harness and
container-engine.sh. The helm/Skaffold path has a stronger constraint worth encoding too:Skaffold names it itself in the build log:
Found [k3d-openshell-dev-...] context, using local docker daemon.k3d ran on Docker; a podman-built image is not visible to that daemon. Hadpodman inforeturned a valid arch, the build would have succeeded and deploy would have failed withImagePullBackOffinstead. Today's loud build failure is the milder symptom of the same root issue.I'd add a step to the precedence list:
Adjacent bug, separately filable
ce_info_arch(tasks/scripts/container-engine.sh:176-182) suppressespodman infoerrors with2>/dev/nulland returns whatever lands on stdout. With a non-running podman machine it returnedOS: darwin/arm64, which then flowed throughnormalize_arch→PREBUILT_ARCH→target_tripleand finally surfaced asunsupported architecture: OS: darwin/arm64fromstage-prebuilt-binaries.shfour scripts later. Validating the arch string insidece_info_archwould turn this into a clear "is your container engine running?" error.elezar commentedon May 22, 2026
Implementation Plan
Issue type:
fixComplexity: Medium
Confidence: High - the resolver policy has been narrowed; implementation is cross-file but well scoped
Summary
Align container engine selection across e2e helpers, shell build helpers, and Skaffold local image builds. The fix removes the duplicate
OPENSHELL_E2E_CONTAINER_ENGINEselector, makesCONTAINER_ENGINE=docker|podmanthe single explicit engine override, and adds a scopedCONTAINER_ENGINE_TARGET=local-k8s-clusterhint for Skaffoldpush: falselocal-cluster image workflows.Scope
tasks/scripts/container-engine.sh: implement the canonical shell resolver, validate env values, reject removedOPENSHELL_E2E_CONTAINER_ENGINE, reject explicit conflicts, infer local-cluster engines only whenCONTAINER_ENGINE_TARGET=local-k8s-cluster, and hardence_info_archerror handling.deploy/helm/openshell/skaffold.yaml: setCONTAINER_ENGINE_TARGET=local-k8s-clusteraround the gateway and supervisor custom image build commands.e2e/rust/src/harness/container.rs: align the Rust e2e helper with the e2e-relevant env rules only:CONTAINER_ENGINE,OPENSHELL_E2E_DRIVER, removed-selector failure, and conflict errors. Do not add kube-context inference in Rust.e2e/with-docker-gateway.shande2e/with-podman-gateway.sh: validateCONTAINER_ENGINEagainst the lane, set it after validation, and removeOPENSHELL_E2E_CONTAINER_ENGINEexports.architecture/build.md: document the final precedence model, the local-cluster target hint, and the Skaffold/local image constraint.Implementation Steps
tasks/scripts/container-engine.shso selection follows this algorithm:OPENSHELL_E2E_CONTAINER_ENGINEwith a migration message;CONTAINER_ENGINE_TARGET, accepting onlylocal-k8s-cluster;OPENSHELL_E2E_DRIVER=docker|podman;CONTAINER_ENGINE_TARGET=local-k8s-cluster;CONTAINER_ENGINE=docker|podmanagainst those required engines;k3d-*contexts imply Docker;kind-*usesKIND_EXPERIMENTAL_PROVIDER=podmanwhen set, otherwise Docker;CONTAINER_ENGINE=docker|podmanrather than falling back silently.ce_info_archso malformed engine metadata, such asOS: darwin/arm64, produces a direct error instead of flowing into staging scripts.CONTAINER_ENGINEandOPENSHELL_E2E_DRIVERconsistently, with conflict errors, but keep local-cluster inference shell-only.CONTAINER_ENGINEvalues and remove allOPENSHELL_E2E_CONTAINER_ENGINEexports.CONTAINER_ENGINE_TARGET=local-k8s-clusterinto Skaffold custom build commands for gateway and supervisor images.Test Plan
e2e/rust/src/harness/container.rsfor removedOPENSHELL_E2E_CONTAINER_ENGINEfailures,CONTAINER_ENGINEvalidation,OPENSHELL_E2E_DRIVERderivation, Docker/Podman conflict errors, invalid env values, and fallback behavior.tasks/scripts/container-engine.shwith focused fixture-based command checks covering explicit env precedence, invalid values, removed-selector failure, e2e driver conflicts, k3d/kind local-cluster inference, unknown local-cluster context failures, explicit local-cluster conflict failures, and malformedce_info_archoutput. Keep temporary fixture scripts out of the final diff unless a minimal permanent check can be added without introducing a harness.mise run e2e:dockeron a Docker host andmise run e2e:podmanwhen Podman is available. For the Helm/Skaffold path, runmise run helm:k3s:createfollowed by a focusedmise run helm:skaffold:run, or document why the environment cannot run it.Risks & Open Questions
kind-*can be Docker- or Podman-backed. The first implementation should useKIND_EXPERIMENTAL_PROVIDER=podmanwhen present and otherwise default to Docker, with explicitCONTAINER_ENGINEavailable for unusual setups.CONTAINER_ENGINEbecause host auto-detection may choose an engine whose images are invisible to the cluster.CONTAINER_ENGINE_TARGET=local-k8s-clustermust not be applied globally. Normal image builds should not depend on the user’s active kube context.ce_info_archfalling back touname -m; tightening this behavior should keep errors actionable./proc, binary execution policy, or inter-process visibility.Documentation Impact
architecture/build.mdwith the canonical env model and local-cluster image workflow behavior.Revision 1 - initial plan
github-actions commentedon Jun 14, 2026
This issue has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. Comment or remove the state:stale label to keep it open.