Skip to content

ci(docs): stop installing an unused TeX stack; bound the docs job - #358

Merged
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:fix/docs-build-hang
Aug 7, 2026
Merged

ci(docs): stop installing an unused TeX stack; bound the docs job#358
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:fix/docs-build-hang

Conversation

@thodson-usgs

Copy link
Copy Markdown
Collaborator

Summary

The docs build on main ran 150 minutes instead of its usual ~6. It was not a code regression and not the notebooks.

The commit it ran on (#356) touched only CI config and pyproject.tomlgit diff f7c248b7 deba1331 -- docs/ demos/ dataretrieval/ is empty, so the build inputs were byte-identical to the run before it, which took 6m28s.

Timing the two runs against each other localizes it precisely:

phase fast run (6m25s) hung run (150m)
apt download (127 pkgs) 0.3 min 143.8 min
notebook execution 3.7 min 3.7 min

Notebook execution was identical. The entire difference was apt fetching the same 314 MB at an effective 37 KB/s off a slow azure.archive.ubuntu.com mirror. Single packages stalled for over 20 minutes each (mupdf-tools 23.6 min, openjdk-21-jre-headless 22.2 min).

What this changes

1. Drop the TeX stack (~266 MB of the 314 MB). An HTML build never reaches it — no math extension is configured in docs/source/conf.py (neither mathjax nor imgmath), and nothing renders math to images. latexmk, texlive-*, and dvipng were downloaded and never executed, yet accounted for 5 of the 6 slowest single-package waits. This removes the tail risk rather than trimming it: with pandoc alone there is no longer a large download to be slow.

pandoc is kept — nbsphinx shells out to it for notebook markdown cells, and the build fails with PandocMissing without it (verified).

2. Add timeout-minutes: 30. The next slow mirror will find whatever is left, and the default is 6 hours. This matters more than it appears: runs are serialized on the ref (concurrency, cancel-in-progress: false), so an unbounded run doesn't just lose its own docs — it holds the queue for every commit behind it. That is why this surfaced as "docs are stuck on main" rather than as one slow run. A cell-level nbsphinx_timeout was considered and deliberately left out, since notebook execution was never the problem here.

Test plan

  • sphinx-build -b html with TeX binaries off PATHbuild succeeded
  • All 44 non-notebook HTML pages byte-identical to a build with TeX present (examples/ pages differ only because notebooks re-execute against live data)
  • Zero math*.png in either build — confirms nothing was rendering math via LaTeX
  • Confirmed pandoc is genuinely required (removing it fails with PandocMissing)
  • Workflow YAML parses; executed commands contain no texlive/latexmk/dvipng
  • Confirm this PR's own docs run lands in the normal ~5 min range

🤖 Generated with Claude Code

The docs build on main ran 150 minutes instead of its usual 6. Nothing in the
build got slower: the commit it ran on (DOI-USGS#356) touched only CI config, and
timing the two runs against each other shows notebook execution took 3.7 min in
both. The whole 144 min difference was `apt` fetching the same 127 packages --
314 MB at an effective 37 KB/s off a slow Azure mirror.

Most of that download is a TeX stack an HTML build never reaches. No math
extension is configured and nothing renders math to images, so latexmk,
texlive-*, and dvipng -- ~266 MB, and 5 of the 6 slowest single-package waits
in the bad run -- were downloaded and never executed. Dropping them removes the
tail risk rather than reducing it: with pandoc alone (which nbsphinx does shell
out to, and without which the build fails) there is no longer a large download
to be slow. Verified by building with the TeX binaries off PATH: it succeeds,
and all 44 non-notebook HTML pages are byte-identical to a build with them
present.

A bound belongs here regardless, since the next slow mirror will find whatever
is left. `timeout-minutes: 30` is far under the 6 h default and well over a
healthy build. It matters more than it looks: runs are serialized on the ref, so
an unbounded run doesn't just lose its own docs, it holds the queue for every
commit behind it -- which is why this surfaced as "docs are stuck on main"
rather than as one slow run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@thodson-usgs
thodson-usgs marked this pull request as ready for review August 7, 2026 18:26
@thodson-usgs
thodson-usgs merged commit 97e22e2 into DOI-USGS:main Aug 7, 2026
11 checks passed
@thodson-usgs
thodson-usgs deleted the fix/docs-build-hang branch August 7, 2026 18:26
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.

1 participant