From 5a766cd647dd6e748ecd53ef56236519d5af315f Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Thu, 29 Oct 2026 10:32:17 +0000 Subject: [PATCH 1/5] build(e2e): move harness images to Debian trixie The e2e base and harness images now build on Debian trixie instead of bookworm, since the vendored btop is C++23 and needs g++ 14, which bookworm does not package. The Debian release is folded into the base image tag so the build stage and runtime stay in lockstep, and MEDULLA_BTOP_REQUIRED is set in the harness image so a missing btop fails the build rather than silently falling back to the stub. Auto-committed-on: cuttlefish Co-authored-by: Medulla --- .github/workflows/build-e2e-image.yml | 5 +++-- docs/e2e-live-harness.md | 4 ++-- e2e/coordination/Dockerfile | 12 ++++++++++-- e2e/coordination/Dockerfile.base | 10 ++++++++-- e2e/coordination/build-image.sh | 3 ++- 5 files changed, 25 insertions(+), 9 deletions(-) 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/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 From 9260f5e619683fa9a134973f1fc269a927a72b0b Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Sun, 15 Nov 2026 12:24:41 +0000 Subject: [PATCH 2/5] ci: build e2e base image locally before e2e image Pull requests that modify Dockerfile.base cannot pull the versioned base image because it is only published after the change lands on main. The workflow now builds the base image locally and passes it to the e2e image build via BASE_IMAGE, so the harness uses the matching toolchain without depending on a tag that does not exist before merge. Auto-committed-on: cuttlefish Co-authored-by: Medulla --- .github/workflows/ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 170659b82..51c17d039 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -404,6 +404,21 @@ jobs: - uses: docker/setup-buildx-action@v3 + # 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: medulla-e2e-base:ci + load: true + provenance: false + cache-from: type=gha + cache-to: type=gha,mode=max,ignore-error=true + - name: Log in to GHCR uses: docker/login-action@v4 with: @@ -420,6 +435,8 @@ jobs: with: context: . file: e2e/coordination/Dockerfile + build-args: | + BASE_IMAGE=medulla-e2e-base:ci tags: medulla-e2e:latest load: true provenance: false From a09b563cd4b23c67bc32193255cc9d02ecff7ebd Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Sun, 15 Nov 2026 12:35:36 +0000 Subject: [PATCH 3/5] ci: pass e2e base image as a named build context The docker-container Buildx builder cannot resolve images loaded into the runner's Docker daemon as FROM sources, so the just-built base image is now imported explicitly as a named build context instead of being passed as a build arg. Auto-committed-on: cuttlefish Co-authored-by: Medulla --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51c17d039..6dabca71a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -436,7 +436,12 @@ jobs: context: . file: e2e/coordination/Dockerfile build-args: | - BASE_IMAGE=medulla-e2e-base:ci + BASE_IMAGE=e2e-base + # The `docker-container` Buildx builder does not automatically use + # images loaded into the runner's Docker daemon as FROM sources. + # Import the just-built base explicitly as a named image context. + build-contexts: | + e2e-base=docker-image://medulla-e2e-base:ci tags: medulla-e2e:latest load: true provenance: false From 61d047e8104166af81da126c98052949f2c26d17 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Sun, 15 Nov 2026 12:47:25 +0000 Subject: [PATCH 4/5] ci: scope gha build cache per image Give the e2e base image and the e2e harness image separate GitHub Actions cache scopes so their layers no longer share a single cache namespace. This prevents the two builds from evicting or overwriting each other's cached layers, which was degrading cache hit rates. Auto-committed-on: cuttlefish Co-authored-by: Medulla --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6dabca71a..fb19319ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -416,8 +416,8 @@ jobs: tags: medulla-e2e-base:ci load: true provenance: false - cache-from: type=gha - cache-to: type=gha,mode=max,ignore-error=true + 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 @@ -445,10 +445,10 @@ jobs: 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 From a2289661a795c6238e80748e01efed4e61984083 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Sun, 15 Nov 2026 13:05:07 +0000 Subject: [PATCH 5/5] ci: publish e2e base image to a job-local registry The e2e base image is now pushed to a registry service running alongside the job instead of being loaded into the runner's daemon, since the docker-container Buildx builder cannot see loaded images and the harness build previously failed trying to pull a tag that does not exist before merge. The builder uses host networking to reach the registry on localhost:5000, and the harness build now pulls the base directly via BASE_IMAGE rather than a named Auto-committed-on: cuttlefish Co-authored-by: Medulla --- .github/workflows/ci.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb19319ea..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,11 @@ 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. @@ -413,8 +427,8 @@ jobs: with: context: e2e/coordination file: e2e/coordination/Dockerfile.base - tags: medulla-e2e-base:ci - load: true + 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 @@ -436,12 +450,7 @@ jobs: context: . file: e2e/coordination/Dockerfile build-args: | - BASE_IMAGE=e2e-base - # The `docker-container` Buildx builder does not automatically use - # images loaded into the runner's Docker daemon as FROM sources. - # Import the just-built base explicitly as a named image context. - build-contexts: | - e2e-base=docker-image://medulla-e2e-base:ci + BASE_IMAGE=localhost:5000/medulla-e2e-base:ci tags: medulla-e2e:latest load: true provenance: false