Skip to content

Commit 10b6288

Browse files
committed
CI: add timeout and retry to apt-get install steps
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.
1 parent cbe2cb1 commit 10b6288

2 files changed

Lines changed: 18 additions & 22 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,16 @@ jobs:
2626
# and does not upgrade.
2727
pip install "jax==0.11.0"
2828
- name: Install latex dependencies
29+
timeout-minutes: 30
2930
run: |
30-
sudo apt-get -qq update
31-
sudo apt-get install -y \
32-
texlive-latex-recommended \
33-
texlive-latex-extra \
34-
texlive-fonts-recommended \
35-
texlive-fonts-extra \
36-
texlive-xetex \
37-
latexmk \
38-
xindy \
39-
dvipng \
40-
cm-super
31+
# Retried with a per-attempt timeout: a stalled Ubuntu mirror otherwise
32+
# hangs this step for hours (two 358-minute hangs on 2026-08-18).
33+
pkgs="texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-xetex latexmk xindy dvipng cm-super"
34+
for attempt in 1 2 3; do
35+
timeout 9m sudo bash -c "apt-get -qq update && apt-get install -y $pkgs" && break
36+
if [ "$attempt" = 3 ]; then echo "apt-get failed after 3 attempts"; exit 1; fi
37+
echo "apt-get attempt $attempt failed; retrying in 30s"; sleep 30
38+
done
4139
- name: Display Conda Environment Versions
4240
shell: bash -l {0}
4341
run: conda list

.github/workflows/publish.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,16 @@ jobs:
3131
# and does not upgrade.
3232
pip install "jax==0.11.0"
3333
- name: Install latex dependencies
34+
timeout-minutes: 30
3435
run: |
35-
sudo apt-get -qq update
36-
sudo apt-get install -y \
37-
texlive-latex-recommended \
38-
texlive-latex-extra \
39-
texlive-fonts-recommended \
40-
texlive-fonts-extra \
41-
texlive-xetex \
42-
latexmk \
43-
xindy \
44-
dvipng \
45-
cm-super
36+
# Retried with a per-attempt timeout: a stalled Ubuntu mirror otherwise
37+
# hangs this step for hours (two 358-minute hangs on 2026-08-18).
38+
pkgs="texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-xetex latexmk xindy dvipng cm-super"
39+
for attempt in 1 2 3; do
40+
timeout 9m sudo bash -c "apt-get -qq update && apt-get install -y $pkgs" && break
41+
if [ "$attempt" = 3 ]; then echo "apt-get failed after 3 attempts"; exit 1; fi
42+
echo "apt-get attempt $attempt failed; retrying in 30s"; sleep 30
43+
done
4644
- name: Display Conda Environment Versions
4745
shell: bash -l {0}
4846
run: conda list

0 commit comments

Comments
 (0)