Skip to content

Commit 619da6c

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 ceec881 commit 619da6c

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
@@ -36,18 +36,16 @@ jobs:
3636
pip install numpyro
3737
python scripts/test-jax-install.py
3838
- name: Install latex dependencies
39+
timeout-minutes: 30
3940
run: |
40-
sudo apt-get -qq update
41-
sudo apt-get install -y \
42-
texlive-latex-recommended \
43-
texlive-latex-extra \
44-
texlive-fonts-recommended \
45-
texlive-fonts-extra \
46-
texlive-xetex \
47-
latexmk \
48-
xindy \
49-
dvipng \
50-
cm-super
41+
# Retried with a per-attempt timeout: a stalled Ubuntu mirror otherwise
42+
# hangs this step for hours (two 358-minute hangs on 2026-08-18).
43+
pkgs="texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-xetex latexmk xindy dvipng cm-super"
44+
for attempt in 1 2 3; do
45+
timeout 9m sudo bash -c "apt-get -qq update && apt-get install -y $pkgs" && break
46+
if [ "$attempt" = 3 ]; then echo "apt-get failed after 3 attempts"; exit 1; fi
47+
echo "apt-get attempt $attempt failed; retrying in 30s"; sleep 30
48+
done
5149
- name: Display Conda Environment Versions
5250
shell: bash -l {0}
5351
run: conda list

.github/workflows/publish.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,16 @@ jobs:
5252
run: |
5353
nvidia-smi
5454
- name: Install latex dependencies
55+
timeout-minutes: 30
5556
run: |
56-
sudo apt-get -qq update
57-
sudo apt-get install -y \
58-
texlive-latex-recommended \
59-
texlive-latex-extra \
60-
texlive-fonts-recommended \
61-
texlive-fonts-extra \
62-
texlive-xetex \
63-
latexmk \
64-
xindy \
65-
dvipng \
66-
cm-super
57+
# Retried with a per-attempt timeout: a stalled Ubuntu mirror otherwise
58+
# hangs this step for hours (two 358-minute hangs on 2026-08-18).
59+
pkgs="texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-xetex latexmk xindy dvipng cm-super"
60+
for attempt in 1 2 3; do
61+
timeout 9m sudo bash -c "apt-get -qq update && apt-get install -y $pkgs" && break
62+
if [ "$attempt" = 3 ]; then echo "apt-get failed after 3 attempts"; exit 1; fi
63+
echo "apt-get attempt $attempt failed; retrying in 30s"; sleep 30
64+
done
6765
- name: Display Conda Environment Versions
6866
shell: bash -l {0}
6967
run: conda list

0 commit comments

Comments
 (0)