fix(infra): pin hyperframes ffmpeg by registry digest, not a rolling release asset - #1633
Conversation
…release asset The dev deploy failed building the HyperframesRender Lambda asset: curl: (22) The requested URL returned error: 404 https://github.com/BtbN/FFmpeg-Builds/releases/download/ autobuild-2026-07-15-14-01/ffmpeg-n7.1.5-2-g998de74adf-linux64-gpl-7.1.tar.xz The comment above that block asserted the autobuild tag was immutable. It is not, and that assumption is the whole bug. BtbN retains only a rolling window of autobuild releases and publishes no permanent version tags at all -- confirmed against the GitHub releases API, which returns `latest` plus `autobuild-*` and nothing else across every page. At the time of this fix the oldest surviving autobuild was eight days old, so the July 15 pin had simply been pruned. Any autobuild pin rots on a timer; re-pinning to a newer one would only reset the clock and break a deploy again in a few weeks. Replaced the download + SHA256 check with a COPY --from a registry image pinned by digest: mwader/static-ffmpeg:7.1.1-amd64@sha256:6769881cc02c80d33e387750a8e144d162adfab2775e934dd97899261dda3a0c A registry digest is a content address that does not expire, so it keeps the verification strength the SHA256 provided while removing the expiry. The tag is kept alongside the digest for readability; the digest is what resolves. This also deletes the curl/sha256sum/tar/chmod layer entirely -- COPY preserves the source mode, so nothing needs chmod. The replacement fits the requirement better than the original. It is built --disable-shared --enable-static with libx264/libx265, so nothing is dynamically loaded at all -- not even glibc, which was BtbN's one remaining runtime dependency. The reason this block exists is that Debian's ffmpeg dynamically loads 40+ shared libraries and fails hyperframes' preflight inside the Lambda sandbox; a fully static binary has no such step. Version note: 7.1.1 is the newest 7.1.x this publisher ships, a small patch step back from BtbN's n7.1.5. Deliberate -- holding the ffmpeg 7 line that hyperframes was validated against is lower risk in a deploy fix than moving to 8.x or 9.x. Also corrected the sentence above that still described the BtbN build's linkage, which no longer describes what is copied in. Verified by building the real image for linux/amd64 from the infra/ context, not by reasoning about it: - the previously failing layer now passes, and the build completes - /opt/ffmpeg/ffmpeg and /opt/ffmpeg/ffprobe both report 7.1.1 in the Debian base image (a musl-static binary on glibc is exactly the combination worth proving, so the build keeps a -version smoke check) - a real libx264 encode inside the built image produces a valid MP4; ffprobe reports h264,320,240 - both binaries land executable without an explicit chmod No CDK change: HyperframesRenderFunction passes no docker buildArgs, and nothing else in the repository referenced FFMPEG_BUILD / FFMPEG_ASSET / FFMPEG_SHA256.
ReviewSolid, well-scoped fix — root cause (BtbN publishes no permanent tags, only a rolling ~2-3 week autobuild window) is correctly diagnosed and the digest pin is the right fix for the actual failure mode (link rot), not a band-aid re-pin that just resets the clock. Strengths
Things worth a second look (non-blocking)
Other categories
Nice, tightly-scoped fix for an active deploy blocker. The two non-blocking notes above are about hardening the next failure mode, not objections to merging this. |
Review asked for the trust decision to be stated as explicitly as the ffmpeg-version tradeoff already was. Two points recorded where the next auditor will look: - mwader/static-ffmpeg is a third-party, single-maintainer image. The digest pin is what makes that acceptable: the exact bytes verified in this PR are the only bytes a later build can copy, so content cannot drift even if the tag moves. - It adds no new availability domain. The base image already comes from Docker Hub, so a Hub outage or an unauthenticated pull-rate limit would have failed this build before this change too — the reviewer's rate-limit concern is real but pre-existing, not introduced here. Comment-only.
Review: fix(infra): pin hyperframes ffmpeg by registry digest, not a rolling release assetReviewed the diff to SummaryClean, well-justified fix. Replaces the BtbN autobuild-tag download (which has no permanent tags and rotates out after a few weeks — the actual cause of the dev deploy 404) with Code quality
Bugs / correctnessNone found. The new PerformanceSlight improvement: removes the curl download + sha256sum + tar -xJ + chmod layer entirely in favor of a single Security
Test coverage
Nice fix overall — the root-cause analysis and the decision to move to digest pinning are both correct, and the tradeoffs are well documented for future readers. |
Summary
Unblocks the dev deploy. Building the
HyperframesRenderLambda asset fails:The comment above that block claimed the autobuild tag was immutable. It isn't — that assumption is the bug. BtbN keeps only a rolling window of autobuild releases and publishes no permanent version tags at all; the GitHub releases API returns
latestplusautobuild-*and nothing else on every page. The oldest surviving autobuild right now is eight days old, so the July 15 pin was simply pruned.Re-pinning to a newer autobuild would only reset the clock and break a deploy again in a few weeks, so this removes the expiring dependency instead.
Change
Download +
sha256sum→COPY --froma registry image pinned by digest:COPY --from=mwader/static-ffmpeg:7.1.1-amd64@sha256:6769881cc02c80d33e387750a8e144d162adfab2775e934dd97899261dda3a0c \ /ffmpeg /ffprobe /opt/ffmpeg/A registry digest is a content address that does not expire, so it keeps the verification strength the SHA256 gave while dropping the expiry. The tag stays alongside the digest for readability; the digest resolves. The whole
curl/sha256sum/tar/chmodlayer is gone —COPYpreserves the source mode.It also fits the requirement better than the original: built
--disable-shared --enable-staticwith libx264/libx265, so nothing is dynamically loaded — not even glibc, which was BtbN's one remaining runtime dependency. The reason this block exists is that Debian's ffmpeg dynamically loads 40+ shared libraries and fails hyperframes' preflight inside the Lambda sandbox; a fully static binary has no such step.Version note:
7.1.1is the newest 7.1.x this publisher ships — a small patch step back from BtbN'sn7.1.5. Deliberate: holding the ffmpeg 7 line hyperframes was validated against is lower risk in a deploy fix than jumping to 8.x/9.x.Verification
Built the real image for
linux/amd64from theinfra/context rather than reasoning about it:ffmpeg/ffprobein the Debian base-versionsmoke check stays in the build)ffprobe→h264,320,240chmod-rwxr-xr-xNo CDK change needed:
HyperframesRenderFunctionpasses no dockerbuildArgs, and nothing else in the repo referencedFFMPEG_BUILD/FFMPEG_ASSET/FFMPEG_SHA256.Also corrected a sentence above the block that still described BtbN's linkage, which no longer describes what gets copied in.
Note on the same class of risk
AWS_LAMBDA_RIE_VERSION=v1.35(line ~107) is pinned to a real GitHub release tag rather than a rolling autobuild, so it is not exposed to this failure mode. Left alone.