Repository navigation
Conversation
|
Hi @tasodoufu, thanks for picking up #102. The retry design matches the issue's checklist, and reusing the Jupyter cache keeps the second attempt cheap. Before we take it further, one ask under QuantEcon's Code of AI Use (QEP-5), which asks every pull request to say how it was made:
We're marking the PR on hold until that update lands. When you push, please also rebase onto Assisted-by: Claude Code (Claude Fable 5.1) |
…with the shipped code (#106, #109, #99) (#175) * docs: sweep to the 2026.06 baseline and measured image sizes (#106) Both images ship anaconda=2026.06 (containers/quantecon/environment.yml:11; the lean image carries the matching pin set), but seven sites still said 2025.12. They now say 2026.06. Image sizes were a mix of round "~8GB / ~3GB" figures, a "~60% smaller" claim, and an older measured pair. Every size site now carries the pair the fixed size job (#172) produced on 2026-09-23, run 35856865426 (Docker 28.0.4, overlay2, ubuntu-latest), and says which metric it is: - quantecon (full): 3.33 GB compressed (what a cold pull downloads), 8.60 GB on disk - quantecon-build (lean): 2.93 GB compressed, 7.33 GB on disk The lean image is about 12% smaller to pull and 15% smaller on disk, so the "faster CI pulls" / "fast image pulls" wording becomes "a modestly smaller pull", and the lean README's unmeasured pull-time and package-count rows go. "Minimal TexLive" was false. The two Dockerfiles' apt lists differ in exactly two packages: the lean image drops texlive-luatex and adds graphviz; texlive-latex-extra and texlive-fonts-extra are in both. The docs now say so, and name what actually distinguishes the lean image: no anaconda metapackage, an explicit package list pinned to the 2026.06 baseline. The full image's "Complete TexLive installation" is corrected to match. CHANGELOG history and PLAN.md:68's narration of the old date-pin keep their 2025.12 mentions on purpose. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DwQrz9VbFrbAD7uh2LTgzh * docs: reconcile READMEs, guides and templates with the shipped code (#109, #99) The docs half of #109, with #99 folded in. The code items (the build-jupyter-cache latex-requirements-file passthrough, the cname warning and the template pin-drift check) ride with #107's PR. Examples that failed for adopters: - permissions: the preview-netlify and preview-cloudflare "Complete Workflow Example" blocks declared none, and the root README and QUICK-REFERENCE container quick starts declared contents/packages only. Both preview actions list, create and update PR comments through github.rest.issues.* with github.token, so each block now grants contents: read and pull-requests: write. - actions/checkout: the remaining 29 @v4 and 2 @v5 references across 13 docs move to @v7, matching the templates (#168) and this repo's workflows. with: fetch-depth lines are kept. Documented behaviour that does not exist: - QUICK-REFERENCE: the "Preview with Custom URL" recipe passed an alias input preview-netlify does not accept (the alias is fixed at pr-N); it becomes a short "Preview URL" note. The setup-environment key row now carries the environment-name and python-version segments and the cached path. The sample log block's "LaTeX cache hit" line (no LaTeX caching exists) and its other invented lines are replaced by strings the actions actually print. The "Pages 404?" snippet recommended contents: write, which as a permissions block would also drop pages and id-token; it now lists pages: write and id-token: write, with contents: write only for create-release-assets (#99). - MIGRATION-GUIDE: the collab.yml snippet passed build-html and cache-workflow, which build-lectures never accepted; it now restores the cache with restore-jupyter-cache and builds with builder/source-dir. The copied commit message no longer claims LaTeX caching, and the build-jupyter-cache key carries its update-hash segment here and in ARCHITECTURE (#99). - build-lectures README: "use setup-latex" pointed at a removed action; the inputs table gains the missing failure-artifact-name row. - README and ARCHITECTURE said restore-jupyter-cache "never saves"; it is read-only by default with an optional PR-scoped save-cache. - setup-environment README: the cache key and path now match action.yml. Templates and the custom domain: - The Actions Pages deploy ignores a CNAME file, so the cname input has no effect. templates/publish.yml, templates/README.md, MIGRATION-GUIDE and QUICK-REFERENCE now point at Settings -> Pages instead of offering cname. - templates/publish.yml's release-asset block now says it needs a tag trigger (the file runs on pushes to main and manual dispatch) and contents: write (the job grants contents: read). - New templates/latex-requirements.txt: the TeX packages the two images share, in the whole-line-comment format setup-environment parses. The cache.yml standard-runner comment and templates/README point at it, since a standard-runner pdflatex build fails without the file. - cache.yml and templates/README describe the _build artifact as failure-only, which it has been since v0.8.0. Smaller items: the lean image README's last @main example moves to @v0; the full image README's theme version reads 0.21.0, the environment.yml pin. README's Contributing section now points at CONTRIBUTING.md, which tests by branch and moves v0; CONTRIBUTING gains the staged-release procedure decided on #110 (decision 4), its known limits and the rollback. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DwQrz9VbFrbAD7uh2LTgzh * docs: bring PLAN.md, CONTRIBUTING and the CHANGELOG up to date (#106, #109) PLAN.md: - The consumers table said five lecture repos were pinned to v0.8.0 or v0.9.0. Dependabot bumped all six exact call sites to v0.11.1 between 2026-08-12 and 2026-08-24 (#110's 2026-09-23 revalidation; the pins are confirmed by code search). The rows, the "Corrected" note and the lecture-jax rollout row now say so; the section keeps its structure. - The August triage table already had rows for the issues #106 lists, except #135. Each row is refreshed to its state on 2026-09-23 (all are open; the open PRs #144, #170, #171 and #172 and the in-progress #105 and #107 work are named), and #135 gets a row. No rows are duplicated. - Item 10's "propagate corrected container-size figures" half is marked done by this sweep; the trim itself stays open as its own PR (decision 1 on #110). - The "Last updated" line records this pass. CONTRIBUTING.md: the doc-update matrix gains a PLAN.md row, so a backlog item or consumer ref that moves updates the plan rather than waiting for the next audit. CHANGELOG.md: one [Unreleased] Documentation entry for the sweep. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DwQrz9VbFrbAD7uh2LTgzh * docs: address review of the #106/#109 docs sweep - templates/latex-requirements.txt: describe the file format so it holds under both the current parse (grep -v '^#') and #173's, where '#' starts a comment anywhere. Drop the claim that an inline '#' reaches apt-get. - templates/publish.yml: the release-asset note lists a third change, the tag pattern under the github-pages environment's deployment branches and tags, which otherwise reject a tag-triggered run. - CONTRIBUTING.md: the staged-release limits say that steps 2-3 run neither publish-gh-pages (the canary's publish.yml fires only on a publish* tag) nor setup-environment at the candidate ref, replacing the narrower release-asset bullet. - PLAN.md: #172 is marked open with the run the sizes come from; #144 needs a rebase before review. - CHANGELOG.md: the 2026.06 baseline is the full image's metapackage and the lean image's pin set, not something both images ship. - containers/README.md: the lean image carries the pinned science stack, so "Jupyter Book build tools only" loses "only". Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DwQrz9VbFrbAD7uh2LTgzh * docs: address the second review round of the #106/#109 sweep - Four more job examples call preview-netlify without a permissions block (MIGRATION-GUIDE's preview job, QUICK-REFERENCE's standard CI workflow, both ARCHITECTURE workflows). Each now grants contents: read and pull-requests: write (plus packages: read where it pulls the image), so the CHANGELOG line saying preview examples grant pull-requests: write is true of every one. - README's publish-gh-pages feature line no longer lists custom-domain support first; custom domains are set in Settings -> Pages. - MIGRATION-GUIDE's sample commit message says "conda environment caching": there is no separate pip cache. - PLAN.md's #105 and #107 rows cite the now-open #174 (draft) and #173. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DwQrz9VbFrbAD7uh2LTgzh * docs(templates): list make in the example latex-requirements.txt Copilot review on #175. The header says the file lists the TeX packages and build tools both images install, but omitted make, which both Dockerfiles install under "Build tools". It is needed, not incidental: jupyter-book 1.0.4.post1's pdflatex builder runs `make all-pdf` in the LaTeX output directory (jupyter_book/cli/main.py). Hosted Ubuntu runners ship make already, so on them this is a no-op install; on a minimal runner it is the difference between a PDF and a failed build. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DwQrz9VbFrbAD7uh2LTgzh * docs(plan): #170 has merged Refresh the #105 disposition row now that the README warning is on main. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DwQrz9VbFrbAD7uh2LTgzh * docs(containers): theme version is now 0.22.0 #162 moved both images to quantecon-book-theme 0.22.0 (full pins ==0.22.0, lean >=0.22.0) after this sweep set the full image's README to 0.21.0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DwQrz9VbFrbAD7uh2LTgzh * docs: add the .fr consumer row and refresh the current-release lines (#106, #109) lecture-python-programming.fr exact-pins preview-netlify and publish-gh-pages (with create-release-assets) at v0.11.1, moved there from v0.8.0 by Dependabot on 2026-09-23, so it joins the consumers table and the exact-pin count becomes eight call sites across six repos. README.md and copilot-instructions.md said the current release was v0.8.0; it is v0.11.1. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(plan): carry the .fr row into the consumer counts d1b8fb1 added lecture-python-programming.fr (two exact @v0.11.1 call sites, including publish-gh-pages). Two counts elsewhere in PLAN.md still predated it: the Last-updated line said all six exact pins, and the lecture-progress note had publish-gh-pages at 7/7 with five exact. They now read eight pins across six repos, and 8/8 with six exact. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DwQrz9VbFrbAD7uh2LTgzh * docs: lean image is 7.32 GB on disk after the #162 rebuild The first size report on main (run 35930060129, after #162 rebuilt both images with quantecon-book-theme 0.22.0) reads full 3.33 GB compressed / 8.60 GB on disk, unchanged, and lean 2.93 GB / 7.32 GB: the lean on-disk figure dropped by about 5 MB, enough to move the second decimal. The eleven sites that quoted 7.33 now say 7.32, and PLAN.md's #106 row cites that main run instead of the earlier branch dispatch. The ~15% (on disk) and ~12% (compressed) gaps still hold. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DwQrz9VbFrbAD7uh2LTgzh --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Matt McKay <[email protected]>
# Conflicts: # .github/workflows/test-containers-lectures.yml
|
Rebased onto current Per QEP-5: Fully rebuilding the lecture container matrix still cannot be exercised from a PR; per the issue acceptance criteria, that final runtime validation remains a maintainer |
quantecon-services
left a comment
There was a problem hiding this comment.
Thanks for picking this up, and for the quick turnaround on the rebase and the QEP-5 line. This does what #102 asked, item by item: the id / continue-on-error / outcome == 'failure' shape is right, the retry gets its own artifact name, lecture-python-programming is back in the matrix, and the doc corrections match the current repo name. All four repos use execute_notebooks: cache, so the design is sound.
There's one thing I'd like changed before merging, and it's the kind of thing you'd only find by running it: the retry as written doesn't re-execute the failed notebook, so a persistent failure comes back green. Details and a tested one-step fix are in the inline comment on the retry step.
Two smaller things, neither blocking:
- Timeouts. A retry re-renders the whole book and re-runs the failed notebooks. The
lecture-python.mystlegs already sit at the 120-minute ceiling (#141), so on those a retry is likely to turn afailureinto acancelled. The alert still fires, but theif: always()artifact upload doesn't run on a timeout, so the debugging output is lost. Worth knowing about when planning the post-mergeworkflow_dispatch; landing #141 first, or raising those legs' timeout here, would avoid it. - Seeing the flakes. After a successful retry the job is green and the first failure shows only in the annotations. A one-line step summary on the retry ("HTML build passed on retry") would give us a flake count for free. Optional.
Happy to re-review once the reset step is in.
Generated by Claude Code
| # A transient raw-GitHub 429 can fail one notebook while the successful | ||
| # executions remain in the Jupyter cache. Retry once so only the failed | ||
| # notebooks execute again; a second failure still fails the job. | ||
| - name: Retry HTML build after failure | ||
| if: steps.build-html.outcome == 'failure' | ||
| uses: ./actions-repo/build-lectures | ||
| with: | ||
| source-dir: lecture-repo/lectures | ||
| output-dir: lecture-repo | ||
| builder: html | ||
| upload-failure-reports: true | ||
| failure-artifact-name: reports-html-retry-${{ matrix.container }}-${{ matrix.repo.repo }} |
There was a problem hiding this comment.
This is the one thing I'd change before merging. The retry needs Sphinx to re-read the pages, or the failed notebook never runs again.
I tried it locally with the container's versions (jupyter-book 1.0.4post1, myst-nb 1.4.0, Sphinx 7.4.7): a two-notebook book where one notebook fails until a flag file exists, built with the action's -W --keep-going. The first attempt fails as expected. A second jb build over the same _build, with nothing changed, exits 0 without re-executing the failed notebook, and the page still shows the first attempt's traceback. With --keep-going, the first attempt finishes writing every doctree and the environment pickle before it exits 1, so on the retry Sphinx sees unchanged sources, skips re-reading them, and myst-nb never gets a chance to execute. So today a persistent failure (like the bayes_nonconj.md error currently in #159) would pass on retry.
One extra step between the two attempts fixes it, and keeps the notebook cache so only the failed notebooks re-run (verified: the passing notebook logs Using cached notebook, the failed one re-executes, exit 1 again while the cause persists, and a clean page once it clears):
- name: Reset the Sphinx environment for the retry
if: steps.build-html.outcome == 'failure'
shell: bash -l {0} # jb is only on PATH after conda activation
run: jb clean lecture-repo # empties _build except .jupyter_cachejb clean resolves _build under the path you give it, so lecture-repo matches the --path-output used above. The plain-shell equivalent is rm -rf lecture-repo/_build/.doctrees lecture-repo/_build/html/reports; I'd go with jb clean because it also drops the stale reports/ from the first attempt. Once that's in, the comment above ("only the failed notebooks execute again") becomes true.
Generated by Claude Code
|
Implemented the requested retry fix in 384e0e9. Between the initial HTML build and retry, the workflow now runs Validation: |
The #102 row names the PR and what it does (a failed HTML stage rebuilt once with --all, lecture-python-programming back in the matrix), notes #144 as the earlier open PR for the same issue, and the "Last updated" header gains a 2026-09-28 entry. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01MU3sPZhQdCPfzyX6rnaXdd
…store lecture-python-programming to the matrix (#203) * ci(lecture-validation): retry a failed HTML build once with --all; restore lecture-python-programming to the matrix Fixes #102. Several lectures fetch a dataset from raw GitHub in a hidden cell at build time, and with the matrix building several repos at once from shared runner IPs that fetch is sometimes refused with HTTP 429. It is transient (the same notebook passed on the other container in the same run), but nothing in the stack retries it, so one 429 failed the leg and, off the weekly workflow_run trigger, filed a CI-failure issue. The "Build HTML" step gets an id and continue-on-error, and a second attempt runs when its outcome is failure, with its own failure-artifact-name (a run cannot hold two artifacts of one name). Between the two, a step clears the first attempt's reports directory, whose contents are already in that attempt's artifact, and records the retry in the job summary so a green leg still shows it happened. The retry passes --all. A plain second `jb build -W --keep-going` after a failed one is not a retry: the saved Sphinx environment counts every page as up to date, so it reads nothing, re-executes nothing, re-emits no warning and exits 0 with the traceback still in the page. Measured on a fixture with jupyter-book 1.0.4post1 / myst-nb 1.4.0: a persistent execution failure and a warning-only failure both "passed" on a plain rebuild, and the failed notebook was not re-run. With --all every page is re-read and every warning re-checked, while execute_notebooks: cache still spares the notebooks that executed (the cached one stayed at one execution; only the failed one ran again), and a persistent failure fails the retry. lecture-python-programming returns to the matrix. The February 2026 rewrite (81e96ff) dropped it without a note, unlike lecture-jax, while CONTAINER-VALIDATION.md and TESTING.md went on describing four repos. Those docs now list it under its current name, and CONTAINER-VALIDATION describes the retry. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01MU3sPZhQdCPfzyX6rnaXdd * docs(plan): record #203 as #102's fix The #102 row names the PR and what it does (a failed HTML stage rebuilt once with --all, lecture-python-programming back in the matrix), notes #144 as the earlier open PR for the same issue, and the "Last updated" header gains a 2026-09-28 entry. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01MU3sPZhQdCPfzyX6rnaXdd --------- Co-authored-by: Claude <[email protected]>
|
Hi @tasodoufu, thanks again for this PR and for the quick turnaround on both rounds of review. An update on where #102 landed: it was closed today by #203, which took an independent run at the same issue and arrived at the same design as this branch. Same #203 went in first because it also carried the CHANGELOG and PLAN.md updates this repo keeps per PR, a job-summary line so a leg that only passes on retry stays visible (the optional ask from the review here), and a green harness run, which a fork PR can't get without a maintainer approving the workflow. Nothing in this branch was wrong. With #102 closed there is nothing left for this PR to deliver, so it can be closed. Thanks for getting there first, and for the care in the follow-ups. The one thing that remains for either branch, a maintainer Generated by Claude Code |
|
One more note, meant for next time rather than as a mark against this PR, which was correct work. QuantEcon's Code of AI Use (QEP-5) asks maintainers to say so when something in it was missed, so here are the two things to carry into future pull requests:
AI-assisted contributions are welcome here, and this one was handled well through review. Thanks again. Generated by Claude Code |
… it (#214) * docs(plan): record #102 as closed by #203, and the run that exercised it The #102 row still said to review #203 and to validate it with a maintainer dispatch after merge, and called #144 open. #203 merged on 2026-09-28 and closed #102, and #144 was closed unmerged. The weekly matrix run the same day (36370003884) did the validation the row asked for. Six of eight legs passed, lecture-python-programming on both images among them. Both lecture-python.myst legs failed the retry on bayes_nonconj alone, which is the retry working as intended: a persistent failure still fails the leg. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SUGTRULyyM87pug2MckrXo * docs(plan): cite the lecture-side fix, not the CI alert, in the #102 row The row said bayes_nonconj's fix belongs in lecture-python.myst and then cited #159, which is this repo's CI-failure alert for the red matrix, not that fix. It now links lecture-python.myst#1065 for the fix and names #159 as what tracks the red matrix. Raised in Copilot's review. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SUGTRULyyM87pug2MckrXo --------- Co-authored-by: Claude <[email protected]>
What Problem This Solves
The lecture container matrix can fail non-deterministically when concurrent builds receive a transient HTTP 429 from raw GitHub. The matrix also no longer included
lecture-python-programming, while the validation documentation still described four repositories.Fixes #102.
Why This Change Was Made
continue-on-error, so a persistent failure still fails the matrix job.lecture-python-programmingto the matrix and correct its repository name in the validation and testing documentation.User Impact
A single transient raw-GitHub rate-limit response no longer fails a lecture matrix leg. Persistent build failures remain visible, and all four documented lecture repositories are covered again.
Evidence
actionlint .github/workflows/test-containers-lectures.yml— passedgit diff --check— passedThe full container matrix cannot be exercised by a PR because this workflow runs only for
workflow_runandworkflow_dispatch. Per the issue acceptance criteria, final runtime validation requires a maintainerworkflow_dispatchafter merge.Assisted-by
Assisted-by: Claude Code (Claude Fable 5.1)