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

figure out podutils and init / zombies #8779

Closed
BenTheElder opened this issue Jul 23, 2018 · 17 comments
Closed

figure out podutils and init / zombies #8779

BenTheElder opened this issue Jul 23, 2018 · 17 comments
Labels
area/prow Issues or PRs related to prow lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@BenTheElder
Copy link
Member

With the podutils we run our entrypoint binary as PID1 in the containers, for jobs that fork this may be problematic. We should look at options for handling this.

Specifically for zombie processes we can probably get away with something like /bin/sh entrypoint ..., but other things may actually make use of an init...

/cc @stevekuznetsov @cjwagner

/area prow
/priority important-soon

@k8s-ci-robot k8s-ci-robot added area/prow Issues or PRs related to prow priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Jul 23, 2018
@stevekuznetsov
Copy link
Contributor

I am of the opinion that init systems in containers are a huge code smell and I'm not sure how much effort we should go to in order to support them. Why not launch a dockerd container and have it share the socket? One process per container.

@BenTheElder
Copy link
Member Author

I am of the opinion that init systems in containers are a huge code smell and I'm not sure how much effort we should go to in order to support them. Why not launch a dockerd container and have it share the socket? One process per container.

Smell or not they're immensely useful, and lots of third party tools happily fork to their heart's content. We don't necessarily need a full blown init to avoid zombie processes in particular.

Why not launch a dockerd container and have it share the socket? One process per container.

Don't we only allow one test container? Also the pod lifecycle...? Mounting through volumes? There are many reasons to do this in the same container.

@BenTheElder
Copy link
Member Author

Similarly, due to the entrypoint binary, we already do NOT have "one process per container", we have at minimum 2, which sorta illustrates how useful running multiple binaries is...

@stevekuznetsov
Copy link
Contributor

Since the lifecycles of the two processes are linked right now I'm not sure there is a simple way for zombies to happen. In any case, though, I think we might be OK since tests are not long-running processes, so zombie buildup should not be an issue? worst case would be a poorly-behaved getting PID exhaustion and not being able to fork anymore, right?

Don't we only allow one test container?

Only because we haven't thought through other applications today.

Also the pod lifecycle...?

Just seems like it needs some thought, not an intractable problem.

Mounting through volumes? There are many reasons to do this in the same container.

Communication through the filesystem using UNIX sockets is a totally valid thing to be doing to communicate between containers.

@BenTheElder
Copy link
Member Author

Since the lifecycles of the two processes are linked right now I'm not sure there is a simple way for zombies to happen.

These two processes are linked, but the command we run generally forks at some point, and it still illustrates how it is useful to fork using someone else's binary within a container. "one process per container" rarely actually happens here. We're not going to be able to change all of that. Tools run other tools to EG spin up clusters.

I think we might be OK since tests are not long-running processes, so zombie buildup should not be an issue?

No, many of the test suites we run can even take say, 15 hours, and we'd really like to not lose those.

worst case would be a poorly-behaved getting PID exhaustion and not being able to fork anymore, right?

No, PID exhaustion causes the kubelet to restart all containers. See #5877, #5887, #5700 (comment)

Only because we haven't thought through other applications today.

Just seems like it needs some thought, not an intractable problem.

OK, but that's more complex than running a shell as the top level process, at minimum, and it's not quite what we need, see the next comment..

Communication through the filesystem using UNIX sockets is a totally valid thing to be doing to communicate between containers.

I don't believe you can do volume mounts from within the test container with a sidecar, which makes this a no-go.

@fejta
Copy link
Contributor

fejta commented Jul 23, 2018

At some point we should update the pod-utilities to not require hijacking the entrypoint, which will solve this problem.

@stevekuznetsov
Copy link
Contributor

stevekuznetsov commented Jul 23, 2018

No, PID exhaustion causes the kubelet to restart all containers.

Ah, true, forgot about this. FYI k8s natively handles this, alpha in 3.10 kubernetes/kubernetes#57973

@stevekuznetsov
Copy link
Contributor

At some point we should update the pod-utilities to not require hijacking the entrypoint, which will solve this problem.

@fejta was there a design for letting the sidecar know when uploads should begin / when the test process was exiting?

@BenTheElder
Copy link
Member Author

BenTheElder commented Jul 23, 2018 via email

@stevekuznetsov
Copy link
Contributor

I don't believe you can do volume mounts from within the test container with a sidecar, which makes this a no-go.

What was the limit here? I can't remember what disallowed volume mounts

@BenTheElder
Copy link
Member Author

We have files inside container CA's filesystem on runtime RA that we want to mount into container CB on runtime CB. I don't think that works right.

Entirely beside the point though, as we're not getting zombies with dind... we get zombies from other utils. DinD just reminded me that this sort of multiprocess work doesn't gel too well with the ENTRYPOINT hijacking we do currently, everything we run does fork.

@BenTheElder BenTheElder mentioned this issue Jul 24, 2018
3 tasks
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 21, 2018
@BenTheElder
Copy link
Member Author

At some point we should update the pod-utilities to not require hijacking the entrypoint, which will solve this problem.

Do we have a different tracking issue for this?
/remove-lifecycle stale
for now, feel free to close if we have a better issue..

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 23, 2018
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 21, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 20, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/prow Issues or PRs related to prow lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

5 participants