Skip to content

Commit 068b777

Browse files
abrichrclaude
andauthored
ci: prefer the canonical Ubuntu archive for the paper TeX install (#374)
My PR #373 bounded this step at 10 minutes but did not address why it hangs. Main then went red at 7860278: the Azure mirror was failing, apt spent the whole budget retrying it, and the bound fired. The bound behaved correctly -- 10 minutes instead of 3h11m -- but a red main is not a fix. The hosted runner resolves its mirror through /etc/apt/apt-mirrors.txt, which points at azure.archive.ubuntu.com. Point it at the canonical archive before apt-get update, and retry update three times with backoff. A mirror fault now costs seconds, not the whole budget, and a genuine outage fails loudly with a clear message rather than a timeout. The package list and install flags are unchanged. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 7860278 commit 068b777

2 files changed

Lines changed: 30 additions & 5 deletions

File tree

.github/workflows/paper.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,35 @@ jobs:
3232
run: python paper/check_artifacts.py
3333
- name: Install TeX
3434
timeout-minutes: 10
35-
run: >-
36-
sudo apt-get update && sudo apt-get install -y
37-
latexmk texlive-latex-extra texlive-pictures texlive-science
38-
texlive-latex-recommended texlive-fonts-recommended
35+
run: |
36+
set -uo pipefail
37+
# The hosted runner resolves its Ubuntu mirror through
38+
# /etc/apt/apt-mirrors.txt, which points at azure.archive.ubuntu.com.
39+
# That mirror fails intermittently, and every failure costs minutes of
40+
# apt retries before the canonical archive is tried. Prefer the
41+
# canonical archive up front. Keep this best-effort: if the file is
42+
# absent or already canonical, the run continues unchanged.
43+
sudo sed -i \
44+
's|http://azure.archive.ubuntu.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' \
45+
/etc/apt/apt-mirrors.txt 2>/dev/null || true
46+
# A transient mirror fault must not fail the paper build outright.
47+
update_ok=""
48+
for attempt in 1 2 3; do
49+
if sudo apt-get update; then
50+
update_ok=1
51+
break
52+
fi
53+
echo "::warning::apt-get update failed (attempt ${attempt}/3); retrying"
54+
sleep $((attempt * 10))
55+
done
56+
if [ -z "$update_ok" ]; then
57+
echo "::error::apt-get update failed three times; the Ubuntu mirror is unreachable"
58+
exit 1
59+
fi
60+
set -e
61+
sudo apt-get install -y \
62+
latexmk texlive-latex-extra texlive-pictures texlive-science \
63+
texlive-latex-recommended texlive-fonts-recommended
3964
- name: Build PDFs (full report + workshop condensation)
4065
timeout-minutes: 10
4166
run: make -C paper

public-artifacts.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
},
110110
{
111111
"path": ".github/workflows/paper.yml",
112-
"sha256": "4bd7904c18b1c29926f0fc6eff21a7401b8f3c41aa239622fba8f2dcbc362790"
112+
"sha256": "6446edb96cddea116abe931611360122d8c4e3cba32e55c5ceab1f1e5209302a"
113113
},
114114
{
115115
"path": ".github/workflows/quickstart-lifecycle.yml",

0 commit comments

Comments
 (0)