You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 81d73d2
Browse filesBrowse the repository at this point in the historyBrowse files
fix(aws-lambda): chrome-headless-shell 158 in the arm64 video image, sparticuz 153 in the x86 ZIP (#8155)
* fix(aws-lambda): run chrome-headless-shell 158 in the arm64 video image
The arm64 video image now installs Chrome for Testing's linux-arm64 chrome-headless-shell
158.0.8127.36, pinned by sha256 and fetched with curl -f, as the whole shell folder. The Lambda
Node 22 base has none of the shared libraries the shell links and no fonts, so the image installs
them from the base's repository at the same pinned release. The image sets
HYPERFRAMES_LAMBDA_CHROME_SOURCE and HYPERFRAMES_LAMBDA_CHROME_PATH itself, and the nested video
function no longer passes ChromeSource, which would override them. stage-arm64-image.ts stops
fetching the sparticuz arm64 pack and drops the ZIP's x86 sparticuz Chrome instead.
The x86 handler ZIP stays on @sparticuz/chromium, bumped from 148.0.0 to 153.0.0. It builds at
258,502,222 bytes unzipped, under Lambda's 262,144,000-byte limit and the 248 MiB in-house gate.
Two fixes for --source=chrome-headless-shell:
- build-zip.ts staged only the executable, which exits at launch without its ICU data and .pak
files. It now stages the whole shell folder at chrome-headless-shell-linux64/.
- Nothing set HYPERFRAMES_LAMBDA_CHROME_PATH, which src/chromium.ts requires for that source.
The SAM template and the CDK stack now set it to the bundled shell when ChromeSource asks for it.
Drops the unused @types/aws-lambda devDependency, which the dead-code audit reports whenever this
package's manifest changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* ci(publish): build the Lambda arm64 video image on an ARM runner
The video stage now installs Chrome's system libraries with microdnf, so it runs code for arm64.
The pack job built that image on ubuntu-latest with no emulation, which it could do only while the
stage copied files. A new lambda-video-image job builds it natively on ubuntu-24.04-arm, from the
handler zip whose sha256 the zip job reported, and reports the OCI tarball's sha256. Pack downloads
that tarball, checks the sha256 against the job's, and pins it as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(aws-lambda): fit the comment ratchet and the package size budget
chromium.ts loses the two doc lines on BUNDLED_SHELL_DIR and BUNDLED_SHELL_PATH; the names and the
SAM template's comment already say what they are.
@hyperframes/aws-lambda's unpacked budget goes from 290,508 to 298,000 bytes. The package unpacks to
295,324 bytes, up from the shared chrome-headless-shell staging module the ZIP and image scripts now
import and from the README and docs that describe the two Chrome sources.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/deploy/aws-lambda.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,7 @@ The stack's bucket expires objects under `cas/sha256/` 30 days after they were l
104
104
105
105
#### Upgrading from a version that deployed x86 only
106
106
107
-
`lambda deploy` now runs the plan and the render chunks on an arm64 container-image function by default; audio and assemble stay on the x86 function. Redeploying an existing stack without `--video-arch` moves it to arm64 and adds the `<stack>-video` ECR repository. To keep a stack on x86, pass `--video-arch x86_64` on every deploy. `--chrome-source chrome-headless-shell` also needs `--video-arch x86_64`, because the arm64 image bundles sparticuz Chrome only.
107
+
`lambda deploy` now runs the plan and the render chunks on an arm64 container-image function by default; audio and assemble stay on the x86 function. Redeploying an existing stack without `--video-arch` moves it to arm64 and adds the `<stack>-video` ECR repository. To keep a stack on x86, pass `--video-arch x86_64` on every deploy. `--chrome-source chrome-headless-shell` also needs `--video-arch x86_64`, because the arm64 image is built from the sparticuz handler ZIP. The arm64 image itself runs Chrome for Testing's linux-arm64 `chrome-headless-shell`, whatever `--chrome-source` says.
108
108
109
109
#### Upgrading from a version before shared content storage
Copy file name to clipboardExpand all lines: docs/packages/aws-lambda.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ The Lambda adapter wraps the distributed producer primitives behind one dispatch
56
56
57
57
All three phases must fit the configured per-invocation Lambda timeout, at most 15 minutes, and the function's temporary storage. Smaller chunks can reduce each worker's extraction and rendering work, but do not divide video extraction that still happens in Plan. See [long-video planning limits](/deploy/aws-lambda#long-video-planning-times-out) for FFmpeg frame-stall timeouts and how to split jobs that cannot fit.
58
58
59
-
The handler uses `@sparticuz/chromium` by default, with a build-time fallback for bundling `chrome-headless-shell` directly when needed.
59
+
The x86 handler ZIP uses `@sparticuz/chromium` by default, with a build-time fallback for bundling `chrome-headless-shell` directly when needed. The arm64 video image runs Chrome for Testing's linux-arm64 `chrome-headless-shell`.
Copy file name to clipboardExpand all lines: docs/packages/cli.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3071,7 +3071,7 @@ deploy:
3071
3071
|`--concurrency`| none | Lambda reserved concurrency. Without it, a new stack reserves none and each render runs up to 90% of the account's unreserved concurrency; a redeploy keeps the stack's current reservation; `none` removes it |
3072
3072
|`--memory`|`10240`| Lambda memory in MB |
3073
3073
|`--chrome-source`|`sparticuz`|`sparticuz` or `chrome-headless-shell`|
3074
-
|`--video-arch`|`arm64`|`arm64` runs the plan and the chunks on an arm64 container-image function, pushed to an ECR repository named `<stack>-video`; audio and assemble stay on x86. Needs`sparticuz`. `x86_64` runs everything on the x86 function |
3074
+
|`--video-arch`|`arm64`|`arm64` runs the plan and the chunks on an arm64 container-image function, pushed to an ECR repository named `<stack>-video`; audio and assemble stay on x86. The image runs its own `chrome-headless-shell`; the handler ZIP it is built from needs`sparticuz`. `x86_64` runs everything on the x86 function |
3075
3075
|`--skip-build`| off | Reuse the existing `handler.zip`|
3076
3076
|`--no-warm`| warm | Skip the one warm-up call to the video function after deploy, which loads its container image so the first render is not the one that waits for it |
|`@sparticuz/chromium`| yes |~70 MiB compressed | Lambda. Decompresses into `/tmp` at runtime; the rest of the ecosystem already uses it for headless-Chrome-in-Lambda. |
96
-
| Bundled `chrome-headless-shell`| no |~140 MiB| Fallback. Used if `@sparticuz/chromium` ever drops `HeadlessExperimental.beginFrame` support. |
96
+
| Bundled `chrome-headless-shell`| no |~296 MB | Fallback. Used if `@sparticuz/chromium` ever drops `HeadlessExperimental.beginFrame` support. |
97
97
98
98
Pick the source at build time:
99
99
@@ -102,9 +102,17 @@ bun run --cwd packages/aws-lambda build:zip
102
102
bun run --cwd packages/aws-lambda build:zip -- --source=chrome-headless-shell
103
103
```
104
104
105
-
The handler reads `HYPERFRAMES_LAMBDA_CHROME_SOURCE` at boot. The build
106
-
script sets that env var via Lambda function configuration in
107
-
`examples/aws-lambda/template.yaml`.
105
+
The handler reads `HYPERFRAMES_LAMBDA_CHROME_SOURCE` at boot, and for
106
+
`chrome-headless-shell` the executable from `HYPERFRAMES_LAMBDA_CHROME_PATH`.
107
+
`examples/aws-lambda/template.yaml` and the CDK construct set both from the
108
+
Chrome source. The build stages the whole shell folder (the executable needs
109
+
its ICU data and `.pak` files beside it), which is over Lambda's 250 MiB
110
+
unzipped limit for a ZIP function, so the x86 ZIP ships `@sparticuz/chromium`.
111
+
112
+
The arm64 video image (`image/Dockerfile`, `video` target) does not use
113
+
`@sparticuz/chromium`: it installs Chrome for Testing's linux-arm64
114
+
`chrome-headless-shell` folder, pinned by version and sha256, with the shared
115
+
libraries and fonts it needs, and sets both env vars itself.
0 commit comments