Skip to content

driver-opts for network create#17046

Merged
tiborvass merged 2 commits intomoby:masterfrom
mavenugo:dopts
Oct 16, 2015
Merged

driver-opts for network create#17046
tiborvass merged 2 commits intomoby:masterfrom
mavenugo:dopts

Conversation

@mavenugo
Copy link
Contributor

As discussed #16910 (comment), am filing this PR after yanking the driver-opts from #16910.
Also renamed labels to DriverOpts in libnetwork via the vendor-in.

ping @icecrime @tiborvass

@thaJeztah
Copy link
Member

I think this is intended for 1.9, so adding it to the milestone :)

@icecrime
Copy link
Contributor

We're in code freeze, I let @tiborvass decide but we should only be accepting bugfixes.

@mavenugo
Copy link
Contributor Author

@icecrime i understand. This is one of the requests that pretty much all the network plugin devs requested for. Its infact discussed in various libnetwork PRs. We couldnt get it in before because of various UX uncertainties. This also brings the network create ux inline with volume create for all the drivers. Since this is a very small patch but have a huge upside for the external plugins, I request you to consider getting this useful patch in. btw, the risk is very low because, we have been using the driver-opts backend from 1.7 release onwards for the default docker0 bridge.

@dave-tucker
Copy link
Contributor

👍 for having this in 1.9
Those affected - or at least those that I remember having asked for this are: @tomdee, @thockin, @shettyg, @squaremo, @erikh and @FlorianOtel
As we've missed code freeze on this one I'd appreciate if you could let us know the impact to your projects, if any, of this slipping to 1.10

@shettyg
Copy link

shettyg commented Oct 15, 2015

@dave-tucker

Labels support is very important for my plugin. Unfortunately, just the label support passed to network create does not add a lot of value for me (others may have a different requirement). I would really like labels support for both network create as well as endpoint create.

@calavera
Copy link
Contributor

I think not supporting options in 1.9 is pretty much a bug, otherwise people won't be able to configure networks.

@shettyg
Copy link

shettyg commented Oct 15, 2015

On a higher level, most of us would really love to have libnetwork used for all our docker networking needs. It so happens that most of us (plugin writers) have our own networking backend with our own special needs. A little bit of extra help via labels lets us have a good integration of docker with the underlying infrastructure.

@mavenugo
Copy link
Contributor Author

@shettyg I realized very late that the primary reason for the confusion is the word label. Though it carries the same map[string]string such as the -opt, it has a different meaning altogether.
Hence, we must be calling these driver-opts in order to differentiate itself clearly from labels.

Infact the reason this PR was split from #16910 because of that confusion.

By having this PR in, users can configure flexible driver options while creating the network. It is a first step towards future enhancements..

@shettyg
Copy link

shettyg commented Oct 16, 2015

@mavenugo
Driver options for network create will be a welcome iniital addition.

Copy link
Contributor

Choose a reason for hiding this comment

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

I know it's not part of this PR, but it really bothers me that some comment strings start with capital letters and other not. This new option could also be a little more descriptive, but I understand that options are optional 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure. will fix that.

@calavera
Copy link
Contributor

@mavenugo any way we can have a test case?

@mavenugo mavenugo assigned calavera and unassigned calavera Oct 16, 2015
@mavenugo
Copy link
Contributor Author

@calavera i added a simple test in integration-cli/docker_api_network_test.go.
Since these are driver specific options, the functionality is entirely driver specific and we cannot add a test case for that. All we can make sure is that the options configured by the user is properly processed at the libnetwork level and returned back correctly in the inspect (which is covered in the above test).

@mavenugo
Copy link
Contributor Author

@calavera i can possibly add a dummy remote plugin and make sure the passed options infact reach the dummy remote plugin. Do you think that works ?

@vdemeester
Copy link
Member

@mavenugo I would think so yeah 👍

@tomdee
Copy link
Contributor

tomdee commented Oct 16, 2015

A dummy remote plugin would really help with testing. During libnetwork development, remote plugins have been broken too many times because of a lack of automated testing.

And as I said in #16910 (comment) , network labels would be nice to have.

@mrjana
Copy link
Contributor

mrjana commented Oct 16, 2015

@tomdee Thankfully that's not true anymore. We do have automated testing in libnetwork which employs a dummy remote plugin in many of our tests to make sure there are no regressions in remote plugin protocol.

@tomdee
Copy link
Contributor

tomdee commented Oct 16, 2015

👍 That's good to hear!

@calavera
Copy link
Contributor

@mavenugo @mrjana if we already have a dummy plugin in libnetwork, we can probably port it to use it here easily if we add it to the testutils package in libnetwork, we don't need to duplicate it 😸

https://github.com/docker/libnetwork/tree/master/testutils

@mavenugo
Copy link
Contributor Author

@calavera @vdemeester udpated with comments addressed.
Yes, I already had a dummy network plugin added in the existing tests and am reusing it for this -opts case.

@calavera
Copy link
Contributor

awesome, thanks.

LGTM

@tiborvass tiborvass self-assigned this Oct 16, 2015
Copy link
Contributor

Choose a reason for hiding this comment

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

as a TODO you should probably rename the netlabel package too

@tiborvass
Copy link
Contributor

LGTM

@tiborvass
Copy link
Contributor

I'll be cherrypicking this to 1.9 because it was originally bundled in another PR that was later merged but we were the ones who asked to move it to a separate PR.

@mavenugo
Copy link
Contributor Author

thanks @tiborvass @calavera @icecrime you made network plugin devs very happy.

@thaJeztah
Copy link
Member

Just asked @moxiegirl and docs-changes for this will also be in a separate PR that brings in all changes related to networking, so

docs LGTM

@vdemeester
Copy link
Member

@mavenugo yay cool 😻 👍

@tiborvass
Copy link
Contributor

@mavenugo sorry needs a rebase :(

@calavera
Copy link
Contributor

nooooooo!!!!!!!!!! 😿

@vdemeester
Copy link
Member

oh noooeeesss 🙀

@mavenugo
Copy link
Contributor Author

:) done. checker PR(s), pls show some mercy.

@tiborvass
Copy link
Contributor

@mavenugo conflict was only in tests?

@vdemeester
Copy link
Member

@mavenugo @tiborvass yeah, only integration tests, my bad 😱

@vdemeester
Copy link
Member

It's green 🎉

tiborvass added a commit that referenced this pull request Oct 16, 2015
driver-opts for network create
@tiborvass tiborvass merged commit 365a0db into moby:master Oct 16, 2015
@tiborvass tiborvass removed their assignment Oct 22, 2015
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.