@hyperframes/aws-lambda 0.8.189 → 0.8.190-hdr.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{chunk-ROTCAPRH.js → chunk-Z7KVGDNN.js} +5 -0
- package/dist/events.d.ts +8 -2
- package/dist/handler.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/prebuilt/handler-zip.json +4 -4
- package/prebuilt/template.yaml +22 -0
- package/prebuilt/video-image.json +4 -4
|
@@ -345,6 +345,11 @@ function getS3Client() {
|
|
|
345
345
|
return cachedS3Client;
|
|
346
346
|
}
|
|
347
347
|
async function handler(event, deps) {
|
|
348
|
+
if (event.Action === "warm") {
|
|
349
|
+
primeRuntimeEnv();
|
|
350
|
+
await ensureChromePath(deps);
|
|
351
|
+
return { Action: "warm" };
|
|
352
|
+
}
|
|
348
353
|
const unwrapped = unwrapEvent(event);
|
|
349
354
|
validatePlanProtocolShape(unwrapped);
|
|
350
355
|
validateEventS3Uris(unwrapped);
|
package/dist/events.d.ts
CHANGED
|
@@ -19,6 +19,9 @@ import type { DistributedFormat, SerializableDistributedRenderConfig } from "@hy
|
|
|
19
19
|
export type { SerializableDistributedRenderConfig } from "@hyperframes/producer/distributed";
|
|
20
20
|
/** Discriminator for the three roles the one Lambda image fulfills. */
|
|
21
21
|
export type LambdaAction = "plan" | "audio" | "renderChunk" | "assemble";
|
|
22
|
+
export interface WarmEvent {
|
|
23
|
+
Action: "warm";
|
|
24
|
+
}
|
|
22
25
|
/** Transport protocol selected for one complete distributed render. */
|
|
23
26
|
export type LambdaPlanProtocol = "v1" | "v2";
|
|
24
27
|
/**
|
|
@@ -29,7 +32,7 @@ export type LambdaPlanProtocol = "v1" | "v2";
|
|
|
29
32
|
* handler unwraps both `event.Payload` and `event.Input` before
|
|
30
33
|
* dispatching.
|
|
31
34
|
*/
|
|
32
|
-
export type LambdaEvent = PlanEvent | AudioEvent | RenderChunkEvent | AssembleEvent | {
|
|
35
|
+
export type LambdaEvent = PlanEvent | AudioEvent | RenderChunkEvent | AssembleEvent | WarmEvent | {
|
|
33
36
|
Payload: LambdaEvent;
|
|
34
37
|
} | {
|
|
35
38
|
Input: LambdaEvent;
|
|
@@ -199,4 +202,7 @@ export interface AssembleLambdaResult {
|
|
|
199
202
|
FileSize: number;
|
|
200
203
|
DurationMs: number;
|
|
201
204
|
}
|
|
202
|
-
export
|
|
205
|
+
export interface WarmLambdaResult {
|
|
206
|
+
Action: "warm";
|
|
207
|
+
}
|
|
208
|
+
export type LambdaResult = WarmLambdaResult | PlanLambdaResult | AudioLambdaResult | RenderChunkLambdaResult | AssembleLambdaResult;
|
package/dist/handler.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/aws-lambda",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.190-hdr.1",
|
|
4
4
|
"description": "AWS Lambda adapter for HyperFrames distributed rendering — handler, client-side SDK, and CDK construct.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"ffprobe-static": "^3.1.0",
|
|
53
53
|
"puppeteer-core": "^25.8.0",
|
|
54
54
|
"tar": "^7.4.3",
|
|
55
|
-
"@hyperframes/producer": "^0.8.
|
|
55
|
+
"@hyperframes/producer": "^0.8.190-hdr.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/aws-lambda": "^8.10.146",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.8.
|
|
3
|
-
"url": "https://github.com/heygen-com/hyperframes/releases/download/v0.8.
|
|
4
|
-
"sha256": "
|
|
5
|
-
"bytes":
|
|
2
|
+
"version": "0.8.190-hdr.1",
|
|
3
|
+
"url": "https://github.com/heygen-com/hyperframes/releases/download/v0.8.190-hdr.1/hyperframes-lambda-handler.zip",
|
|
4
|
+
"sha256": "45746a2c2b6e01bce983221217461455b449e559bc9a53afe0dcd7105da45d82",
|
|
5
|
+
"bytes": 129254552
|
|
6
6
|
}
|
package/prebuilt/template.yaml
CHANGED
|
@@ -254,6 +254,11 @@ Resources:
|
|
|
254
254
|
SelectPlanProtocol:
|
|
255
255
|
Type: Choice
|
|
256
256
|
Choices:
|
|
257
|
+
# Only a stack with the arm64 video function has a cold x86 function to warm.
|
|
258
|
+
# Without one the compared value can never match.
|
|
259
|
+
- Variable: $.PlanProtocol
|
|
260
|
+
StringEquals: !If [HasVideoFunction, v2, v2-without-video-function]
|
|
261
|
+
Next: WarmRender
|
|
257
262
|
- Variable: $.PlanProtocol
|
|
258
263
|
StringEquals: v2
|
|
259
264
|
Next: PlanV2
|
|
@@ -265,6 +270,23 @@ Resources:
|
|
|
265
270
|
Next: UnsupportedPlanProtocol
|
|
266
271
|
Default: PlanV2
|
|
267
272
|
|
|
273
|
+
# The audio task runs on this function once the plan is done; starting its container now hides the cold start.
|
|
274
|
+
WarmRender:
|
|
275
|
+
Type: Task
|
|
276
|
+
Resource: arn:aws:states:::lambda:invoke
|
|
277
|
+
Parameters:
|
|
278
|
+
FunctionName: !GetAtt RenderFunction.Arn
|
|
279
|
+
InvocationType: Event
|
|
280
|
+
Payload:
|
|
281
|
+
Action: warm
|
|
282
|
+
ResultPath: null
|
|
283
|
+
Catch:
|
|
284
|
+
- ErrorEquals:
|
|
285
|
+
- States.ALL
|
|
286
|
+
ResultPath: null
|
|
287
|
+
Next: PlanV2
|
|
288
|
+
Next: PlanV2
|
|
289
|
+
|
|
268
290
|
UnsupportedPlanProtocol:
|
|
269
291
|
Type: Fail
|
|
270
292
|
Error: PLAN_PROTOCOL_UNSUPPORTED
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.8.
|
|
3
|
-
"url": "https://github.com/heygen-com/hyperframes/releases/download/v0.8.
|
|
4
|
-
"sha256": "
|
|
5
|
-
"bytes":
|
|
2
|
+
"version": "0.8.190-hdr.1",
|
|
3
|
+
"url": "https://github.com/heygen-com/hyperframes/releases/download/v0.8.190-hdr.1/hyperframes-lambda-video-arm64.oci.tar",
|
|
4
|
+
"sha256": "bda6b62d0d72de5f5836d61992117068e5475e32346ee66a2b8f48cd393b3f4a",
|
|
5
|
+
"bytes": 244633600
|
|
6
6
|
}
|