We have created a ECS cluster with Fargate and have created few tasks in service to be used in a CI/CD pipeline. Service has desired count of 1. So if we terminate any task, new task comes up automatically. Is there a way in which we can make sure that task completes and terminates? And when it does, service also should get terminated. We basically want to spin up one task for every stage of our pipeline and delete that task and service once the pipeline stage is completed. Is there any CLI commands that we can use for this case?
-
My understanding is services and tasks are more often used for long running processes. However, I have used one SaaS service that sets up a container that runs containers based on a trigger, so something like this is possible. The AWS ECS Batch processing architecture may provide some ideas or directions: github.com/aws-samples/ecs-refarch-batch-processing– TimCommented Feb 23, 2021 at 7:45
-
Thanks for the help @Tim. But the tasks can as well be used for adhoc processing right? As in, we can spin up a single task, complete the container operations and the task will be autodeleted. Can the Service also be set up similarly?– Meghana B SrinathCommented Feb 24, 2021 at 15:47
-
I have only use ECS in the long running style so I can't help, other than saying that yes I think it's possible. Hopefully someone else can help you, if the link I gave you didn't help. I think that link shows how to spin up containers to do work then has them finish.– TimCommented Feb 24, 2021 at 17:05
Add a comment
|