Skip to content
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

How to trigger ECS agent actions through API? #653

Closed
simplesteph opened this issue Dec 29, 2016 · 7 comments
Closed

How to trigger ECS agent actions through API? #653

simplesteph opened this issue Dec 29, 2016 · 7 comments

Comments

@simplesteph
Copy link

Hi,

When I look at
http://boto3.readthedocs.io/en/latest/reference/services/ecs.html#ECS.Client.stop_task

It says it will issue a docker stop with a 30 seconds timeout. I have configured the ECS_CONTAINER_STOP_TIMEOUT of the ecs agent to 10m, but apparently this won't be taken into account. Is there a way for me to trigger the ECS agent "stop task" using an API so I the environment variables get taken into account?

Thanks!

@samuelkarp
Copy link
Contributor

@simplesteph The StopTask API uses the timeout specified in ECS_CONTAINER_STOP_TIMEOUT. We'll get the documentation updated to reflect that (looks like we missed updating the documentation when we added the environment variable).

Are you running into problems using the environment variable or just looking to confirm the behavior?

@simplesteph
Copy link
Author

simplesteph commented Dec 31, 2016 via email

@samuelkarp
Copy link
Contributor

Correct, manually issuing docker stop is independent of any settings you have on the ECS agent. To specify a timeout for docker stop, you can use the --time argument with a number of seconds (see docker help stop for details).

@simplesteph
Copy link
Author

simplesteph commented Dec 31, 2016 via email

@samuelkarp
Copy link
Contributor

We don't modify the behavior of the Docker daemon or Docker CLI; we'd prefer that it match the behavior you'd experience in your development environment.

Thanks for opening this and letting us know our docs were out of date! Since it sounds like you just wanted that clarified and are not currently experiencing any issues, I'm going to close this. Please feel free to open new issues if you experience any problems.

@simplesteph
Copy link
Author

@samuelkarp
Sorry to follow up, maybe it's not a bug or I'm not doing things right, but it seems that when I terminate the instance using the API, the shutdown command doesn't seem to respect the timeout as dictated by the ecs-agent. Therefore my tasks don't have the time to finish properly. Do you have a workaround for this or is it a bug?

@simplesteph
Copy link
Author

Actually it should be addressed by moby/moby#23036 and moby/moby#22566. Hopefully AWS will be quick to update to docker 1.13 when it's released... I see we're still at 1.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants