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

Split start/create #506

Closed
wants to merge 1 commit into from
Closed

Split start/create #506

wants to merge 1 commit into from

Conversation

duglin
Copy link

@duglin duglin commented Jan 22, 2016

First pass at splitting create and start.
runc create will create all of the namespaces, except PID.
runc start will then run the main proc.
There's runc delete too for when you're done.
Also added runc batch <list of commands file> to show how you could do create+a series of cmds.
And added runc run <cmd> which is like runc exec but uses a main proc - again just for demo purposes. Not sure if we want to add batch/run to runc proper but it was an interesting exercise.

Any way, I'm not convinced all of this is correct - i think the new 'mount' property probably needs to go away but I wanted to let people play with it to see how it felt to use create and start separately.

@cyphar
Copy link
Member

cyphar commented Jan 23, 2016

I'm not really grokking the benefits of separating the two? I understand in the Docker case (you get a flashy new containerID and all of the magic with filesystem layers is done during create time), but runC doesn't do any of those things -- what do you get out of having a separate create and start stage?

@duglin
Copy link
Author

duglin commented Jan 23, 2016

@ashahab-altiscale
Copy link
Contributor

@duglin Have you tested this with userns? Also, are the bugs with joining a previously created userns fixed?

@duglin
Copy link
Author

duglin commented Jan 27, 2016

@ashahab-altiscale no I haven't tried with userns - if someone can tell me how to do that I'll give it a try.

@duglin
Copy link
Author

duglin commented Jan 27, 2016

rebased

@ashahab-altiscale
Copy link
Contributor

Add user to the namespaces in runtime.json. Add uidMappings. Chown the
rootfs. And check /proc/pid/uid_map once process is started.
On Jan 26, 2016 6:29 PM, "Doug Davis" [email protected] wrote:

rebased


Reply to this email directly or view it on GitHub
#506 (comment).

@duglin duglin force-pushed the SplitDeux branch 3 times, most recently from 6932329 to 2307102 Compare January 28, 2016 23:30
@duglin
Copy link
Author

duglin commented Jan 28, 2016

rebased - detach was a little painful :-)

@ashahab-altiscale
Copy link
Contributor

@duglin I get a fork/exec perm denied with userns. I'm on centos. Do you see anything different?

@duglin
Copy link
Author

duglin commented Jan 30, 2016

@ashahab-altiscale helped me test this and it does appear to work with userNS.

ping @crosbymichael @LK4D4 @mrunalp is this headed in the right direction?

@duglin duglin changed the title WIP: Split start/create Split start/create Jan 30, 2016
@duglin duglin force-pushed the SplitDeux branch 9 times, most recently from c4eaa7c to 69474d1 Compare February 10, 2016 18:13
@duglin
Copy link
Author

duglin commented Feb 10, 2016

Fixed an issue where the "Created" timestamp was set during 'start' instead of 'create'.

@crosbymichael are there specific issues you'd like to discuss/focus on, or is it just a matter of giving people time to review and become comfortable with it?

@duglin
Copy link
Author

duglin commented Feb 20, 2016

@duglin duglin force-pushed the SplitDeux branch 4 times, most recently from 4a6f631 to ce12b03 Compare February 29, 2016 14:26
@duglin
Copy link
Author

duglin commented Mar 7, 2016

rebased (again)

@duglin
Copy link
Author

duglin commented Mar 8, 2016

While in there, to show why someone may want it, I also added support for:
runc run cmd args...
runc batch batchFileOfCommands | -

Signed-off-by: Doug Davis <[email protected]>
@duglin
Copy link
Author

duglin commented Mar 16, 2016

rebased

@@ -360,6 +434,28 @@ func newPipe() (parent *os.File, child *os.File, err error) {
func (c *linuxContainer) Destroy() error {
c.m.Lock()
defer c.m.Unlock()

namespaces := []string{"NEWIPC", "NEWUTS", "NEWNET", "NEWPID", "NEWUSER", "NEWNS", "NEWMNT"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only try to unmount the ones in the config.

@vishh
Copy link
Contributor

vishh commented Mar 23, 2016

@duglin: I rebased this PR locally and am I trying to test and review it along the way!

return nil, err
}
return &initProcess{
cmd: cmd,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this cmd equivalent to that of the init process defined in the Spec?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this line answering my question partly.

@philips
Copy link

philips commented May 4, 2016

@duglin can you write-up a high level write up of the theory of operation?

@duglin
Copy link
Author

duglin commented May 5, 2016

@philips see if the intro comment on opencontainers/runtime-spec#384 has what you're looking for. If not I can add more.

stefanberger pushed a commit to stefanberger/runc that referenced this pull request Sep 8, 2017
Closes opencontainers#506

Signed-off-by: Michael Crosby <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants