Repository navigation
Description
From the 2026-10-06 codebase review (finding M4; record: .qe/dev/log/2026-10-06-codebase-review.md, #220).
The choice
What should a scheduled run of build-containers.yml do: refresh the images' OS packages every week, or leave the images alone until a pull request changes them?
Why it needs deciding
build-containers.yml rebuilds both images every Monday (:15-17) and takes the layer cache from the published :latest (cache-from at :79 and :121, cache-to: type=inline). BuildKit reuses a layer when its instruction and its parent are unchanged. So when ubuntu:24.04 resolves to the same digest as last time, a scheduled run replays every layer from cache, including apt-get install, conda env create and the build_date marker, and republishes the same image. The build logs show this:
- fully cached, in about 20-40 s: the scheduled runs of 2026-08-31, 2026-09-07, 2026-09-21 and 2026-09-28;
- rebuilt, in about 7-8 min, because the base digest had moved: 2026-08-24, 2026-09-14 and 2026-10-05.
The pattern held after the review. The scheduled runs of 2026-10-12 and 2026-10-26 took 40 s and 24 s, and those of 2026-10-19 and 2026-11-02 about 8.5 min.
The documentation says something different:
README.md:156promises "Weekly automated builds (Monday 2am UTC) for security updates".containers/quantecon/README.md:135says the image "automatically stays current with Ubuntu 24.04 security updates".docs/dev/ARCHITECTURE.md:55lists "Weekly rebuilds".
When the base does move, these re-resolve together, with no pull request:
- the lean image's conda packages that carry no version (
xlrd,graphviz,python-graphvizandlxmlsince fix(containers): pin the lean image's conda layer to the Anaconda 2026.07 baseline (#222) #226), and every transitive dependency the environment file does not name; - its
>=pip floors; quantecon-book-networks, which is unpinned in both images.
This is what broke #222. The scheduled rebuild of 2026-10-19 re-resolved the lean image's then-unpinned plotly to 7.x, which cannot export images with the image's kaleido 0.2, and the lecture matrix's lecture-python-advanced.myst leg failed on the lean image every week after that. #226 (2026-11-04) pinned each lean-image conda package that the anaconda=2026.07 metapackage also pins, at the metapackage's version. That leaves the four above and the pip layer.
Options
(a) Refresh weekly.
- First finish pinning the lean image's Python layer: fix(containers): pin the lean image's conda layer to the Anaconda 2026.07 baseline (#222) #226 pinned its conda packages, but its pip packages still carry
>=floors. The full image already uses==for its build tools. - Then make scheduled runs actually rebuild, with
no-cacheonscheduleevents or a weekly cache-bust build argument on the apt step. - OS updates then arrive weekly, and the Python stack moves only through pull requests.
- Cost: a cold build of about 7-8 min per image every week.
- Two cautions:
no-cache-filterscannot isolate the apt step in a single-stage Dockerfile.- Without the pinning first, this option turns the silent drift from every two or three weeks into every week.
(b) Pin the base.
- Pin
FROM ubuntu:24.04@sha256:…in both Dockerfiles, so each base move arrives as a Dependabot pull request, which containers: no validation runs before the tag every consumer pins moves #142's planned pull-request builds would test. - The Dependabot
dockerentry currently ignoresubuntuentirely (.github/dependabot.yml). It would need to allow digest updates while still holding the 24.04 tag. - Drop the schedule, or keep it and document it as a cache warm-up.
- OS updates then arrive whenever Canonical republishes the base (every few weeks), reviewed rather than silent.
Either way, the three documents above must say what the images actually do. The task that implements the choice waits on this issue (native dependency).
The review's recommendation: (b), with the rest of the lean image's Python layer pinned too (#226 did the conda packages). Every change to an image then arrives as a pull request. That fits the dependency policy in docs/dev/PLAN.md, the reproducibility goal of #129 and the validation plan of #142. Choose (a) if weekly OS patches matter more than reviewing each image change.
Closing
Close as completed, with the choice and its reasons recorded in a comment. If the question is mooted, close it as not planned, then re-scope or close the task that waits on it.
Activity
docs(plan): cite #235 for the scheduled-rebuild work, and #234 for it…
qe: record the outcome of the 2026-10-06 GitHub handover
mmcky commentedon Nov 4, 2026
Decided 2026-11-04: option (b), pin the base.
FROM ubuntu:24.04@sha256:…in both Dockerfiles, so a base move arrives as a Dependabot pull request instead of silently. The Dependabotdockerentry stops ignoringubuntuand allows digest updates while holding the 24.04 tag.schedule:frombuild-containers.yml. With the base pinned, a scheduled run has nothing to pick up, so every image change comes from a pull request.README.md:156,containers/quantecon/README.md:135,docs/dev/ARCHITECTURE.md:55) to say what the images actually do: OS updates arrive when the pinned base moves, through a reviewed pull request.Why: every change to an image then arrives as a pull request. That fits the dependency policy in
docs/dev/PLAN.mdand the validation plan of #142, whose phase 1 (pull-request builds and smoke tests, in progress) is what tests those Dependabot base moves before:latestmoves. It also ends the silent re-resolution that broke #222.#235 carries the implementation, after #142's phase 1 lands. Closing as completed.
Posted by Claude Code (on behalf of mmcky), from the 2026-11-04 decision session.
qe: handover for the GitHub follow-ups of the 2026-10-06 review, and …
docs(plan): cite #235 for the scheduled-rebuild work, and #234 for it…
docs(plan): catch up with the v0.12.0 follow-ups and the 2026-11-04 d…
ci(containers): pin the Ubuntu base by digest and drop the weekly reb…
ci(containers): pin the Ubuntu base by digest and drop the weekly reb…
ci(containers): pin the Ubuntu base by digest and drop the weekly reb…
ci(containers): pin the Ubuntu base by digest and drop the weekly reb…