Skip to content

ci(images): finish the buildcache move, add timeouts, and make Dockerfile changes verifiable - #417

Merged
athvin merged 2 commits into
mainfrom
bm/ci-images-hygiene
Nov 3, 2026
Merged

athvin merged 2 commits into
mainfrom
bm/ci-images-hygiene

Conversation

@athvin

@athvin athvin commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Three things on images.yml, the first two from run 41524220825's measurements.

1. The transitional type=gha cache-from comes out. #407 kept it so the first registry run would not start cold. That run has happened: the log shows importing cache manifest from …/er-buildcache:er-api, and both er-api and er-web cache manifests are in ECR. Buildkit now touches the Actions cache in neither direction — the move build-cost.md prescribed is complete.

2. Both image jobs get a timeout-minutes. They had none, so the default was 360 minutes — a hung buildkit burns six runner-hours while deploy-dev waits. 90 for er-api (measured 58m9s), 30 for er-web (2m30s warm).

3. A Dockerfile change is now verifiable before merge. This workflow ran on push-to-main only, so the first exercise of a restructured build was the merge itself — and a break blocks dev deploys until someone reverts. A verify job now builds both images with push: false on PRs touching */Dockerfile, */.dockerignore or this workflow; er-api/er-web become push-only (their ECR role's OIDC sub is pinned to refs/heads/main, so a PR could never assume it regardless). The path list is deliberately narrow — compilation breakage is rust.yml's and frontend.yml's job, and widening to rust/** would put a cold ~1h build on ordinary PRs. Legal because no job in this workflow is a required check.

This PR self-validates: it changes images.yml, which is in the new trigger's path list, so verify runs here. Expect it to be slow (cold, uncacheable — PRs cannot read the registry cache) and to report as a non-required check.

Next, with that net in place: rust/Dockerfile does COPY . . then one cargo build --release, so any change under rust/ rebuilds all 408 crates. A cargo-chef split would make the dependency layer (including the bundled-DuckDB C++ build) a registry-cache hit and leave only the 33 workspace crates to compile.

🤖 Generated with Claude Code

bmoore813 and others added 2 commits November 2, 2026 19:43
…imeouts

The registry round-trip is proven — run 41524220825 logged `importing cache
manifest from …/er-buildcache:er-api` and both tags are in the repo — so the
transitional `type=gha` cache-from comes out and buildkit touches the Actions
cache in neither direction.

Neither image job had a timeout, so the default was 360 minutes: a hung
buildkit would burn six runner-hours with deploy-dev waiting on it. 90 for
er-api against a measured 58m9s (its Dockerfile's `COPY . .` rebuilds all
408 crates on any rust/ change, so the long case is the normal one until
that is restructured) and 30 for er-web against 2m30s warm.

Co-Authored-By: Claude Fable 5 <[email protected]>
A Dockerfile change was unvalidatable before merge — this workflow ran on
push-to-main only, so the first exercise of a restructured build was the
merge, and a break blocked dev deploys until someone reverted. `verify`
builds both images with push:false on PRs touching a Dockerfile, a
.dockerignore or this file; er-api/er-web become push-only (their ECR role
pins sub to refs/heads/main, so a PR could never assume it anyway).

The path list stays narrow on purpose: a source change that breaks
compilation is rust.yml's and frontend.yml's job, and widening to rust/**
would put a cold ~1h build on ordinary PRs. Legal because no job here is a
required check.

Co-Authored-By: Claude Fable 5 <[email protected]>
@athvin athvin changed the title chore(ci): drop the transitional gha cache, and give the image jobs timeouts ci(images): finish the buildcache move, add timeouts, and make Dockerfile changes verifiable Nov 3, 2026
@athvin
athvin merged commit 8e950b3 into main Nov 3, 2026
40 checks passed
athvin added a commit that referenced this pull request Nov 3, 2026
…ry (#422)

Every Rust PR opened after #376 fails to compile, on a commit that has nothing
to do with it:

    error: failed to run custom build command for `libduckdb-sys v1.20000.1`
    panicked at build_bundled_cc.rs:65:
      unpacking bundled DuckDB sources: Os { code: 39, kind: DirectoryNotEmpty }

`libduckdb-sys` unpacks the bundled C++ sources into its `OUT_DIR` and panics
if that directory is not empty. The saved `target/` carries a populated
`debug/build/libduckdb-sys-<hash>/out`; on restore cargo re-runs the build
script but does not clear the directory, so every job that compiles duckdb
dies before a single test runs.

## Why it looked like the PR's fault

Main's run for #376 went GREEN — all twelve test and e2e jobs. Its jobs
restored the PRE-bump entry, and `lint`, the single writer, only saved the
poisoned one at the end of the run. So the breakage never lands on the commit
that caused it; it lands on every PR afterwards.

That asymmetry cost real time on #418 (an infra-only PR with no Rust in it, so
six Rust failures made no sense). The sequence that eventually distinguished
"my change" from "the cache" was: another open PR passing the same gate →
`git diff HEAD~1 -- Cargo.lock` showing no new crates → main's run for the bump
having run the identical jobs green. Each step eliminated a hypothesis that
otherwise looks plausible. The one that looked right and was not: "the PR lost
a race with main's cache write, so just re-run" — it fails identically on a
re-run, because the poisoned entry is the one being restored, not a missing one.

#417 appears unaffected only because it touches CI files, so `detect` skips its
Rust tier entirely.

## The fix is the lever the file already documents

"`prefix-key` makes the v0 entries unreachable (restore-keys are prefixed too)
so they age out instead of being downloaded for nothing." Same situation, same
remedy: v1 -> v2, so no partial restore can resurrect the poisoned entry. One
cold cycle, then normal.

All EIGHT occurrences move together — the `lint` writer and the seven
restore-only jobs. Bumping only the writer would leave every other job
restoring v1, which is the broken state with extra steps.

## Not fixed here, deliberately

`.github/workflows/shared/rust-gate.md` and the two `*.lock.yml` files
generated from it still carry `v1-rust`, so the agentic workflows will hit the
same panic. They are not required checks, so this is noise rather than a block
— and their lock files are generated artifacts, which I am not going to
hand-edit. Bumping the `.md` and recompiling with gh-aw belongs to whoever owns
that workflow.

Co-authored-by: bmoore813 <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin deleted the bm/ci-images-hygiene branch November 3, 2026 03:11
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.

2 participants