mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-19 19:36:04 +00:00
feat(aws-lambda): run chunks on an optional arm64 image function
A new VideoImageUri parameter adds an arm64 container-image function that only renders chunks. Plan, audio and assemble stay on the x86 ZIP function, so audio encodes are unchanged. Empty (the default) deploys exactly as before. The reserved concurrency moves to whichever function renders the chunks.
This commit is contained in:
@@ -345,6 +345,32 @@ describe("HyperframesRenderStack — snapshot", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("sends only renderChunk to the SAM template's optional arm64 video function", () => {
|
||||
// Plan, audio and assemble encode audio; on the x86 function that audio stays byte-identical.
|
||||
const targets = Object.values(lambdaTasks(readSamDefinition().States)).map((task) => ({
|
||||
action: sentPayload(task).Action,
|
||||
functionName: requireRecordProperty(requireRecord(task, "task"), "Parameters", "task params")
|
||||
.FunctionName,
|
||||
}));
|
||||
expect(new Set(targets.map((target) => target.action))).toEqual(
|
||||
new Set(["plan", "renderChunk", "audio", "assemble"]),
|
||||
);
|
||||
for (const { action, functionName } of targets) {
|
||||
expect({ action, functionName }).toEqual({
|
||||
action,
|
||||
functionName:
|
||||
action === "renderChunk"
|
||||
? ["HasVideoFunction", "VideoFunction.Arn", "RenderFunction.Arn"]
|
||||
: "RenderFunction.Arn",
|
||||
});
|
||||
}
|
||||
const samRole = requireRecord(readSamResources().RenderStateMachineRole, "SAM role");
|
||||
const invoke = JSON.stringify(
|
||||
requireRecordProperty(samRole, "Properties", "SAM role properties").Policies,
|
||||
);
|
||||
expect(invoke).toContain('["RenderFunction.Arn",["HasVideoFunction","VideoFunction.Arn"');
|
||||
});
|
||||
|
||||
it("lets the render function abort the multipart uploads its S3 stitch starts", () => {
|
||||
const cdkPolicies = JSON.stringify(SYNTHED.template.findResources("AWS::IAM::Policy"));
|
||||
expect(cdkPolicies).toContain("s3:Abort*");
|
||||
|
||||
Reference in New Issue
Block a user