New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webhooks for when renderMediaOnLambda() is finished #1369
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Wow this looks awesome! |
If possible, I'd like to have inside
|
Is it possible to add webhooks on end of each chunk render and/or when starts to encoding? |
Nice, it works! I replaced fetch with the
Yes, I have now added logging that shows up in CloudWatch, it would be nice if we also add it to the errors array
I would say let's make a new parameter
I lowered the timeout to 3 seconds and made it that this is allowed in testing. Now it fails even on my fast machine!
Nice comments by @FelippeChemello!
It will never take 1000ms since it will take the higher one of timeoutInMilliseconds and 1000, right?
Shouldn't be necessary anymore as I removed the 7000ms minimum!
Yes, let's add them to the error array ( |
Thanks for the feedback! I'll probably be able to finish this either tomorrow or on the weekend.
Ah, wasn't aware of that!
Okay, sounds good!
I added the clamping to avoid accidentally ending up with negative values (i.e. if you set the Lambda timeout to 500ms, the timeout webhook would otherwise fire instantaneously). Currently the timeout webhook fires 1000ms before the Lambda function times out (but we could also make that 500ms or any other value), but at least 1000ms into the process.
Okay!
Sounds good! |
This is a brilliant PR which exceeded my expectations and which nailed making a great developer experience! Enjoy the well-deserved bounty and we'll also announce the feature on Twitter and Instagram and shout you out! |
@paulkuhle For statistics: How long do you think you've spent on this PR? |
Thanks for the kind words! I've had a lot of fun working on this little feature. Keep up the great work!
Two coding sessions, probably 12 hours or so in total. A good amount of that time was spent learning how Remotion (or at least the Lambda renderer) works and documenting the changes. The draft PR itself was actually relatively quick. |
@FelippeChemello We can add this functionality in a second step in the future! |
@paulkuhle thanks! 🙇🏻 |
This PR fixes [#1006].
This is a first draft and still WIP.
So far, this PR includes:
webhook
to therenderMediaOnLambda
CLIlaunch
functionlaunchHandler
with currently three different cases:innerLaunchHandler
throws, we send an error webhooksetTimeout
oftimeoutLimit - 1000ms
is executed, we send a timeout webhookinnerLaunchHandler
, we cancel the timeout and send a success webhookfetch
POST request with a basic payload (result
andrenderId
)X-REMOTION-SIGNATURE
header with an HMAC hash (industry standard used at Github, Stripe, etc.). The entire request body is hashed with a secret key.I do have some questions/comments:
postRenderData
object can have errors. Should we send out an error webhook in that case? Maybe it could also make sense to separate those cases (fatal_error
vs.completed_with_errors
or something like that).launch
function or is there something else we can use?Of course any other comments are welcome!
Pending:
IssueHunt Summary
Referenced issues
This pull request has been submitted to: