Skip to content

Commit 91b2dfe

Browse files
committed
ci: bound the ffmpeg apt fetch so a stalled mirror costs a retry, not the job
Hosted runners intermittently stall on an apt mirror, and an unbounded apt-get inherits the whole job budget. The producer integration lane normally finishes in ~11 minutes against a 20 minute cap; on a stalled fetch it ran to the cap and failed. Same step, same shape, reproduces on main's tip — it is not specific to any one PR. The cost is not one red check. On the run that prompted this, four went red off that single step: the two jobs that install ffmpeg, plus a Test gate and a preview-regression gate that both fail closed when their dependency does not succeed. So a mirror stall reads as a producer defect and a preview defect. Each attempt is now bounded and retried three times, and the five workflows that installed ffmpeg share one action instead of five copies of the command. Deliberately still apt: caching the binary would strip it from the shared libraries it links against, and switching to a static build would change the ffmpeg under the producer's output comparisons. Neither belongs in a fix for a network stall.
1 parent b3c43e2 commit 91b2dfe

5 files changed

Lines changed: 37 additions & 11 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Install ffmpeg (Linux)
2+
description: >-
3+
Install ffmpeg from apt with a bounded, retried fetch.
4+
5+
Hosted runners intermittently stall on an apt mirror, and an unbounded
6+
`apt-get` inherits the whole job budget: the producer integration lane
7+
normally finishes in ~11 minutes against a 20 minute cap, so one stalled
8+
fetch took the job to the cap and failed it. Three jobs then went red off
9+
that single step, because the gates downstream fail closed on a skip.
10+
11+
Bounding each attempt turns a stalled mirror into a retry that costs
12+
seconds rather than the job. This deliberately keeps apt as the source, so
13+
the ffmpeg build under the producer's output comparisons does not change.
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Install ffmpeg
19+
shell: bash
20+
run: |
21+
set -euo pipefail
22+
for attempt in 1 2 3; do
23+
if sudo timeout 120 apt-get update -qq \
24+
&& sudo timeout 300 apt-get install -y --no-install-recommends ffmpeg; then
25+
ffmpeg -version | head -1
26+
exit 0
27+
fi
28+
echo "::warning::apt attempt ${attempt} did not complete; retrying"
29+
sleep $((attempt * 10))
30+
done
31+
echo "::error::ffmpeg install did not complete after 3 bounded attempts"
32+
exit 1

.github/workflows/catalog-previews.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
# file copy), so the job never needed it and ubuntu-latest does not ship
6767
# it.
6868
- name: Install ffmpeg
69-
run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends ffmpeg
69+
uses: ./.github/actions/install-ffmpeg-linux
7070

7171
- name: Render changed block/component previews
7272
env:

.github/workflows/ci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,7 @@ jobs:
322322
node-version: 22
323323
- name: Install FFmpeg for integration tests
324324
if: matrix.lane == 'integration'
325-
run: |
326-
sudo apt-get update -qq
327-
sudo apt-get install -y --no-install-recommends ffmpeg
325+
uses: ./.github/actions/install-ffmpeg-linux
328326
- uses: ./.github/actions/prepare-ffmpeg-bin
329327
- run: bash scripts/ci/install-workspace-dependencies.sh
330328
- run: bun run --filter '@hyperframes/{parsers,lint,studio-server}' build
@@ -733,9 +731,7 @@ jobs:
733731
with:
734732
node-version: 22
735733
- name: Install FFmpeg
736-
run: |
737-
sudo apt-get update
738-
sudo apt-get install -y ffmpeg
734+
uses: ./.github/actions/install-ffmpeg-linux
739735
- uses: ./.github/actions/prepare-ffmpeg-bin
740736
- name: Install dependencies
741737
run: bash scripts/ci/install-workspace-dependencies.sh

.github/workflows/player-perf.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ jobs:
105105
# to just install it here so the shard never trips on infra.
106106
- name: Install ffmpeg (parity shard only)
107107
if: matrix.shard == 'parity'
108-
run: |
109-
sudo apt-get update
110-
sudo apt-get install -y --no-install-recommends ffmpeg
108+
uses: ./.github/actions/install-ffmpeg-linux
111109
ffmpeg -version | head -n 1
112110

113111
- name: Run player perf — ${{ matrix.shard }} (measure mode)

.github/workflows/preview-regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
run: bun run --cwd packages/producer parity:fixtures:ci
9494

9595
- name: Install ffmpeg
96-
run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends ffmpeg
96+
uses: ./.github/actions/install-ffmpeg-linux
9797

9898
- name: Set up Chrome
9999
id: setup-chrome

0 commit comments

Comments
 (0)