Skip to content

ci: install ffmpeg through the GitHub API asset route with a cache - #7401

Merged
miguel-heygen merged 3 commits into
mainfrom
ci/ffmpeg-api-asset-route
Nov 8, 2026
Merged

miguel-heygen merged 3 commits into
mainfrom
ci/ffmpeg-api-asset-route

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

What

The Linux jobs fetch their pinned ffmpeg through the GitHub API asset route instead of github.com/.../releases/download, check its sha256, and cache the tarball keyed on that sha256.

Why

On 2026-11-08 about 14 jobs on one PR died in setup with curl: (22) The requested URL returned error: 504 from the release download URL, and a rerun 40 minutes later failed the same way.

fails without the fix: SDK: unit + contract + smoke (setup 504 from github.com releases/download, https://github.com/heygen-com/hyperframes/actions/runs/42470531186/job/128700038635); also Test (runtime), Test (cli 1/2), CLI smoke (required) on #7398 at 6aad021.

Related work

Unblocks the red checks on #7398, which are not caused by its diff.

How

  • install-ffmpeg-linux: looks up the asset id for the pinned file name in the pinned release, downloads it with gh api (Accept: application/octet-stream), retries up to three times with a growing pause, and verifies the same sha256 as before. The release-url input stays the single pin, so the Dockerfile pins still match.
  • actions/cache (same pinned action as the other workflows) keeps the tarball under ffmpeg-linux-<sha256>; a hit skips the download.
  • The SDK job failed on the same 504 from a second download: ffmpeg-static's postinstall fetches from releases unless a file exists at FFMPEG_BIN. catalog-payloads, sdk-tests and studio-timeline-viewport were the three Linux ci.yml jobs that ran the install without the ffmpeg steps the others use; they now run install-ffmpeg-linux and prepare-ffmpeg-bin first. The catalog-publish workflow and the multi-OS npx-shim job still download it (a release path and a Windows/macOS matrix).
  • Not changed: oven-sh/setup-bun also fetches from releases and had one 504 in the same window; it is an external action, so it needs its own change.
  • Searched for another ffmpeg download in CI (git grep -n "releases/download" .github): only this action.

Test plan

  • Ran the download block on a Mac with the real token: 140146232 bytes, sha256 matches the pin.
  • CI on this PR installs ffmpeg through the new route (a cache miss, then a hit on the next run).
  • Comments say why, not what

Size

Size: a lone CI fix for the GitHub release download outage; nothing open can carry it.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 98 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

Unstable (2)

  • seqrepeat-none-pct-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.04, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.04, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.04, renderKey -, undo true, teleport true
  • seqrotatenudge-none-center-r0-nested-z100: tracking 0.02, pressJump 0, drop 0, reload 3.03, render 0.04, renderKey -, undo false, teleport true / tracking 0.02, pressJump 0, drop 0, reload 0, render 0.05, renderKey -, undo true, teleport true / tracking 0.02, pressJump 0, drop 0, reload 0, render 0.05, renderKey -, undo true, teleport true

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES · 1 blocker · 0 important · 1 nit · head c1d49a20

  • blocker (PR body): this is a fix PR, so the body needs a fails without the fix: line naming the check that fails without it. For example: fails without the fix: SDK: unit + contract + smoke (setup 504 from releases/download, run <link>). Adding that line clears this; I found nothing wrong in the code.
Scope

Read the full diff (install-ffmpeg-linux/action.yml, ci.yml). The cache key is the pinned sha256, and the restored file is hashed again before use, so a poisoned cache can't get through. A failed id lookup or a partial download falls through to a retry, and the loop ends at the bounded exit. Every caller uses the default release-url, so the github.com sed parse holds. The callers run with contents: read on a public repo, and GITHUB_TOKEN can read the BtbN public release. No caller uses container:, so gh is on PATH. CI on this head is green, and the SDK job log shows Cache hit for: ffmpeg-linux-26d2ecd0… followed by a working ffmpeg -version.

}
for attempt in 1 2 3 4; do
verified && break
[ "$attempt" = 4 ] && { echo "ffmpeg download failed four times" >&2; exit 1; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: fetch runs at most three times (attempts 1–3), because attempt 4 only re-checks the hash. The message says "four times", which will mislead whoever reads a failed setup log.

Suggested change
[ "$attempt" = 4 ] && { echo "ffmpeg download failed four times" >&2; exit 1; }
[ "$attempt" = 4 ] && { echo "ffmpeg download failed three times" >&2; exit 1; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Fixed in d188d5f

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE · 2 resolved, 0 open, 0 new · c1d49a20 → d188d5f6

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 074de9d Nov 8, 2026
127 checks passed
@miguel-heygen
miguel-heygen deleted the ci/ffmpeg-api-asset-route branch November 8, 2026 11:42
This was referenced Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant