Skip to content

site-build: the image in the execution cache's key; comments re-wrapped - #85

Merged
mmcky merged 1 commit into
mainfrom
site-build/image-in-cache-key
Nov 22, 2026
Merged

mmcky merged 1 commit into
mainfrom
site-build/image-in-cache-key

Conversation

@mmcky

@mmcky mmcky commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

What

The follow-up the review of #84 asked for (the organiser's reviewer, 2026-11-22).

File Change
.github/workflows/site-build.yml the execution cache's key gains the image: jb1-<key>-<tag><env hash>-<packages hash>-<image hash>-<run>, the image hash being the first 16 hex digits of the SHA-256 of the image's /etc/quantecon-container (its name and build time), printed in the step's log; a leg whose image lacks that file fails with an error; the header comments say so, and the lines #84 left past the wrap width are re-wrapped
_base/environment-update.yml one header line re-wrapped; no pin changes
_base/README.md the six series were brought to the baseline, and their --upgrade lines removed, by 2026-11-20; plotly-orca can leave the list in a pull request of its own
sites/README.md the new key

Why the image belongs in the key. Until now a site's cache was keyed on the file its environment hashes and on its extra_packages, not on the image. A new image kept the key, so its pages were not executed again (dp's cache had the same gap, noted in the comments). QuantEcon/actions builds the images only when their Dockerfiles change: build-containers.yml has no schedule, since both Dockerfiles pin their base by digest. So a new build_date means a new image, and the key changes only when the environment does. The last such change was QuantEcon/actions#346 on 2026-11-19, which added Chrome.

Cost. Every site's next build is cold once, intro's and dp's included: about 10 and 30 minutes on ubuntu-latest.

Checks

  • tools/tests: 329 passed, 1 skipped.
  • The workflow parses. No comment line in site-build.yml or _base/environment-update.yml runs past 80 columns.
  • This pull request's own build shows the new key in its run summary.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL

The follow-up the review of #84 asked for. A site's
cache was keyed on the file its environment hashes and its
extra_packages, not on the image, so a new image kept the key and its
pages were not executed again (dp's cache had the same gap). The key now
also carries a hash of the image's own /etc/quantecon-container, which
names the image and its build time. The images are built only when
their Dockerfiles change (QuantEcon/actions' build-containers.yml has no
schedule), so a new hash means a new image, not a rebuild of the same
one. A leg whose image lacks the file fails with an error rather than
building with an incomplete key. Every site's next build is cold once.

Also: site-build.yml's comment lines that #84 left past the wrap width
are re-wrapped, as is one line of _base/environment-update.yml's header;
_base/README.md says the series were brought to the baseline, and their
--upgrade lines removed, by 2026-11-20 (and that plotly-orca can leave
the list in a pull request of its own); sites/README.md gives the new key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
Copilot AI adaptive review requested due to automatic review settings November 22, 2026 07:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues blocking approval of the image-aware site execution cache changes.

No open issues 🎉

What changed in this PR

This follow-up to #84 makes site execution caches sensitive to container image changes, so updated images trigger fresh page execution.

Changes:

  • Add a hash of /etc/quantecon-container to cache keys and restore prefixes; fail if the image record is missing or empty.
  • Document the new cache behavior and completed upstream environment alignment.
  • Rewrap workflow and environment comments without changing package pins.
File Description
sites/​README.md Document image-aware cache keys and remaining invalidation limits.
.github/​workflows/​site-build.yml Validate and hash the image record for cache keys; update and rewrap comments.
_base/​README.md Record completed baseline alignment and defer plotly-orca removal.
_base/​environment-update.yml Rewrap header comments; leave package pins unchanged.

Review effort: Balanced (adaptive)

@mmcky
mmcky merged commit bd7aa92 into main Nov 22, 2026
6 checks passed
@mmcky
mmcky deleted the site-build/image-in-cache-key branch November 22, 2026 07:57
mmcky added a commit that referenced this pull request Nov 26, 2026
…ntries; dp publishes notebooks (#98)

Three changes to the one environment and its records, in one pull request as the infrastructure organiser's review of #85 proposed (2026-11-22), so the three base sites build from an empty cache once, not twice.

## What changes

- **`plotly-orca` leaves `_base/environment-update.yml`.** It was listed for the three `!conda install … plotly-orca` lines in the series' lectures, which were removed upstream by 2026-11-20 with the other install lines that replaced a pin. No pool lecture installs or uses it now: no lecture in `lectures/` or in any series' `lectures/` at its pin mentions orca, and `tools/pool-check --installs` lists no install that would replace a pin. The list's header now says those lines were removed (it said they "are being removed"), names the three sites built with it (intro, advanced, programming) and says the GPU leg creates its base from `_base/environment.yml`.
- **A base site's cache key hashes the list's entries, not its comments.** In `site-build.yml`, the env hash of a `base` site is the sha256 of `_base/environment-update.yml`'s lines with comments (a `#` at the start of a line or after a space) and blank lines removed, and the GPU leg's image hash takes `_base/environment.yml`'s entries the same way. So an edit to a comment no longer executes every page of intro, advanced and programming again. A `series` site (dp) keeps `hashFiles` of its `environment.yml`, whole, as dp's own cache keys hash it, so dp's key is unchanged. The comments in the workflow, `sites/README.md` and `_base/README.md` say so.
- **dp publishes notebooks.** Since QuantEcon/lecture-dp#87, dp's `publish.yml` builds the notebooks as well as HTML (no PDF), so `sites/dp/site.yml` now has `publishes: [html, notebooks]`, and `sites/README.md`'s table and notes follow. Nothing reads `publishes` yet: every leg still builds HTML alone, so the pool's dp build has no "Download Notebook" button until the site build makes notebooks (the last section of QuantEcon/lecture-dp#86), which dp's shadow comparison will show.

## What the entries filter does, checked locally

| Input | Result |
|---|---|
| main's list against this branch's | the entries differ in one line, `- plotly::plotly-orca==1.3.1` |
| this branch's list against a copy with one comment reworded | the same hash |
| `_base/environment.yml`, main against this branch | the same entries (only its comment changed) |

Local runs on this branch: `tools/pool-check` clean (the list has 39 packages; the pool's lectures install 29 of them), the tool tests 330 passed and 1 skipped, and `tools/site-matrix` gives dp `publishes: ["html", "notebooks"]` with its `series` key inputs unchanged.

## What to expect from this pull request's builds

The list's entries change, so intro, advanced and programming find no cache under their new keys and execute every page in the environment without `plotly-orca`: that is this change's test. dp's key is unchanged, so it restores main's cache. After the merge, main's push builds the three again from an empty cache and saves, and later runs restore.

Copilot: not requested (Matt, 2026-11-22).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01WT8bMZxoF4m8xKRb8BcHnG
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