Cache the TeX Live apt install: a slow Ubuntu mirror stalls PDF builds for hours
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Start by reading the setup-environment action and its install-latex path, then inspect the repository’s action definitions for how a standalone setup-latex action could be shared. The issue proposes caching .deb archives with actions/cache, but leaves cache-hit installation and skipping apt-get update to be tested. Done means a reusable cached install path serves inline steps and setup-environment, with a bounded timeout and retries on cache misses.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Every lecture build that makes the PDF downloads TeX Live from the Ubuntu archive on every run. For lecture-python-advanced.myst that is 138 packages and 1013 MB. It usually takes a minute or two, but it depends entirely on the speed of the mirror the runner is given, and when that mirror is slow, the build stalls for hours without failing.
What happened
On 2026-10-25 the publish-2026oct25 publish of lecture-python-advanced.myst (run 40234381123) sat in "Install latex dependencies":
- Attempt 1 downloaded 82 MB in 23 minutes from
azure.archive.ubuntu.com, about 60 KB/s. At that rate the full 1013 MB would have taken about 4.5 hours, close to the 6-hour job limit. It was cancelled by hand. - Attempt 2 was still in the same step 27 minutes later.
- The PR's CI run for the same commit, an hour earlier, downloaded the same 1013 MB in about a minute.
Nothing errors, so nothing alerts: the job simply runs on, and someone has to notice.
Who is affected
setup-environmentwithinstall-latex: 'true'runs an uncachedapt-get updateandapt-get install.- No lecture repo found by code search uses that input. Instead, about 17 repos inline their own
sudo apt-get install texlive-…step, usually inci.yml,cache.ymlandpublish.yml. They include lecture-python-advanced.myst, lecture-python-intro, lecture-python-programming, lecture-julia.myst, lecture-dle, lecture-dynamics, lecture-eqm, lecture-dps, lecture-tools-techniques, lecture-econometrics-machine-learning, lecture-python-programming.fa, lecture-intro.zh-cn, lecture-python.zh-cn, continuous_time_mcs and dse_2023.
A fix therefore needs to be easy for those inline steps to adopt, not only for repos that already use setup-environment.
Proposal
Cache the downloaded .deb archives with actions/cache, and install from the cache.
- Key. The runner image (
ImageOSandImageVersion) plus a hash of the package list, with arestore-keysfallback on the image prefix so that a changed list re-downloads only what changed. Acache-versioninput lets a repo force a fresh cache. - Miss. Download into a workspace directory with
apt-get install --download-only -o Dir::Cache::archives=<dir>, and hand the directory to the runner user so thatactions/cachecan save it. - Hit. Install from that directory, so that no mirror is contacted for the archives. Whether
apt-get updatecan also be skipped on a hit, for example by installing the cached files directly withapt-get install ./*.deb, needs testing, sinceupdatealso goes to the mirror. - Cache .debs, not installed files. dpkg still runs TeX Live's maintainer scripts (
fmtutil,mktexlsr, font maps), so the result is the same as today's install. Actions that cache the installed files instead, such asawalsh128/cache-apt-pkgs-action, skip those scripts, which is fragile for TeX Live. - Guard the miss. Add a
timeout-minuteson the step and-o Acquire::Retries=3, so that a slow mirror on a cache miss fails loudly in minutes rather than running for hours.
Delivery. I suggest a small standalone setup-latex action, which takes a package list or file plus cache-version. An inline repo can then switch with a one-step change, and setup-environment's install-latex path can call the same action internally.
Cost. About 1 GB of cache per repo, against the default 10 GB per-repository limit. Caches are per repository, so each repo pays one full download after each runner-image update.
Alternative already available
The QuantEcon images (ghcr.io/quantecon/quantecon-build, ghcr.io/quantecon/quantecon) already include TeX Live. They pull about 2.9 GB from GHCR, a different network path from the Ubuntu mirrors. Repos that move to containers sidestep this problem, but that is a larger migration than adopting a cached install step.
🤖 Generated with Claude Code
- Lingua principale
- Shell
- Stelle
- 0
- Fork
- 1
- Merge medio
- 20h 3m
- PR unite (30g)
- 48
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di QuantEcon/actions
-
low-priority
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
bug infrastructure
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di QuantEcon/actions
Issue simili
-
ci: Simplify e2e base image buildForse già presa @nealrichardson l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Page request: clang-replApertahelp wanted new command
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
tldr-pages/tldr#25111 ·
I maintainer di solito rispondono entro 1 giorno
-
chore
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
alunduil/alunduil-chezmoi#1170 ·
I maintainer di solito rispondono entro 1 giorno
-
package-update
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
fabriziosalmi/secure-proxy-manager#619 ·
I maintainer di solito rispondono entro 1 giorno