Repository navigation
site-build: the image in the execution cache's key; comments re-wrapped - #85
Merged
Merged
Conversation
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
There was a problem hiding this comment.
🟢 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-containerto 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)
This was referenced Nov 22, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The follow-up the review of #84 asked for (the organiser's reviewer, 2026-11-22).
.github/workflows/site-build.ymljb1-<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_base/README.md--upgradelines removed, by 2026-11-20;plotly-orcacan leave the list in a pull request of its ownsites/README.mdWhy 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.ymlhas no schedule, since both Dockerfiles pin their base by digest. So a newbuild_datemeans 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.site-build.ymlor_base/environment-update.ymlruns past 80 columns.🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL