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

Windows libnetwork integration #20478

Merged
merged 1 commit into from Mar 10, 2016
Merged

Windows libnetwork integration #20478

merged 1 commit into from Mar 10, 2016

Conversation

msabansal
Copy link
Contributor

This commit brings in the initial version of the windows libnetwork integration for networking.

  • Most of the code is common between the Linux and windows implementation so that has been pulled into common files.
  • TP4 builds don't have support for HNS so they will continue to work with the older model (os version check is performed in initNetcontroller in daemon_windows.go)
  • We don't support hot add or removal of network devices so the implementation is missing with proper error being returned in those cases
  • The default network mode in Windows is "NAT" and not "bridge". Some of the common libnetwork code relied on the name being "bridge". I have updated that to query the DefaultDaemonNetworkMode
  • The engine-api changes are still pending to be merged so I have vendored my branch temporarily
  • HNS (windows networking service) maintains the networks and we query and add the networks from HNS at daemon startup.
  • Nic addition is not performed by libnetwork as in the case of Linux. This work is done by HNS and that information is passed as part of config to HCS at container start.
  • I have added a build script to build only windows. It was useful for me to create only windows builds (I can remove that if you think it is not required)

@thaJeztah
Copy link
Member

Related engine-API PR is here docker/engine-api#88

@GordonTheTurtle GordonTheTurtle added the dco/no Automatically set by a bot when one of the commits lacks proper signature label Feb 23, 2016
@thaJeztah
Copy link
Member

@msabansal looks like you need to git rebase in stead of merge, so that you won't get a merge commit in your PR. If you need more info; have a look at our contributors guide

@thaJeztah
Copy link
Member

also;

ping @mavenugo if you have time to check if this LGTY

@GordonTheTurtle GordonTheTurtle removed the dco/no Automatically set by a bot when one of the commits lacks proper signature label Feb 23, 2016
@msabansal
Copy link
Contributor Author

@thaJeztah Thanks. Done

@@ -56,6 +56,7 @@ type Command struct {
Isolation string `json:"isolation"` // Isolation technology for the container
ArgsEscaped bool `json:"args_escaped"` // True if args are already escaped
HvPartition bool `json:"hv_partition"` // True if it's an hypervisor partition
EpList []string `json:"endpoints"` // List of network endpoitns for HNS
Copy link
Member

Choose a reason for hiding this comment

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

Typo 'endpoitns'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@mavenugo
Copy link
Contributor

@msabansal @thaJeztah will get to this PR soon.

@icecrime icecrime added the status/failing-ci Indicates that the PR in its current state fails the test suite label Feb 29, 2016
@thaJeztah
Copy link
Member

@msabansal looks like this needs a rebase 😢

@msabansal
Copy link
Contributor Author

@thaJeztah done.

How can we restart the experimental & windowsTP4 tests? They seem to failing for some configuration issues and look to be transient errors

@cpuguy83
Copy link
Member

cpuguy83 commented Mar 1, 2016

@msabansal done.

@msabansal
Copy link
Contributor Author

@cpuguy83 :) These tests will take some effort to pass

@icecrime icecrime removed the status/failing-ci Indicates that the PR in its current state fails the test suite label Mar 2, 2016
@lowenna
Copy link
Member

lowenna commented Mar 3, 2016

Screenshot of CI passing, complete with timestamp, included for posterity... Jenkins flakiness has been troublesome for getting a clean run, but that's being worked on independently by multiple people.

@icecrime @calavera @cpuguy83 @tiborvass @thaJeztah @powersplay @friism Can we please get this moved to code review? This is a super critical PR to get merged ASAP in support of the HNS/libnetwork integration for TP5. All issues have been resolved - it LGTM from my review.

@mavenugo @mrjana - Madhu/Jana, please can you code review as a priority?

image

@thaJeztah
Copy link
Member

ping @mavenugo PTAL

@vdemeester
Copy link
Member

It's not completely related to the PR but I feel like container.go and container_operations.go are getting quite big and the changes moved back from container_unix.go could go to a container_network.go (same for container_network_operations.go.

return nil
}

