Skip to content

ci: run the integration jobs against a CodeBuild-like docker daemon - #116

Merged
ipmb merged 3 commits into
mainfrom
ci-codebuild-like-daemon
Nov 18, 2026
Merged

ipmb merged 3 commits into
mainfrom
ci-codebuild-like-daemon

Conversation

@ipmb

@ipmb ipmb commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

The integration jobs mounted the runner's docker socket, so the daemon under test was GitHub's rather than one configured the way CodeBuild configures it. Each job now starts the image's own dockerd with the buildspec's flags.

Why

The authoritative buildspec is generated in the backend repo, formations/app/build.py (install phase):

nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 \
  --storage-driver=overlay2 --registry-mirror=https://registry.apppackcdn.net &> /var/lib/docker.log &

Two differences from the runner's daemon mattered.

Image store. GitHub's runner daemon uses the containerd image store; the buildspec pins the classic one. The two are not interchangeable for either build system: pack exports to the daemon along a different path on the containerd store, and buildx can only export a local cache there. Testing on one and shipping the other means the jobs exercise a daemon we never run.

Registry mirror. The runner's daemon has none, so neither the buildpack prefetch nor the Docker builds resolved through the CDN the way they do in production.

A fresh daemon per run also gives a cold image store, so the prefetch is genuinely exercised instead of finding images an earlier job left behind in the shared daemon.

Relationship to #118

An earlier revision of this PR claimed the storage driver was what fixed integration-heroku24. That was wrong. That job was failing because the runner's Docker 29.4.2 cannot export a pack-built image at all on any store (buildpacks/pack#2747, fixed in Docker 29.9.0), which #118 addressed on its own by bumping the runner's daemon to 29.10.0. #118's run proved the point: with containerd-snapshotter=true still set and only the version changed, the job passed.

So this PR no longer fixes anything red. It is parity work, and stands or falls on that. Rebased on #118, it drops the four setup-docker-action steps, since it stops using the runner's daemon altogether.

Verification

Locally, the daemon comes up, the CLI reaches it, and docker info reports storage-driver=overlay2 with the mirror set.

In CI, the full suite is green, and pack's daemon uses containerd storage warning no longer appears anywhere in the run, previously on every buildpack job.

Maintenance

These flags duplicate formations/app/build.py and must be kept in step with it. There is no automated check for that drift.

🤖 Generated with Claude Code

ipmb and others added 3 commits November 18, 2026 13:22
The integration jobs mounted the runner's docker socket, so the daemon
under test was GitHub's, not one configured the way CodeBuild configures
it. Two differences mattered.

The runner's daemon uses the containerd image store; CodeBuild does not.
The buildspec generated in the backend repo (formations/app/build.py,
install phase) starts dockerd with --storage-driver=overlay2. pack's
export to the daemon takes a different path on the containerd store, and
integration-heroku24 has been failing there with

  failed to fetch base layers: open /tmp/imgutil.local.image.N/blobs/
  sha256/67d5b5...: no such file or directory

on a code path CodeBuild never runs. That digest is the linux/amd64
config blob of heroku/builder:24, which unlike heroku/builder:22 is a
multi-arch index -- which is why only the heroku-24 job hit it.

The runner's daemon also has no registry mirror, so neither the prefetch
nor the Docker builds resolved through the CDN the way they do in
production.

Each job now starts the image's own dockerd with the buildspec's flags.
A fresh daemon per run also gives a cold image store, so the buildpack
prefetch is genuinely exercised rather than finding images an earlier job
left in the shared daemon.

DOCKER_HOST is overridden because the docker:dind base bakes in
tcp://docker:2375, which would point the CLI away from the daemon
started here. Verified locally: the daemon comes up, the CLI reaches it,
and docker info reports storage-driver=overlay2 with the mirror set.

These flags must be kept in step with formations/app/build.py.

Co-Authored-By: Claude Opus 5 <[email protected]>
The four integration jobs each carried their own copy of the clone, the
env file, the docker run and the apppack.toml check -- about ninety lines
repeated four times, which is how the daemon flags would have drifted
apart the moment one copy was edited.

Each job now sets the case as environment (APPNAME, BRANCH,
EXPECTED_COMMAND) and runs .github/scripts/integration-test.sh. The
workflow drops 207 lines to 71.

The expected command moves into a YAML folded scalar, so the quoting
survives verbatim instead of being escaped through two shell levels. The
buildpack value genuinely contains a '"'"' sequence -- that is what
postbuild writes into apppack.toml -- and it was previously spelled
'\"'\"'*'\"'\"' inline, which nothing could read.

The jobs now check out the repo, which they did not need before, because
that is where the script comes from. setup-python moves ahead of the
build since the script verifies inline.

Co-Authored-By: Claude Opus 5 <[email protected]>
The storage driver is not what makes the heroku-24 case pass; a Docker
29.9.0+ daemon does that on either image store (buildpacks/pack#2747).
overlay2 is here because the buildspec pins it, and the two stores are
not interchangeable for either build system.

Also corrects the DOCKER_HOST note: docker:29-dind does not set it.

Co-Authored-By: Claude Opus 5 <[email protected]>
@ipmb
ipmb force-pushed the ci-codebuild-like-daemon branch from cc45ee3 to ce3a05c Compare November 18, 2026 20:23
@ipmb
ipmb merged commit 9ed7cec into main Nov 18, 2026
9 checks passed
@ipmb
ipmb deleted the ci-codebuild-like-daemon branch November 18, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant