- Newest
- Most votes
- Most comments
The SQS option is a good one. A way to work around the abandoned queue issue is to write the names of the queues into a DynamoDB table with a TTL. Every so often, the container updates the TTL. If the container crashes, the record will eventually be deleted, which will show up in a DynamoDB stream, which can be used to delete the queue.
An alternative might be to expose and HTTP endpoint directly on the ECS task itself, and send the URL with the request. When the use input is received, you make a call to the specific URL. This will make the solution easier.
I am not sure I understand that saying that saving the state and resuming from a different container takes too long. What do you mean? The time it takes to save and restore? If so, don't forget there is a human in the loop which will take much longer probably. Also, while the container is waiting for the result, it doesn't do anything, which means that you are just idling there, wasting money. I would check again the option to make it event driven and resume in a different container.
Finally, I would recommend looking into breaking the process into smaller tasks and use StepFunction to orchestrate them, instead of an ECS task. You can then use the Wait For Task Token to get the human's response.
This seems like orchestration, have you considered Step Functions ? You can Invoke and Manage ECS Tasks.
https://docs.aws.amazon.com/step-functions/latest/dg/connect-ecs.html
I see the similarities, but as long as the task is not splittable, I need to pass information into an already running container, not only start-parameters.
While this isn't exactly what you were asking, as a generic way of getting interactive access to ECS tasks you could use ECS exec. It works for both EC2 and Fargate. And using Copilot makes it easier. https://aws.amazon.com/blogs/containers/new-using-amazon-ecs-exec-access-your-containers-fargate-ec2/ https://aws.amazon.com/blogs/containers/connecting-to-an-interactive-shell-on-your-containers-running-in-aws-fargate-using-aws-copilot/
Relevant content
- asked 2 years ago
- Accepted Answerasked 4 months ago
- asked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
Thanks! Is it possible to reach a single container via http if multiple containers are running on a single host machine?
Not a container expert, but should be possible.