func getEndpointPortMapInfo(ep libnetwork.Endpoint) (nat.PortMap, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI. There is a design change happening on this one via moby/libnetwork#810.
As you can see in the review, we are trying to have no impact to existing functionalities or drivers.
I will let @aboch review this piece of code and confirm.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just as a note that all these changes to the port-mapping handling are just moving the code
from container_unix.go to container.go so that it is equally applicable to windows platform as well.

So, that makes it a bit more easier.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mavenugo I am not planning to make big changes to this code anymore, as we need to still send the exp ports and port mapping to the drivers during create endpoint.
And yes this PR's change does not affect that, as it is only moving the code to platform independent files.

@mavenugo
Copy link
Contributor

mavenugo commented Mar 3, 2016

@msabansal could you please confirm that the functions added back to container.go and container_operations.go are simply moving it from its *unix.go counterpart ?
Since that is the bulk of the work, I would like to get that confirmation and that would help a great deal with code-review.

@calavera
Copy link
Contributor

calavera commented Mar 3, 2016

bulk of these changes LGTM. I agree with @vdemeester that this is a perfect opportunity to structure those functions a little bit better.

could go to a container_network.go (same for container_network_operations.go)

I like this.

@lowenna
Copy link
Member

lowenna commented Mar 3, 2016

@calavera @vdemeester Can I suggest the restructuring comes in a follow-up PR?

@msabansal
Copy link
Contributor Author

@mavenugo @mrjana We do need libnetwork to be revendored again before this PR is merged(we renamed the windows drivers to be lowercase). Is there a plan to revendor it or should I work on getting that done?

@mavenugo
Copy link
Contributor

mavenugo commented Mar 3, 2016

@msabansal yes. we are planning on the vendoring shortly.

BTW, am +1 with @calavera & @vdemeester as well.

@msabansal
Copy link
Contributor Author

@mavenugo Yes most of the code is just refactoring and moving it to the common location.

I have addressed the one concern we had and renamed Subnet to FixedCIDR

@mavenugo
Copy link
Contributor

mavenugo commented Mar 4, 2016

Thanks @msabansal. I don't have any other comment.

We just have to wait for the next libnetwork vendor in. We are planning on pulling in a bunch of fixes
(including the windows fixes) tomorrow.

BTW, am fine with doing the container_network.go code reshuffling in a follow up PR.

@@ -38,7 +33,7 @@ func (daemon *Daemon) setupLinkedContainers(container *container.Container) ([]s
var env []string
children := daemon.children(container)

bridgeSettings := container.NetworkSettings.Networks["bridge"]
bridgeSettings := container.NetworkSettings.Networks[runconfig.DefaultDaemonNetworkMode().NetworkName()]
Copy link
Member

Choose a reason for hiding this comment

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

Why not assigning runconfig.DefaultDaemonNetworkMode().NetworkName() to a var instead of calling it several time 👼

@vdemeester
Copy link
Member

@jhowardmsft I would think it's not that big a deal to just move the piece of code brought back into non …_unix.go file, as a first simple state. But it could be done in a follow-up PR, that's true (just think it would make sense in this one).

Few nits comments, but overall I'm LGTM 🐰 too .

@calavera
Copy link
Contributor

calavera commented Mar 8, 2016

This depends on #21019 Please, do not merge until that PR is merged.

@icecrime
Copy link
Contributor

@msabansal #21019 is now merged! Can you please rebase?

@GordonTheTurtle
Copy link

Please note that concept of execdrivers is being replaced with OCI compliant binaries executed through containerd. There is an ongoing effort for switching to containerd in #20662 . Please consider porting the changes in your PR to this branch instead.

Signed-off-by: msabansal <sabansal@microsoft.com>
@lowenna
Copy link
Member

lowenna commented Mar 10, 2016

@msabansal Ignore the Gordon comment. I've asked Darren to talk to you about that, and will catch up internally if you have more questions. For other reviewers/maintainers, this change is completely independent of the containerd effort and should be merged into master in its own right to support progress on TP5 before the containerd work is complete.

@thaJeztah
Copy link
Member

ping @calavera @vdemeester @mavenugo please review

@mavenugo
Copy link
Contributor

bulk of the changes are simply code re-organizing to make most of the networking code relevant for windows. As agreed earlier in the thread, we can consolidate better, but that doesn't block this PR.

still LGTM.

@lowenna
Copy link
Member

lowenna commented Mar 10, 2016

Is this good now?

@icecrime
Copy link
Contributor

All good 🎉 Thanks!

icecrime pushed a commit that referenced this pull request Mar 10, 2016
Windows libnetwork integration
@icecrime icecrime merged commit 2b8e7ad into moby:master Mar 10, 2016
@msabansal
Copy link
Contributor Author

Thanks :)

@thaJeztah
Copy link
Member

Congrats on your first PR merged in Docker @msabansal !

@msabansal
Copy link
Contributor Author

@thaJeztah Thanks :)

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.

None yet

10 participants