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

Add support for --init #852

Closed
MrSaints opened this issue Jun 20, 2017 · 18 comments
Closed

Add support for --init #852

MrSaints opened this issue Jun 20, 2017 · 18 comments

Comments

@MrSaints
Copy link

Specify an init process
You can use the --init flag to indicate that an init process should be used as the PID 1 in the container. Specifying an init process ensures the usual responsibilities of an init system, such as reaping zombie processes, are performed inside the created container.

The default init process used is the first docker-init executable found in the system path of the Docker daemon process. This docker-init binary, included in the default installation, is backed by tini.

https://docs.docker.com/engine/reference/run/#specify-an-init-process

@nmeyerhans
Copy link
Contributor

Hi @MrSaints. Just want to make sure we understand what you need here. You're just looking to ensure that exited processes get reaped by an init process, right? This will require some work on the ECS API in addition to the agent, and I want to make sure we properly capture use cases so we can assign an appropriate priority to that work. Thanks.

@MrSaints
Copy link
Author

MrSaints commented Jun 20, 2017

@nmeyerhans We currently run an ECS task that contains a process that spins other processes up. When those processes exit, they may not exit nicely. And consequently, they remain as zombie processes. Before, we would simply use something like dumb-init, and tini. But now, the latter is included in Docker, and can be used via the --init flag. Essentially, what we want is to run our process (within a Docker container) under a PID1 init process, so that signals, and processes are properly handled.

I'm happy to help with this if you can point me in the right direction. Otherwise, I'd love if this is available out-of-the-box. For now, we just installed tini in the Docker image.

@stefansedich
Copy link

stefansedich commented Jun 23, 2017

With the upgrade to 17.03.1-ce this should be supported OOTB if the agent simply passes --init to docker run right?

@MrSaints
Copy link
Author

@stefansedich I believe so.

@stefansedich
Copy link

@nmeyerhans was having a look into doing this as felt like something I could sink my teeth into, but I assume the API work is something that cannot be done from someone external? originally I thought it was going to be easy to add but then realized what you might have meant when you said "work on the ECS API" is something outside of the scope of the agent.

@techabstraction
Copy link

As expressed on #865, our organisation would also like to use this Docker feature.

@debu99
Copy link

debu99 commented Jul 14, 2017

is there any way to pass --init flag with ecs agent when dockers run in ec2?

@stefansedich
Copy link

Any movement on this one?

@rodmaz
Copy link

rodmaz commented Aug 16, 2017

+1

@stefansedich
Copy link

Any updates yet as to how long this one might be? will help me decide if I use the init wrapper in all of our containers or just wait for the support to be added which I would prefer

@nmeyerhans
Copy link
Contributor

@stefansedich and others: yes, this is something that is going to be supported soon. I don't have specific details on timing, but we have started work on the backend support.

@stefansedich
Copy link

Thanks for the update @nmeyerhans I look forward to it!

@spanktar
Copy link

unrelated, but why can't there just be an ECS variable that's like "just pass these flags to docker run" so we don't have to open tickets for every command line flag people want but have to wait forever to get implemented in ECS?

ECS_DOCKER_RUN_FLAGS

Anyway, +1 to --init.

sharanyad added a commit to sharanyad/amazon-ecs-agent that referenced this issue Oct 6, 2017
This commit contains the model changes and functional tests for the new Task Definition fields-devices and initProcessEnabled.

This addresses the following issues:
* aws#433
* aws#852
sharanyad added a commit to sharanyad/amazon-ecs-agent that referenced this issue Oct 6, 2017
This commit contains the model changes and functional tests for the new Task Definition fields-devices and initProcessEnabled.

This addresses the following issues:
* aws#433
* aws#852
@marceloavan
Copy link

+1

1 similar comment
@Mchl
Copy link

Mchl commented Oct 26, 2017

+1

@samuelkarp samuelkarp added this to the 1.15.0 milestone Nov 1, 2017
@samuelkarp
Copy link
Contributor

You can now specify the --init flag in your task definition. You can add this new option in the AWS Console now, and it'll be available in the AWS CLI and SDKs soon. --init requires at least Docker 1.13.0 and ECS agent v1.15.0.

@stefansedich
Copy link

Thanks @samuelkarp and team!

sharanyad added a commit to sharanyad/amazon-ecs-agent that referenced this issue Nov 8, 2017
This commit contains the model changes and functional tests for the new Task Definition fields-devices and initProcessEnabled.

This addresses the following issues:
* aws#433
* aws#852
sharanyad added a commit to sharanyad/amazon-ecs-agent that referenced this issue Nov 9, 2017
This commit contains the model changes and functional tests for the new Task Definition fields-devices and initProcessEnabled.

This addresses the following issues:
* aws#433
* aws#852
@JCash
Copy link

JCash commented Apr 9, 2020

Since I had to really struggle to find the relevant info on how to use it:

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html

Search for initProcessEnabled

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