-
Notifications
You must be signed in to change notification settings - Fork 553
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
runtime: Add more steps to the lifecycle docs #207
Conversation
A typical lifecyle progresses like this: | ||
|
||
1. There is no container or running application | ||
2. A user tells the runtime to start a container+application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
start a container for an application.. ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A user tells the runtime to start a container
Don't use the word application, its just a container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it makes sense to leave out application altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Wed, Sep 30, 2015 at 11:52:37AM -0700, Mrunal Patel wrote:
+2. A user tells the runtime to start a container+application
start a container for an application.. ?
Without explicit create and start steps, it's “to create a container
and launch an application inside that container”, but that seemed too
long. Should I just replace “container+application” with “container
and application”?
On IRC on 2015-09-28: 11:28 < jojy_mesos> i guess i was expecting an additional attribute for hooks that specifies whether the hooks runs in the host namespace or in the container's namespace 11:28 < lk4d4> they all run in host namespaces Signed-off-by: W. Trevor King <wking@tremily.us>
I've rebased on the new master and added 80c1729 since #202 landed. I'm not sure what the intended behavior isif the application dies while we're running post-start hooks. In 80c1729 I've gone with “we terminate any in-progress post-start hook and skip any that hadn't been called yet”, but “terminate” is vague (TERM? KILL? TERM and KILL after 5 seconds if necessary?). @LK4D4, do you want something different than the 80c1729 phrasing? |
d421f51
to
e0ec87b
Compare
Is this supposed to be illustrative or normative? It might be clearer to insert normative language where useful. Destroying the "container process" (might be a better term, its usually going to be container pid 1 but I suppose you might not have a pid namespace) will often implicitly destroy the container, so I would allow for that to happen, so hooks after that may not be able to see container any more. |
On Thu, Oct 01, 2015 at 02:23:34AM -0700, Justin Cormack wrote:
I'd rather have the summaries in the enumerated list be informative
I don't see “destroy” in the language through e0ec87b. Are you
This termination is qualified by the “Joining existing containers” This would also be easier if we landed a glossary like that proposed |
And explain how the handling differs when a new start-call joins an existing container vs. creating a new container. This is spun off from the mailing list thread now that that's settled down [1]. This write-up is just about Linux containers, since I don't understand the other systems well enough to do them justice. [1]: https://groups.google.com/a/opencontainers.org/forum/#!topic/dev/frUXLljXy8Y Message-ID: <20150915034717.GO18018@odin.tremily.us> Signed-off-by: W. Trevor King <wking@tremily.us>
These just landed via opencontainers#202. I'm not entirely clear on how we intend to handle "the application died before we finished executing post-stop hooks", but I've made my best guess here. Signed-off-by: W. Trevor King <wking@tremily.us>
I did a bit more digging in runC's cleanup implementation yesterday,
I'm not sure when persistent namespaces (e.g. network namespaces) are That's a bit different from the cleanup logic currently proposed here: a. I suggest running the post-stop hooks before cleaning up the I think this PR's current approach to (a) and (b) makes sense, and it |
@@ -12,27 +12,28 @@ Presently there are `Prestart`, `Poststart` and `Poststop`. | |||
Hooks allow one to run code before/after various lifecycle events of the container. | |||
Hooks MUST be called in the listed order. | |||
The state of the container is passed to the hooks over stdin, so the hooks could get the information they need to do their work. | |||
All hooks execute in the host environment (e.g. the same namespace, cgroups, etc. that apply to the host process). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect. They are forked from the runtime process so they inherit from the runtime, not all host processes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Wed, Oct 07, 2015 at 11:36:22AM -0700, Michael Crosby wrote:
+All hooks execute in the host environment (e.g. the same
namespace, cgroups, etc. that apply to the host process).This is incorrect. They are forked from the runtime process so they
inherit from the runtime, not all host processes.
There are at least two runtime processes here. There is a process
launched with (for example) ‘runC start’, which I've been referring to
as the “host process”. That process forks and the child ends up in
the container, eventually running the config.json process binary. I'd
been referring to the latter as the “container process”. Do you
prefer alternative names for those two processes?
I find this PR introducing concepts to the Spec that are implementation details of runC. Input from folks working on implementing the Spec in non-Linux OSes will definitely help. |
On Mon, Oct 12, 2015 at 03:50:19PM -0700, Vish Kannan wrote:
The initial comment for this PR points out that it's just about Linux And the goal on Linux is to document what runC does now 1, since So +1 to feedback like “on Windows, container creation will need |
@wking: I suggest closing this PR and starting an email thread to solicit feedback from other members. |
On Mon, Oct 12, 2015 at 04:57:21PM -0700, Vish Kannan wrote:
Email thread exists [1](also linked in this PR's original post). I |
I think there is still a lot of discussion needed on the lifecycle but this is not an accurate base to start from and will end up being more work if we iterate on this PR instead of discussing first and starting fresh. We need to make this detailed but having some of the people who work on runtimes comment as wells as abstract where this works cross platform. We also need to figure out why we are defining the lifecycle and the types of issues it solves by having this defined or else it will be targeted at a something that is not useful for a consumer. |
On Mon, Oct 12, 2015 at 05:16:15PM -0700, Michael Crosby wrote:
Fair enough. @mrunalp volunteered to write one up 1, and this
I think this is pretty clear. For example, it's not currently clear |
My pull request was rejected on 2015-10-12 [1], but Mrunal filed an alternative which landed on 2015-12-09 [2]. [1]: opencontainers/runtime-spec#207 (comment) [2]: opencontainers/runtime-spec#231 (comment)
And explain how the handling differs when an application joins an
existing container vs. creating a new container. This is spun off
from the mailing list thread now that that's settled down.
This write-up is just about Linux containers, since I don't understand
the other systems well enough to do them justice. I'm happy to roll
in notes for other platforms if folks know what to write ;).
I've pulled the hook-environment change I made in this post out
into a separate commit, and I'm happy to push that as a separate PR if
it makes review easier.