Skip to content

devicemapper: exclude from static Docker builds - #10664

Closed
unclejack wants to merge 1 commit into
moby:masterfrom
unclejack:disable_devicemapper_static
Closed

unclejack wants to merge 1 commit into
moby:masterfrom
unclejack:disable_devicemapper_static

Conversation

@unclejack

Copy link
Copy Markdown
Contributor

This PR disables the building of the devicemapper graph driver for static Docker binaries.

As @vbatts has pointed out in #10195 and other PRs which are meant to fix #4036, devicemapper needs to allow udev to create the block device. However, statically linking in devicemapper doesn't make it possible for devicemapper to still be linked to udev. Not being able to use udev leads to udev racing with devicemapper, thus causing problems.

Disabling the building of devicemapper for static binaries is required. This won't affect distributions such as CentOS, RHEL, Fedora and others where dynamically linked Docker binaries are provided.

Having devicemapper built in for statically linked Docker binaries doesn't make sense - we know for a fact issues will arise due to the lack of communication between devicemapper and udev.

The next step is to provide distribution specific package repositories and recommend specific drivers for certain distributions as needed.

@unclejack

Copy link
Copy Markdown
Contributor Author

Requires #10660 to be merged first it has been merged

@SvenDowideit

Copy link
Copy Markdown
Contributor

mmmm, interesting. atm, devicemapper 'works' on boot2docker - does this mean it will stop?

@unclejack

Copy link
Copy Markdown
Contributor Author

@SvenDowideit boot2docker will need udev, devicemapper and dynamically linked Docker binaries.

@vbatts

vbatts commented Feb 10, 2015

Copy link
Copy Markdown
Contributor

then lets dynamically link the binary that is used in b2d ...

@SvenDowideit

Copy link
Copy Markdown
Contributor

please remember that today's b2d is a 32 bit userspace running on a 64 bit kernel, with some carefully written 8 bit shell scripts.

Though there is someone working on porting it to 64 bit userspace, we might also have to evaluate other options.

@vbatts

vbatts commented Feb 10, 2015

Copy link
Copy Markdown
Contributor

oh man

@SvenDowideit

Copy link
Copy Markdown
Contributor

y, its positively amazing how many variations of systems Docker can run on.

@rhvgoyal

Copy link
Copy Markdown
Contributor

makes sense to me. If we can't support device mapper functionality in static linking mode, it is better to disable it instead of dealing with constant stream of bugs. In fact even if a genuine bug comes along, first some energy is wasted in trying to rule out that it is not happening because of udev issues.

@unclejack

Copy link
Copy Markdown
Contributor Author

This needs to move forward. #4036 is getting a lot of comments from people using devicemapper with the static Docker binaries.

@vbatts

vbatts commented Feb 19, 2015

Copy link
Copy Markdown
Contributor

LGTM

1 similar comment
@rhvgoyal

Copy link
Copy Markdown
Contributor

LGTM

@rhvgoyal

Copy link
Copy Markdown
Contributor

BTW, if we disable this, what will be default storage graphdriver on static binary?

@unclejack

Copy link
Copy Markdown
Contributor Author

@rhvgoyal We'll have to discuss how we handle falling through to all other usable options (aufs, btrfs, overlay) and throw an error to make it clear that the requirements aren't met for any of the desirable graph drivers.

@vbatts

vbatts commented Feb 19, 2015

Copy link
Copy Markdown
Contributor

@rhvgoyal

INFO[0000] docker daemon: 1.4.1-dev 4a2f90e; execdriver: native-0.2; graphdriver: vfs 

@unclejack perhaps ^ should have a warning too?

@unclejack

Copy link
Copy Markdown
Contributor Author

@vbatts IMO, we should error out if we're down to vfs and we weren't told to use vfs explicitly. e.g.: Docker shouldn't use vfs if it's not told explicitly to use it and it should error out if falls through down to vfs because it couldn't use any of the better options.

@rhvgoyal

Copy link
Copy Markdown
Contributor

@unclejack

So what's the downside of using vfs by default (if nothing better is available). IIUC, this probably means that there is no sharing between containers and there will be multiple copies of common data between containers?

If yes, IMHO, using vfs as last option by default is better than failing. We can put a big fat warning about data usage thing. Again, my view point is that one should be able to launch containers without much configuration and then figure out later how to tune it better to make it perform better and make storage efficient.

@unclejack

Copy link
Copy Markdown
Contributor Author

