Skip to content

Move LXC into a sub pkg and provide initial execution driver interface - #3580

Merged
creack merged 34 commits into
moby:masterfrom
crosbymichael:extract-lxc
Jan 18, 2014
Merged

creack merged 34 commits into
moby:masterfrom
crosbymichael:extract-lxc

Conversation

@crosbymichael

Copy link
Copy Markdown
Contributor

This is phase one migrating the lxc code outside of the docker core. It is not the final driver interface but makes it easier to move toward the final result.

Comment thread execdriver/chroot/driver.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be better to return the actual object instead of the interface

@crosbymichael

Copy link
Copy Markdown
Contributor Author

Still need work on lxc config template generation

Comment thread execdriver/lxc/driver.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same thing here (return object instead of interface)

@alexlarsson

Copy link
Copy Markdown
Contributor

How does this differ from the plugin API in https://github.com/jpoimboe/docker/commits/libvirt-lxc (which already splits out the lxc code into a plugin and additionally has a libvirt implementation).

@alexlarsson

Copy link
Copy Markdown
Contributor

(Also, it removes the ghost state totally, even for lxc)

@jpoimboe

Copy link
Copy Markdown
Contributor

This execution driver interface won't work with libvirt-lxc. It still assumes that the container is a child process of the docker daemon. But in libvirt-lxc, containers are started by a remote daemon. So things like console handling, process exit wait/code, and top are handled completely differently.

As @alexlarsson mentioned it would be a good idea to take another look at the plugin interface that I implemented months ago and have been rebasing against upstream ever since.

It requires a long-running dockerinit, but there seems to be agreement in #3240 that a long-running dockerinit is necessary for proper signal handling and zombie killing (and it has many other benefits as well). It also helps clean up the execution driver interface nicely, and gets rid of the Ghost state.

Comment thread server.go Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should we change key for this now?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1, especially since this isn't really part of the "public interface" to /info, and ought to match what we do for the graph drivers, IMO (including especially telling us "which one" for debugging people's odd chroot bugs)

@crosbymichael

Copy link
Copy Markdown
Contributor Author

ping @shykes @vieux @unclejack

@vieux

vieux commented Jan 16, 2014

Copy link
Copy Markdown
Contributor

Using the chroot driver:

docker run -i -t ubuntu ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  selinux  srv  sys  tmp  usr  var

=> nice

docker run -i -t crosbymichael/redis bash
[5377] 16 Jan 02:37:48.725 # Fatal error, can't open config file 'bash'
2014/01/16 02:37:48 exit status 1

=> :(

@tianon

tianon commented Jan 16, 2014

Copy link
Copy Markdown
Member

Well hey now @vieux, I get that same thing passing "bash" as the argument to crosbymichael/redis on the current code (without this PR):

$ docker run -i -t crosbymichael/redis bash
[1] 16 Jan 06:54:05.868 # Fatal error, can't open config file 'bash'

That's a problem^W"feature" of ENTRYPOINT. :)

Can you try again without "bash" on the end?

@unclejack

Copy link
Copy Markdown
Contributor

LGTM

Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
crosbymichael and others added 20 commits January 17, 2014 17:42
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Add -driver flag to dockerinit

Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <[email protected]> (github: creack)

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <[email protected]> (github: creack)

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <[email protected]> (github: creack)

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: crosbymichael)
@vieux

vieux commented Jan 18, 2014

Copy link
Copy Markdown
Contributor

LGTM

1 similar comment
@creack

creack commented Jan 18, 2014

Copy link
Copy Markdown
Contributor

LGTM

creack added a commit that referenced this pull request Jan 18, 2014
Move LXC into a sub pkg and provide initial execution driver interface
@creack
creack merged commit fec97e7 into moby:master Jan 18, 2014
@crosbymichael
crosbymichael deleted the extract-lxc branch January 18, 2014 02:10
@crosbymichael

Copy link
Copy Markdown
Contributor Author

@alexlarsson @jpoimboe

This is only a small first step to remove the LXC dependency out of the core of docker. We have been looking at your PR while we design the API. As we discussed the other day on IRC we can setup a weekly meeting via IRC to discuss work being done on both sides so we can get the libvirt code merged soon. I think we are planning meeting Wednesdays at 9am pst in irc to make sure we all are on the same page with execution drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants