Repository navigation
ci(containers): pin the Ubuntu base by digest and drop the weekly rebuild (#235) - #255
Conversation
01a5b09 to
673b46c
Compare
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟢 Approval recommended
The change is narrowly focused on enforcing digest-pinned Ubuntu bases and shifting updates to reviewed PRs, backed by a new validator integrated into CI/workflows and aligned documentation, with no active issues indicated in the review evidence.
No open issues 🎉
What changed in this PR
This pull request updates the container maintenance and release policy so Ubuntu base-image changes (including security updates) occur only via reviewed pull requests, rather than via an unattended weekly rebuild that can silently republish cached layers or introduce unreviewed dependency drift.
Changes:
- Pin both container Dockerfiles to
ubuntu:24.04@sha256:…and enforce consistent base digests across images. - Remove the weekly scheduled container rebuild; keep a weekly scheduled lecture-matrix run against
:latest. - Configure Dependabot to propose digest refreshes while preventing tag jumps (e.g., 24.04 → 26.04), and update docs/CHANGELOG to match the new behavior.
| File | Summary |
|---|---|
scripts/check-base-pins.sh |
Adds a validator (with --self-test) to require tag@sha256:digest pins and enforce the same base digest across Dockerfiles. |
README.md |
Updates user-facing guidance to reflect “updates via reviewed PRs” rather than weekly rebuilds. |
docs/dev/ARCHITECTURE.md |
Aligns architecture documentation with PR-driven container updates and the removal of scheduled rebuilds. |
docs/CONTAINER-GUIDE.md |
Revises container update policy documentation to match digest pinning + Dependabot PR flow. |
CONTRIBUTING.md |
Updates contribution/staged-release notes to remove references to scheduled container rebuilds. |
containers/quantecon/README.md |
Updates container README wording around update cadence and security updates under the new policy. |
containers/quantecon/Dockerfile |
Pins ubuntu:24.04 by digest and documents rationale. |
containers/quantecon-build/Dockerfile |
Pins ubuntu:24.04 by digest (matching the other image) and documents rationale. |
CHANGELOG.md |
Records the container update-policy change under [Unreleased]. |
.github/workflows/validate-containers.yml |
Runs the new base-pin self-test/check early in CI and surfaces the pinned base in the workflow summary. |
.github/workflows/test-containers-lectures.yml |
Adds/adjusts a weekly schedule against :latest and updates gating/comments accordingly. |
.github/workflows/test-actions.yml |
Ensures the new base-pin checker is included in the “must-run” self-test gating. |
.github/workflows/build-containers.yml |
Removes the weekly schedule and updates comments to reflect push/dispatch-driven builds. |
.github/dependabot.yml |
Allows Ubuntu digest-only refreshes while ignoring semver major/minor tag upgrades; consolidates docker grouping. |
This pull request is too complex or risky for automated approval.
Review effort: Balanced
|
Candidate comparison: the pin changes neither image. Run 41975512521 (head
The compressed figure is the sum of the registry manifest's layer sizes. Equal sums with every step cached mean the candidates carry the same layers as Copilot's review found no issues and left no inline comments, so there are no threads to answer. Claude Code (on behalf of mmcky) |
…uild (#235) As decided on #234. A scheduled build-containers.yml run replayed every layer from cache and republished an unchanged image whenever ubuntu:24.04 had not moved, while the docs promised weekly security updates; when it had moved, the images' floating packages re-resolved with no pull request (#222). - Both Dockerfiles pin ubuntu:24.04@sha256:fe81560..., the digest the current :latest images were built on (build-containers run 41956606594). - Dependabot's docker entry ignores ubuntu's major and minor updates only, so it proposes each new 24.04 digest but not 26.04, in one group without update-types: a digest-only update has no semver level and would otherwise arrive as one PR per directory. - build-containers.yml loses its schedule. test-containers-lectures.yml gains its own Monday 02:00 UTC schedule against :latest, so the lecture matrix still runs weekly with no image change behind it. - validate-containers.yml's plan job runs scripts/check-base-pins.sh on every event: each FROM pins <image>:<tag>@sha256:<digest>, and the images pin the same base. - README.md, containers/quantecon/README.md, docs/CONTAINER-GUIDE.md, docs/dev/ARCHITECTURE.md and CONTRIBUTING.md say what the images now do, and point to #129 for what the pin does not make reproducible. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMa8fZsd2ykLqLqrwtW
673b46c to
7dcb38b
Compare
|
After the rebase onto
That difference comes from the measurement, not the image. Each size job logs Docker's overlay2 status:
Every job that ran with native overlay diff off reproduces the figure exactly, including the full-image job in each run. The compressed sums, taken from the registry manifest, are equal on every run, so the layers are the same. The on-disk figure in Claude Code (on behalf of mmcky) |
|
After the merge (
With every step cached and the registry layer sizes summing to the same bytes, consumers pulling Claude Code (on behalf of mmcky) |
…ates and container READMEs (#191) (#260) PR 4 of the user manual (#178). docs/user gains five chapters: getting-started.md (the templates, their jobs and permissions, the changes a site makes to them, and migrating an existing repository), composition.md, containers.md, versioning.md and security.md. They describe main as it is after #254, #255, #257 and #258, with one alert for the two inputs the templates use that ship in v0.15.0. templates/README.md and the three container READMEs become signposts. The container READMEs' build, update and test sections move to a new docs/dev/CONTAINERS.md. docs/MIGRATION-GUIDE.md and docs/CONTAINER-GUIDE.md are removed; their per-repository migration notes go to PLAN's rollout section. The root README points at the manual, CONTRIBUTING's doc-update table names each chapter, and its known limit on Dependabot says bumps come on each repository's own schedule. A root SECURITY.md says to report a vulnerability privately, through the Security tab, and what is in scope. The harness gate's IGNORED treats it as documentation, root only, and its self-test checks that. PLAN: item 6 is done (#253, #258), item 10 moves to PR 5, and the rows for #232, #233, #235, #239 and #247 record their closure. Claude-Session: https://claude.ai/code/session_01WT8bMXc6EroDo2qFL1pCjS Co-authored-by: Claude Opus 5.5 <[email protected]>
build-containers.ymlrebuilt both images every Monday, and three docs promised that this kept them current with Ubuntu security updates. It didn't. Whenubuntu:24.04had not moved, BuildKit replayed every layer from the:latestcache and republished the same image (#235: four of the seven Mondays from 2026-08-24 to 2026-10-05, and 10-12 and 10-26 since). When it had moved, the images' floating packages re-resolved with no pull request, which is how plotly 7 reached the lean image and broke the lecture matrix for three weeks (#222). On #234 the maintainer chose option (b): pin the base by digest, have Dependabot propose each base move, drop the schedule, and correct the docs. This PR does that, so every change to an image, OS updates included, now arrives as a pull request that #245 builds and smoke-tests before:latestmoves.Changes
containers/quantecon/Dockerfile,containers/quantecon-build/DockerfileFROM ubuntu:24.04@sha256:fe81560990fae86dc4743202b2cb4d3df98d0bcf949173cecef15ce1127ef852, with a comment on why..github/dependabot.ymldockerentry no longer ignoresubuntuoutright. It ignores onlyversion-update:semver-majorandversion-update:semver-minor, which holds the 24.04 tag and lets digest updates through. The two docker groups become one group withoutupdate-types(see below)..github/workflows/build-containers.ymlschedule:removed. The comments that mentioned it are fixed (the trigger list, themain-<sha>note,Report failure). Alerting is unchanged:Report failurestill fires on any non-dispatch failure, which is now a push..github/workflows/test-containers-lectures.ymlschedule:(Monday 02:00 UTC) against:latest, the maintainer's choice of the options sent through the organiser. Thetestjob'sif:admitsschedule. Comments that said the workflow runs "off the weekly container build" are fixed.Report failureis untouched: it already alerts on any non-dispatch event.scripts/check-base-pins.shFROMincontainers/*/Dockerfilemust be<image>:<tag>@sha256:<64 hex>. EveryFROMof one<image>:<tag>must pin the same digest across all the Dockerfiles.scratchand earlier build stages are skipped; aFROM ${ARG}fails, since it can't be checked. Also--self-test..github/workflows/validate-containers.ymlplanjob runs the self-test, then the check, on every event, before deciding which images to build. It writes the pinned base to the step summary..github/workflows/test-actions.ymlIGNOREDcan never come to coverscripts/check-base-pins.sh.README.md,containers/quantecon/README.md,docs/CONTAINER-GUIDE.md,docs/dev/ARCHITECTURE.md:latest). Smallest correct edits: the docs session restructures these files in #191 and #192 and keeps the wording.CONTRIBUTING.md:latestuntested. The organiser agreed this edit lands here, with the behaviour.CHANGELOG.md[Unreleased]→ Changed.The digest, and why the pin should change neither image
library/ubuntu, then a request for/v2/library/ubuntu/manifests/24.04that accepts the OCI index and Docker manifest-list types. TheDocker-Content-Digestheader wassha256:fe81560990fae86dc4743202b2cb4d3df98d0bcf949173cecef15ce1127ef852. This is the multi-arch index digest, the form Dependabot writes. Its amd64 manifest issha256:78d4744e…, created 2026-10-25, with a single layersha256:7a48b8f0…(29.77 MB).:latestalready uses it. build-containers run 41956606594, deps: bump the conda group across 2 directories with 1 update #223's merge build and the one that produced the current:latestof both images, logsFROM docker.io/library/ubuntu:24.04@sha256:fe81560990fae86dc4743202b2cb4d3df98d0bcf949173cecef15ce1127ef852in both jobs. It also downloads the same7a48b8f0…base layer.FROMstep on the resolved digest, and the unpinnedFROMresolved to the same one. This PR's candidate builds should therefore show every stepCACHED, and the candidates' layers should be identical to:latest's. I can't compare package lists locally: there is no Docker here, and an anonymous GHCR pull is refused (Reproducibility: what would it take to rebuild a published lecture exactly? #129's point 1). The comparison is this PR's own run; see What to watch.Dependabot: a digest move, never 26.04
I didn't run a Dependabot dry run (the
dependabotCLI needs Docker). The evidence is dependabot-core's source and a public repository with the same configuration.tag@digestpin, dependabot-core works out the latest tag from the comparable tags, minus ignored versions, and then compares the digest of that tag. With majors and minors ignored the latest tag stays24.04, so a new digest under24.04is a digest-only refresh. Ignore conditions never match it, because it changes no version (update_checker.rb,digest_requirement_up_to_date?). Ignoringubuntuwith noupdate-types, as before, stops both kinds.vdenisov/mkvtool's.github/dependabot.ymlpinsubuntu:24.04@sha256:…and ignoresubuntuwith exactly these two update types.4fbb8e6to68ee220" (2026-08-10) and "Bump ubuntu from68ee220tofe81560" (2026-11-02), the second to the digest pinned here.update-typesare applied bySemverGroupingRules#allow_grouping?. It compares the current version with the latest. When neither major, minor nor patch has risen, as in a digest-only refresh, it returnsfalse, so the update is kept out of the group. With our previousdocker(minor/patch) anddocker-majorgroups, each base move would therefore have arrived as two ungrouped pull requests, one per directory, and could have merged one image ahead of the other. A group with noupdate-typestakes it (return true unless update_types, line 45), so both Dockerfiles move in one PR, as the conda group's do.What I checked, and how
origin/mainbefore writing code. All held; one was narrower than written.build-containers.ymlruns, measured from creation to completion, took 23-41 s (a cached replay) on 2026-08-31, 09-07, 09-21 and 09-28: four of the seven Mondays from 08-24 to 10-05. On 08-24, 09-14 and 10-05 they took 453-546 s, a real rebuild. Since then: 10-12 took 40 s, 10-19 took 512 s, 10-26 took 24 s and 11-02 took 524 s.README.md:156,containers/quantecon/README.md:135,docs/dev/ARCHITECTURE.md:55) are still at those lines and say what build-containers: scheduled rebuilds republish a cached image, while the docs promise weekly security updates #235 quotes.containers/quantecon/README.md:180,docs/dev/ARCHITECTURE.md:13,:179,:326and:369,docs/CONTAINER-GUIDE.md:12and:141, andCONTRIBUTING.md:105and:128. All are corrected here, as PLAN.md's Scheduled container rebuilds: refresh OS packages weekly, or pin the base image by digest and move it by pull request? #234 entry listsdocs/CONTAINER-GUIDE.mdamong them.ubuntuoutright, as Scheduled container rebuilds: refresh OS packages weekly, or pin the base image by digest and move it by pull request? #234 says (.github/dependabot.yml, thedockerentry).update-typesgroups would have split each base move into one PR per directory (see the Dependabot section above).scripts/check-base-pins.sh --self-testpasses. It runs 3 passing and 8 failing cases, plus a missing file and no files. Each failing case must fail with its own error message, so none passes by failing for the wrong reason. The cases: unpinned, lower-casefrom, a digest without a tag, a short digest, mismatched digests across files, mismatched digests across stages, aFROM ${BASE}, and noFROM.ubuntu:24.04@sha256:fe81560… (containers/quantecon-build/Dockerfile:8, containers/quantecon/Dockerfile:8). On copies of the real Dockerfiles it fails as it should:FROMunpinned:FROM ubuntu:24.04 is not pinned as <image>:<tag>@sha256:<digest>, exit 1;00000…:FROM ubuntu:24.04 pins sha256:00000…, but …/full.Dockerfile:8 pins sha256:fe815…: the images must move their base together, exit 1.validate-containers.ymlhas the same three as onmain.python scripts/generate-docs.py --checkand--check-examplespass.git diff origin/main -- CHANGELOG.mdonly adds lines under[Unreleased].validate-containers.ymlandbuild-containers.yml, so it builds and smoke-tests both images aspr-<N>candidates.What to watch
Container images / …jobs:Plan's new step should print
Base image: ubuntu:24.04@sha256:fe81560…for both Dockerfiles.Both candidate builds should show every step
CACHED, and finish in about a minute rather than 7-8. Any step that isn't cached means the candidate differs from:latest, and I'll report it here.Image size for each candidate should match the current
:latest, byte for byte on the compressed figure, since that is the sum of the same layers. From test-container run 41957231876, which followed run 41956606594:quantecon:latestquantecon-build:latest:latestimages. It should be the same cache replay, so consumers get the same layers under a new manifest.dependabot.ymlfrommain. Insights → Dependency graph → Dependabot →docker→ the latest job log should show the ubuntu ignore conditions and "No update needed for ubuntu 24.04", because the pin is current. The first base move, when Canonical next republishes 24.04, should arrive as one "bump the docker group across 2 directories" PR that edits both Dockerfiles. That PR builds full candidates (7-8 min each), and the lecture matrix runs after it merges.docker_digest_only_update_suppression(dependabot-core#15103), that stops digest-only updates for versioned tags like24.04. Distro codenames likenobleare exempt. It is evidently off in production today (the mkvtool move of 2026-11-02 above). If GitHub turns it on, base moves would stop with no error. The fix would beFROM ubuntu:noble@sha256:…, the same image under a tag Dependabot treats as non-comparable. If no base-move PR arrives within about six weeks, check this first.:latest, check outmain's actions atgithub.sha, and on failure open or comment on the usual tracking issue.cancel-in-progressgroup.Report failurefiles an issue for the cancelled run, the trade-off its comment already accepts. Whether a superseded run should file at all is a separate follow-up recorded in Work plan — QuantEcon/actions: v0.17.0 shipped; next the v0 move and wave 6's gate and workers #246.Not in this PR
quantecon-book-networksstill resolve at build time whenever their layer rebuilds. The pin only makes that happen on a reviewed pull request.test-container.yml(the maintainer's call, on my recommendation). It smoke-tests an unchanged image against a fixture in this repo, so a weekly rerun would repeat the same result. It still runs after every:latestpush and on every candidate.:latestbefore any test.docs/dev/PLAN.md: the docs session updates its Scheduled container rebuilds: refresh OS packages weekly, or pin the base image by digest and move it by pull request? #234 and build-containers: scheduled rebuilds republish a cached image, while the docs promise weekly security updates #235 entries after this merges.Closes #235.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMa8fZsd2ykLqLqrwtW