diff --git a/.github/workflows/build-e2e-image.yml b/.github/workflows/build-e2e-image.yml index 0d0bc28d2..4d8859c0c 100644 --- a/.github/workflows/build-e2e-image.yml +++ b/.github/workflows/build-e2e-image.yml @@ -2,7 +2,7 @@ # Build and publish the coordination e2e harness's **tools base** to GHCR. # # ghcr.io/tinyhumansai/medulla_e2e_base:latest -# ghcr.io/tinyhumansai/medulla_e2e_base:oc-cc-cx-node +# ghcr.io/tinyhumansai/medulla_e2e_base:oc-cc-cx-node- # # The base carries tmux, python3, node and all three real coding CLIs, plus the # primed ACP npm cache — roughly 600 MB of downloads that do not change when the @@ -71,11 +71,12 @@ jobs: raise SystemExit(f"Dockerfile.base has no ARG {name}") return match.group(1) - print("oc{}-cc{}-cx{}-node{}".format( + print("oc{}-cc{}-cx{}-node{}-{}".format( arg("OPENCODE_VERSION"), arg("CLAUDE_VERSION"), arg("CODEX_VERSION"), arg("NODE_VERSION").split(".")[0], + arg("DEBIAN_RELEASE"), )) PY )" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 170659b82..0f20233d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -393,6 +393,16 @@ jobs: permissions: contents: read packages: read + # A job-local registry hands the just-built tools base to the harness build. + # The `docker-container` Buildx builder cannot read the runner daemon's image + # store (not even through a `docker-image://` named context), so a `load`ed + # base is invisible to it and the harness build falls back to a registry + # pull of a tag that does not exist before merge. + services: + registry: + image: registry:2 + ports: + - 5000:5000 steps: - uses: actions/checkout@v7 with: @@ -402,7 +412,26 @@ jobs: - name: Initialize submodules run: bash scripts/init-submodules.sh + # `network=host` lets the builder container reach the registry service on + # localhost:5000. - uses: docker/setup-buildx-action@v3 + with: + driver-opts: network=host + + # PRs that change Dockerfile.base cannot pull the versioned image yet: + # Build E2E Image publishes it only after such a change reaches main. + # Build the matching base here so the harness uses trixie's g++ 14 and + # glibc without depending on a tag that does not exist before merge. + - name: Build E2E tools base + uses: docker/build-push-action@v6 + with: + context: e2e/coordination + file: e2e/coordination/Dockerfile.base + tags: localhost:5000/medulla-e2e-base:ci + push: true + provenance: false + cache-from: type=gha,scope=e2e-base + cache-to: type=gha,scope=e2e-base,mode=max,ignore-error=true - name: Log in to GHCR uses: docker/login-action@v4 @@ -420,13 +449,15 @@ jobs: with: context: . file: e2e/coordination/Dockerfile + build-args: | + BASE_IMAGE=localhost:5000/medulla-e2e-base:ci tags: medulla-e2e:latest load: true provenance: false - cache-from: type=gha + cache-from: type=gha,scope=e2e-harness # A transient GHA cache-service failure must not discard a successfully # built and loaded image or prevent the offline scenarios from running. - cache-to: type=gha,mode=max,ignore-error=true + cache-to: type=gha,scope=e2e-harness,mode=max,ignore-error=true - name: Coordination round trip (run.sh, --network none) run: SKIP_BUILD=1 bash e2e/coordination/run-docker.sh diff --git a/docs/e2e-live-harness.md b/docs/e2e-live-harness.md index 45fc9c10c..a62306369 100644 --- a/docs/e2e-live-harness.md +++ b/docs/e2e-live-harness.md @@ -308,8 +308,8 @@ must change boot-time state (a custom `MOCK_LLM_MARKER`). Factor your harness in ### 9. Docker wraps the *same* script, with no second harness -The image bakes prebuilt binaries (multi-stage: `rust:1.96-bookworm` build → -`debian:bookworm-slim` + tmux + python3 + a pinned opencode release tarball) and sets +The image bakes prebuilt binaries (multi-stage: `rust:1.96-trixie` build → +`debian:trixie-slim` + tmux + python3 + a pinned opencode release tarball) and sets the `*_BIN` env overrides; the container entry just runs `run.sh` unchanged. One source of truth for the test logic; docker is only an environment. diff --git a/e2e/coordination/Dockerfile b/e2e/coordination/Dockerfile index 3f9c32335..5ed9e3fe2 100644 --- a/e2e/coordination/Dockerfile +++ b/e2e/coordination/Dockerfile @@ -31,13 +31,16 @@ # bash e2e/coordination/build-image.sh --base # BASE_IMAGE=ghcr.io/tinyhumansai/medulla_e2e_base:latest \ # bash e2e/coordination/build-image.sh -ARG BASE_IMAGE=ghcr.io/tinyhumansai/medulla_e2e_base:oc1.17.18-cc2.1.226-cx0.147.0-node22 +ARG BASE_IMAGE=ghcr.io/tinyhumansai/medulla_e2e_base:oc1.17.18-cc2.1.226-cx0.147.0-node22-trixie # --------------------------------------------------------------------------- # Stage 1: compile medulla + examples (release) # --------------------------------------------------------------------------- # Debian (glibc) base so the resulting binaries match the glibc runtime stage. -FROM rust:1.96.1-bookworm AS build +# The release must be the base image's (its tag ends in it): a binary linked +# against a newer glibc than the runtime's does not start. Trixie for its g++ 14, +# which the vendored btop (`src/btop`, C++23) needs; bookworm ships only g++ 12. +FROM rust:1.96.1-trixie AS build WORKDIR /build @@ -57,6 +60,11 @@ RUN apt-get update \ pkg-config libssl-dev \ && rm -rf /var/lib/apt/lists/* +# The image is what the E2E suites run, so it must really contain btop: without +# this, `src/btop/build.rs` would quietly build the Resources tab's stub if the +# toolchain above ever regressed to a g++ older than 14. +ENV MEDULLA_BTOP_REQUIRED=1 + # The workspace's vendored path deps live under vendor/* (tinyagents, tinyflows, # tinyhumans-sdk). src/ carries every member crate (src/sdk, src/tui, src/link) # including their tests/ and examples/ trees. diff --git a/e2e/coordination/Dockerfile.base b/e2e/coordination/Dockerfile.base index a51c1c29c..91380bb2e 100644 --- a/e2e/coordination/Dockerfile.base +++ b/e2e/coordination/Dockerfile.base @@ -5,7 +5,7 @@ # rebuilding its toolchain per run: # # ghcr.io/tinyhumansai/medulla_e2e_base:latest -# ghcr.io/tinyhumansai/medulla_e2e_base:oc1.17.18-cc2.1.226-cx0.147.0-node22 +# ghcr.io/tinyhumansai/medulla_e2e_base:oc1.17.18-cc2.1.226-cx0.147.0-node22-trixie # # It exists because these downloads are ~600 MB and they do not change when the # source does. Baking them into the harness image meant every CI run whose layer @@ -18,7 +18,13 @@ # and pointing `Dockerfile`'s `BASE_IMAGE` at the new tag — deliberately three # steps, because a silently-moving CLI version is a harness that tests something # other than what its tag says. -FROM debian:bookworm-slim +# +# The Debian release is in the tag too, and must match the `rust:*-` +# build stage in `Dockerfile`: the harness binary links the build stage's glibc, +# so a base on an older release cannot run it. Trixie because the vendored btop +# (`src/btop`) is C++23 and needs g++ 14, which bookworm does not package. +ARG DEBIAN_RELEASE=trixie +FROM debian:${DEBIAN_RELEASE}-slim # Pinned CLI versions. The version tag above is derived from these. # diff --git a/e2e/coordination/build-image.sh b/e2e/coordination/build-image.sh index 1cfdd33be..1bde42f14 100755 --- a/e2e/coordination/build-image.sh +++ b/e2e/coordination/build-image.sh @@ -58,11 +58,12 @@ def arg(name): # Node moves for reasons unrelated to the harness, so only its major is in the # tag: a patch bump should not orphan an otherwise identical base. print( - "oc{}-cc{}-cx{}-node{}".format( + "oc{}-cc{}-cx{}-node{}-{}".format( arg("OPENCODE_VERSION"), arg("CLAUDE_VERSION"), arg("CODEX_VERSION"), arg("NODE_VERSION").split(".")[0], + arg("DEBIAN_RELEASE"), ) ) PY