Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/build-e2e-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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<ver>-cc<ver>-cx<ver>-node<major>
# ghcr.io/tinyhumansai/medulla_e2e_base:oc<ver>-cc<ver>-cx<ver>-node<major>-<debian release>
#
# 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
Expand Down Expand Up @@ -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
)"
Expand Down
35 changes: 33 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/e2e-live-harness.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
12 changes: 10 additions & 2 deletions e2e/coordination/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
senamakel marked this conversation as resolved.
Resolved

# ---------------------------------------------------------------------------
# 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

Expand All @@ -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.
Expand Down
10 changes: 8 additions & 2 deletions e2e/coordination/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:*-<release>`
# 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.
#
Expand Down
3 changes: 2 additions & 1 deletion e2e/coordination/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading