-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Networks & Services API & UI #13441
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
Networks & Services API & UI #13441
Conversation
api/client/network.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of sending "docker" here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NetworkCli takes in the "chain" parameter for better --help reasons.
Since libnetwork is an ingredient that provides networking service to docker, but also it has its own independent tool named dnet (which does everything networking). The same CLI chain under network is reused for both the cases. Hence passing the actual chain the network UI belongs to helps with consistent and better --help output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok... so you want "docker" to display in the help output.
Should this be os.Args[0] instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok... so you want "docker" to display in the help output.
Yes.
Should this be os.Args[0] instead?
Good point :-) . i will fix that.
|
(Not in docs review yet, but a heads-up to prevent having to rewrite twice :)) Is this planned to be part of the 1.7 release? If not, the API docs will have to be moved to the v1.20 version, once created. Also, the new end points will need to be added to the "what's new" section of the API docs |
runconfig/parse.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we need to add a validation for an empty string, which this default clause was catching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. will fix it.
|
@thaJeztah Yes, this is planned to be part of 1.7 and I believe @dave-tucker is working with @moxiegirl on this. |
|
@mavenugo alright, thanks for checking. I'll add it to the milestone as well then, to better keep track. |
|
I will have to test this out tomorrow, but this looks really sweet. |
|
@cpuguy83 Thanks. the basic |
|
@thaJeztah There is a long answer and a short one. Let me get geeky and give the longer answer ;-). So, the short answer to the question is This approach also helps docker not to be overloaded with unlimited deployment scenarios and let the ecosystem provide solutions for a variety of user needs. |
|
@mavenugo thanks, sounds really good! I'll add that to my answer on the linked issue. |
|
@mavenugo couple of things:
mynet=$(docker network create foo)
docker run -itd --net=$mynet busyboxWe could also go one step further and make |
|
@dave-tucker Good suggestions. will fix them. We originally designed the network name as optional parameter in create using |
|
PLEASE DO NOT MERGE UNTIL WE COMPLETE THE UI DISCUSSION. We have not yet resolved whether we want the user-facing terms to be "networks" or "services". Feel free to discuss here. But please do not railroad. Thx. |
|
Here is a strawman for a UI. |
|
Here the concept of "active scope" should be a client-side one, I think. No need to burden the daemon with this. In other words, the Remote API should always require an explicit scope name. |
|
A possible variation is to not use the Variation 1: |
|
Another possible variation: in Variation A: Variation B: Variation B combined with variation 2 above for maximum conciseness: |
|
@shykes thanks for sharing your thoughts on this important service construct. I would like to put forward a couple of alternative suggestions to consider :
Will it help if we modify this PR into a more simplified version that supports just the
This UI along with maybe an experimental Since the back-end can have multiple endpoints attached to it on different scopes, it would make this run option as a list : one other aspect is the swappability requirement of the container back-end with the service endpoint. We might have to introduce another option to have the user control if it allows service updates. Ofcourse, I feel there is lot more to the Please share your opinion. |
|
May I point out that users do not necessarily want to use docker's idea of services to provide networking. In particular, if they are using docker with other tools. So while I appreciate the urge to provide an expressive user interface, I would be very wary of obscuring networking with a service abstraction -- i.e., making service commands (and |
|
@ibuildthecloud if am not wrong there is one scheduled. @dave-tucker. |
|
I think an IRL discussion would be way better than hashing it out here. We Maybe you (Madhu) can pick a timeslot and a meeting place and let the On Tue, Jun 16, 2015 at 6:12 PM, Madhu Venugopal notifications@github.com
|
libnetwork serves APIs for /networks/ resources. register it as a Sub-Router with docker daemon's Router Signed-off-by: Madhu Venugopal <madhu@docker.com>
Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit brings in the ability to specify a default network and its corresponding driver as daemon flags. This helps in existing clients to make use of newer networking features provided by libnetwork which includes multi-host networking capabilities. Also, in order to enable multi-host capabilities, the kvstore configs are enabled as daemon flags. Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit makes use of the CNM model supported by LibNetwork and provides an ability to let a container to publish a specified service. Behind the scenes, if a service with the given name doesnt exist, it is automatically created on appropriate network and attach the container. Signed-off-by: Madhu Venugopal <madhu@docker.com>
Signed-off-by: Dave Tucker <dt@docker.com>
|
@ibuildthecloud no. PR #13977 was opened just to continue the specific discussion brought up on reusing We introduced the CNM model more than a month ago and we are unable to make use of it due to this UI discussion. I feel that the current balance that we have with network and service UI along with |
|
@mavenugo Sorry, this is not really constructive, but this whole discussion confuses me quite a bit. But if I understand correctly we are choosing between networks or services. We are also saying that the CNM may be nullified? |
|
@ibuildthecloud please go over the docs commit : mavenugo@31bfd53 and that should clear up the latest status of this PR. After reviewing the docs, if you can give give it a hands on trial, I think that will answer your own question. |
|
Given the debate, I think separating networks and services into different On Tue, Jun 16, 2015 at 10:03 PM, Madhu Venugopal notifications@github.com
|
|
@mavenugo Thanks, that helped a lot. Services is an abstraction above containers but from what I read from those docs it's basically one-to-one. How do we envision this services concept evolving. In the current form in this PR, it does not seem to be the proper use of the term service because effectively a service is just an IP and DNS name for a container. So basically an endpoint in the CNM. |
|
Something seems off too me. The problem I see is that people looking to implement network drivers will most definitely come from a networking background (duh). So I imagine we will see VXLAN, VLAN, OVS, NSX, etc. All of these technologies give you a virtual L2 network. Service is very high level concept. Publishing and discovering services is an even higher level concept. By saying you publish a service to a network seems like we are mixing layers. I have this very high level concept that will in practice be tied to a L2 boundary. Frankly, I lean much more towards not even exposing the concept of a network to the user. Just talk about services and their relationship. Networking can be implied from service relationships. |
|
@ibuildthecloud I think there may have been some conflating of the layers, which is why separating the services and networks PRs seems like a sensible way forward. It is disappointing that it looks like there is little chance of getting this resolved (and anything implemented) in time for 1.7. But at least DockerCon will give those of us who can make it a chance to discuss face to face, which should help reach a shared understanding faster. I'm part of the Calico team, and therefore "from a networking background", but our philosophy is that developers should not need to worry about low level networking constructs such as L2 segments. They should just be able to express their connectivity requirements in high-level intents, such as "containers of type A need to talk to containers of type B with constraints C" (where a constraint might be only allowing access to a particular port, or a bandwidth constraint, or whatever). We believe the networking layer should sort out how to map that intent into the underlying networking primitives specific to that particular network driver implementation. Having said that, a common use case which we hear from customers, is to be able to support dev, test and prod "networks", that are isolated from each other, without the need to change container or app or service definitions between the networks. If you consider a "network" in this context, then saying a service exists within a network makes a fair amount of sense I think. Anyway, I think I'm falling into the trap of lengthy comments here, when face to face might progress faster. @ibuildthecloud - will you be at DockerCon? It would be great to sync up with you then. I suspect that our thinking may be very similar on most of this once we unpick it! |
If we are going to separate the concerns, wouldn't it make sense to put the (clearly more controversial) services aspect elsewhere, rather than stepping on the bit that seemingly everyone agrees we should have? |
|
To reiterate what @squaremo said a few days ago: "I don't see what was the problem with keeping networking and service discovery distinct (and supporting, say, docker --net=foo ..). It doesn't make sense to hide networking under service discovery, since users may not always want the latter." |
|
@mavenugo In this proposal the concepts are focused on publishing services. What about consumption of services. If I publish db.foo does web need to publish web.foo to consume db in foo? |
|
First part of this, the network UI, has been merged here: #14023 |
|
Are we having a meeting Next week? When and where? On Tue, Jun 16, 2015 at 10:08 PM, Tim Hockin thockin@google.com wrote:
|
|
there is a BoF on Tuesday @thockin |
I don't think you can appeal to popular demand here -- you've just done the thing people found objectionable in two steps instead of one. What I was asking for is a general purpose networks (and endpoints) UI, before jumping into services. I don't think you can close this until at least #13977 or its near equivalent is addressed. As @thockin said,
|
This PR brings in the API & UI support for
networks&servicesresource provided bylibnetwork.networks&servicesresourcedocker network&docker service