Skip to content

fix(e2e): align container engine selection across helpers #1481

@elezar

Description

@elezar

Agent Diagnostic

The container engine selection behavior differs between the Rust e2e harness and the shell build helper:

  • e2e/rust/src/harness/container.rs reads OPENSHELL_E2E_CONTAINER_ENGINE, then derives Podman only when OPENSHELL_E2E_DRIVER=podman, otherwise it defaults to Docker.
  • tasks/scripts/container-engine.sh reads CONTAINER_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

  1. Use a host with both docker and podman installed.
  2. Leave OPENSHELL_E2E_CONTAINER_ENGINE, OPENSHELL_E2E_DRIVER, and CONTAINER_ENGINE unset.
  3. Observe that Rust e2e helper logic defaults to Docker.
  4. Observe that tasks/scripts/container-engine.sh auto-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:

  1. explicit OPENSHELL_E2E_CONTAINER_ENGINE
  2. explicit CONTAINER_ENGINE
  3. driver-derived default from OPENSHELL_E2E_DRIVER
  4. auto-detect an available engine
  5. fail clearly if neither Docker nor Podman is available

Update:

  • e2e/rust/src/harness/container.rs
  • tasks/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions