-
Notifications
You must be signed in to change notification settings - Fork 315
Prepare ground for moving on new API #299
Conversation
|
Answering your questions:
@crosbymichael in case he doesn't agree with any of the above. But I believe we have from what we've spoken about before. |
factory.go
Outdated
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 shouldn't need to be in the public API no?
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.
I think it should. When CT is created, a new process is forked in a new set of namespaces and this process must call execve() immediately. So an user of libcontainer has to create a program which will be executed in a new set of namespaces and call StartInitialization(). For example "nsexec init" will call this method.
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.
(I'm fine as is for the sake of progress, but:) shouldn't the library handle this? As in, I want to run "echo hello" in my container. Shouldn't the library to the fork/exec/sync and then re-exec my "echo hello"?
|
You'll need to sign your commits since Travis is complaining. |
Signed-off-by: Andrew Vagin <[email protected]>
Signed-off-by: Andrew Vagin <[email protected]>
Signed-off-by: Andrew Vagin <[email protected]>
After forking a new processes in a new container, we need to call exec() and tune namespaces. Signed-off-by: Andrew Vagin <[email protected]>
|
LGTM, please sign your commits and we can merge. Thanks for the patch! It is smaller and simpler than I thought it'd need to be. |
|
@vmarmol I have signed my commits. Thanks. |
|
The CI is complaining that some files are not gofmt'ed mind running it through that? This LGTM, we're just waiting on having the CI go green. |
Here is a first step to implement a new API. Currently the init processes is executed without namespaces and cgroups. Signed-off-by: Andrew Vagin <[email protected]>
Signed-off-by: Andrey Vagin <[email protected]>
6da6033 to
44024d0
Compare
|
Thanks @avagin! LGTM, merging. |
Prepare ground for moving on new API
This series allows to start an init process in a new CT. In this version CT isn't created actually. This will be done in future patches.
I need to get answers on a few questions to continue this work.
If the container isn't started yet, this function will create a process in a new set of namespaces.
If the container is running, a new process will be created in the set of namespaces which belong to the container.
If all processes in the CT have died, this function will create a process in a new set of namespaces ().
If all those statements are true, it looks strange that we don't want to know when a new container is created and when a process is executed in an existing container.