@rhvgoyal The problem with making vfs any kind of default is that most users won't notice it, nor will they know why that's a bad thing. The main point is that the first contact with Docker needs to be as painless as possible when the requirements are met. However, vfs shouldn't be used for anything other than testing. We've had some reports from users who were just starting and didn't know vfs shouldn't be used.

@rhvgoyal

Copy link
Copy Markdown
Contributor

@unclejack

Ok. I am not aware of what user group downloads the pre-built static binaries and whether they already have support of aufs, btrfs or overlayfs or not. I hope not many people face this error.

So no objections from my side to error out on VFS. If too many people complain about it, we should
be able to change it again.

@thaJeztah

Copy link
Copy Markdown
Member

For people installing via https://get.docker.io, would it be possible to include the contrib/check-config.sh as part of the installation procedure?

@vbatts

vbatts commented Feb 19, 2015

Copy link
Copy Markdown
Contributor

@unclejack though it is curious, that even vfs is defaulted to instead of overlay for me. :-)

@unclejack

Copy link
Copy Markdown
Contributor Author

@vbatts

vbatts commented Feb 19, 2015

Copy link
Copy Markdown
Contributor

@unclejack oh right.

@rhvgoyal

rhvgoyal commented Mar 2, 2015

Copy link
Copy Markdown
Contributor

I am little concerned about testing of devicemapper driver with this patch. IIUC, we build static binary for our tests and now devicemapper not being built with static binary, it will not get any of the testing and might be completely broken soon.

So I would say that this requires little rethink.

I guess first there is a need to make automated testing work with dynamically build docker and with devicemapper and then one can disable compiling support of device mapper with static docker.

@jessfraz jessfraz added this to the 1.6.0 milestone Mar 4, 2015
@jessfraz

jessfraz commented Mar 4, 2015

Copy link
Copy Markdown
Contributor

I added the 1.6.0 milestone because that is doable right? would we need @tianon help w everything after this is merged

@tianon

tianon commented Mar 5, 2015

Copy link
Copy Markdown
Member

@jfrazelle I have an idea, but I'm not sure it's a very good one... I'd like your thoughts on it.

If we swap the order at https://github.com/docker/docker/blob/620339f166984540f15aadef2348646eee9a5b42/project/make/.integration-daemon-start#L5 so that dynbinary is added to PATH before binary, then we could update https://github.com/docker/docker/blob/620339f166984540f15aadef2348646eee9a5b42/project/make.sh#L49-L55 so that we build binary, then run all the tests, then build dynbinary, then run test-integration-cli a second time, and that would actually work (and test against both static and non-static Docker).

@snitm

snitm commented Mar 6, 2015

Copy link
Copy Markdown
Contributor

Why exactly are you guys clinging to static builds? Some perceived cross distro utopia? One build to rule them all? Foolish. And to be clear: it is udev that doesn't support static builds; there is no static udev library.

@unclejack

Copy link
Copy Markdown
Contributor Author

@snitm Static builds are foolish in the context of linking udev+devicemapper into the binary. Having a Docker binary without dependencies on external libraries would be OK. That's one awesome thing about Go: when not linking against external libraries/code, you can just build a static binary to deploy it without additional dependencies. This is also awesome when making small Docker images with a single binary in them.

@snitm

snitm commented Mar 6, 2015

Copy link
Copy Markdown
Contributor

@unclejack no it is foolish because there could be distro specific capabilities/fixes available in the dynamic libraries that you shouldn't need to update docker to get. It also has the effect of making docker only as capable/strong as the weakest distro that Docker, Inc. supports. I'll grant you that normalizing docker's capabilities across all distros by throwing away features that don't conform to your misplaced definition of "awesome" makes for a much narrower support matrix. But given you're left with the inability to leverage exceptional distros' features/fixes: spinning static builds as anything but self-serving to Docker, Inc. is pretty disingenuous.

vbatts added a commit to vbatts/moby that referenced this pull request Mar 16, 2015
vbatts added a commit to vbatts/moby that referenced this pull request Mar 16, 2015
vbatts added a commit to vbatts/moby that referenced this pull request Mar 17, 2015
@unclejack

Copy link
Copy Markdown
Contributor Author

This PR was useful because of the conversations around it and because it helped lead to the final solution. However, the final solution is #11412 and this PR needs to be closed.

@unclejack unclejack closed this Mar 18, 2015
vbatts added a commit to vbatts/moby that referenced this pull request Mar 31, 2015
vbatts added a commit to vbatts/moby that referenced this pull request Apr 6, 2015
@unclejack
unclejack deleted the disable_devicemapper_static branch June 16, 2015 17:35
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.

docker fails to mount the block device for the container on devicemapper

9 participants