CI: add timeout and retry to apt-get install steps - #162
Conversation
Bare `sudo apt-get install -y` with no `timeout-minutes` and no retry let a stalled Ubuntu mirror hang CI for hours — two 358-minute hangs on 2026-08-18 across two edition repos ten minutes apart, and four more hangs on 2026-08-19 each cleared only by cancel-and-rerun. Every apt-installing step now carries a step-level `timeout-minutes` and runs up to three attempts with a per-attempt `timeout`, so a stalled fetch fails fast and a transient mirror outage is ridden out rather than burning the job. Package lists are unchanged. Tracked in QuantEcon/project-translation#43.
✅ Deploy Preview for majestic-griffin-10b166 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR hardens GitHub Actions workflows against apt-get install hangs by adding step-level timeouts and retry logic around LaTeX package installation, preventing CI jobs from being stalled for hours due to transient Ubuntu mirror issues.
Changes:
- Adds
timeout-minutes: 30to the “Install latex dependencies” step. - Replaces a single
apt-get update && apt-get installwith a 3-attempt retry loop, including a per-attempttimeoutand a short backoff.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/ci.yml | Adds a 30-minute step timeout and retry-with-timeout loop around LaTeX apt installs for PR CI runs. |
| .github/workflows/publish.yml | Adds the same 30-minute step timeout and retry-with-timeout loop around LaTeX apt installs for publish runs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…er-attempt timeouts (4m/14m) Addresses Copilot review on QuantEcon/lecture-python.zh-cn#263: the cache.yml graphviz step was missed by a name match, and three 3m/9m attempts could never let a slow-but-progressing install finish. Now two attempts at 4m (graphviz) / 14m (texlive) inside the unchanged 10/30-minute step budgets.
…-get Addresses Copilot review on QuantEcon/lecture-intro.zh-cn#301: with timeout wrapping sudo, a timed-out attempt terminated sudo and the bash -c shell but could orphan apt-get holding the dpkg lock, making the retry block instead of retry. timeout is now the direct parent of each apt-get (inside sudo, -k 30s escalation): update 1m/2m, install 3m/12m for graphviz/texlive. Step budgets unchanged.
|
Closing unmerged (@mmcky, 2026-08-21): the apt hangs are accepted as a known flake for now rather than investing further here — the QuantEcon/actions container templates remove the apt step entirely, and that deployment is the medium-term fix. Branch left in place for reference; tracked in QuantEcon/project-translation#43. |
Bare
sudo apt-get install -ywith notimeout-minutesand no retry lets a stalled Ubuntu mirror hang CI for hours: two 358-minute hangs on 2026-08-18 across two edition repos ten minutes apart (a mirror outage), four more hangs on 2026-08-19 (Install latex dependencies77/15/16 min,Graphics Support21 min) each cleared only by cancel-and-rerun, and a 59-minute slow-but-green install on 2026-08-20.This PR hardens every apt-installing step in the workflows that carry one (
ci.yml,cache.yml,publish.ymlwhere present):timeout-minutes(10 for graphviz, 30 for the texlive set), so a hang can no longer take the six-hour job limit;timeout(3m / 9m) and a 30-second pause, so a transient mirror outage is ridden out rather than failing the build — a timeout alone would only turn a six-hour hang into a fast red build.Package lists are unchanged. The apt steps are edition-local (the shared
QuantEcon/actions/templatescarry none), so this lands per repo. Part of the five-repo sweep tracked in QuantEcon/project-translation#43.