-
Notifications
You must be signed in to change notification settings - Fork 3
Use waitForTaskToken for Fargate tasks #187
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
Conversation
| raise StandardError, "FFmpeg probe failed" unless system ffprobe_cmd | ||
|
|
||
| # Write the probe output to S3 | ||
| puts "Writing probe output to S3 artifact bucket" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ErrorMessage: e.message | ||
| }) | ||
| ) | ||
| sf.send_task_failure({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compare to the old way, which caused Lambda executions to fail to force the FTP issue to be treated as a task failure. Now we do that directly.
cavis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment on the bytes (float vs int), but otherwise looks good to me.
| # Add the probe results for this output to the task result | ||
| probe_results = JSON.parse(stdout) | ||
| task_result[:Duration] = probe_results["format"]["duration"].to_f * 1000 | ||
| task_result[:Size] = probe_results["format"]["size"].to_f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably .to_i? I don't know if it would break anything, but was just an integer before.
Previously we would do something in synchronous Fargate tasks, which have no capacity for passing data back to the state machine.
This changes to using a async
waitForTaskTokenconfig, which allows the Fargate task to pass arbitrary data back to the state machine upon completion. These negates the previous need to write similar data to S3, and then immediately read that data back from S3 in a Lambda function, just to make it available within the state machine.The main thing to review here is ensuring that the
outputofsend_task_successthat's now happening within the Fargate code matches the previous result of the now-removed-task-outputLambda functions. And thatsend_task_failureis being used in a way that makes sense.The
FtpCopyTaskOutputLambdaErrorAlarmalarm has also been removed, since it was based on the now-removed function, and we've decided there's no need to find an alternative.Closes #183