Conversation
caa60d7 to
7d25884
Compare
|
Test passed locally (with |
|
👍 |
xnet/util.go
Outdated
| logrus.Debugf("parse proto addr: %s", s) | ||
| parts := strings.SplitN(s, "://", 2) | ||
| if len(parts) == 1 { | ||
| _, _, err := net.SplitHostPort(parts[0]) |
There was a problem hiding this comment.
How can we assume that an error here means we have a unix address?
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
|
Thank you @stevvooe I reverted some changes and did a proper error handling. |
|
@chanwit Are you planning on moving this across to the engine? If not, I'm happy to do it. Thanks :) |
|
@jhowardmsft please do it! Let me know when you start the PR, I'll join you there. |
|
I managed to mostly port this to the engine, as shown in the patch I posted on moby/moby#24189. One issue I found with the code in your pull request is that you are passing an empty string as the second parameter to winio.ListenPipe, but when I attempted to compile this, it failed, as it expected a winio.PipeConfig to be passed instead. I attempted to create a PipeConfig based on another example in the engine. Ultimately, I was able to get the daemon to listed to the pipe, but, when creating a cluster, the client hangs, and when connecting a second client, the node sees itself as a manager, but, when listing nodes, lists itself in a down state. My guess is that I used an incorrect security descriptor, but I really don't have much of a clue. I figured I'd mention this here, as the last few comments mention porting this to the engine. |
|
@stevvooe any plan to merge or close this PR? is there anything that can be improved? |
| ProtoAddr: map[string]string{ | ||
| "tcp": n.config.ListenRemoteAPI, | ||
| "unix": n.config.ListenControlAPI, | ||
| "remote": n.config.ListenRemoteAPI, |
There was a problem hiding this comment.
This doesn't look right. The whole ProtoAddr concept here is a little weird. Both APIs should be mountable to unix or tcp. This makes the mistake of separating control and remote, which is only an implementation detail of docker.
|
@mwieczorek It will probably need a rebase. I think the biggest thing that such a PR needs is to ensure that the APIs can be mounted via any listener. I'm not sure if we want to carry windows support -- ideally that would be handled via downstream projects. It also looks like the concept of control and remote being separated is a little hardcoded -- this should be a lot more flexible in practice. |
To be fair, I don't think this is at all specific to this PR. The |
The policy of what is and isn't exposed belongs in docker, not swarmkit. If we look at the, some really bad things are going on here: ProtoAddr: map[string]string{
- "tcp": n.config.ListenRemoteAPI,
- "unix": n.config.ListenControlAPI,
+ "remote": n.config.ListenRemoteAPI,
+ "control": n.config.ListenControlAPI,
},SwarmKit should provide components that can be served. The level of coupling is dangerous and limits the ultimate usefulness of the project (granted, grpc suffers from this, as well). We may want to expose the GRPC some day, and that should be done by changing the listener for that part of the interface. If we intertwine this into a mess of spaghetti, we are just hurting ourselves in the future. |
|
@chanwit @jhowardmsft What are we missing to move this forward? Windows support would be awesome. |
|
Time ;) I'm on vacation and when back still have a pile of other things before I could start looking at this. |
|
@chanwit Could you please rebase? I think the engine changes are going to be small - we can carry them over if you don't have the time to do them. @aaronlehmann @stevvooe: Any objection in merging this? I see your comments @stevvooe but I think those are unrelated from this PR - those problems were already existing and this PR just adds named pipe support. |
|
I suggest not changing the One reason for this is that moving the protocol from the key to the value is effectively an API change - it requires |
|
@aluzzardi I must also agree with @aaronlehmann regarding changing control/remote back to unix/tcp and adding npipe, as when I attempted earlier to take these changes and apply them to swarmkit in docker, I got issues where at some parts, the tcp:// prefix was not being removed. I was going to make this change myself and reapply it to swarmkit in docker, but hadn't the time to do so. |
|
@aluzzardi I'll rebase it and be taking those comments into account Thank you for all comments. I got some pictures of how to proceed |
|
Thanks @chanwit ! |
|
Hey @chanwit, any news regarding this? No pressure whatsoever but since we'd like to have Windows support we were considering having someone over here carry over the work. However, before doing that I just want to make sure we are not duplicating efforts. |
|
@aluzzardi sorry for being late. I'm eagerly hacking it. |
|
@chanwit No worries! Just wanted to avoid duplicating efforts if we got someone to carry over the changes. Take your time :) We'd like to get support for 1.13 |
|
Any updates on this PR? would love to get this merged so that Windows can be one step closer for supporting Swarm |
|
@JMesser81 I'm still working on this one. As the milestone stated, it will be available by 1.13. |
Integrate xnet package into the modern code xnet package was authored by Chanwit Kaewkasi <chanwit@gmail.com> Integration is largely also based his work PR moby#941. This is a separate commit because a rebase was prohibitively difficult Signed-off-by: Drew Erny <drew.erny@docker.com>
Integrate xnet package into the modern code xnet package was authored by Chanwit Kaewkasi <chanwit@gmail.com> Integration is largely also based his work PR moby#941. This is a separate commit because a rebase was prohibitively difficult Signed-off-by: Drew Erny <drew.erny@docker.com>
|
Closing this, as the windows named pipe functionality was implemented by #1654. |
|
I really want to be able to try this out with Docker's built in swarm mode. From what I can tell, every so often, the Docker repository does a "revendor." Any chance of knowing that repository is going to do this, or how I can do this myself to test it out? |
|
@TheJayMann since #1654 was merged, this functionality should now be in the master builds that you can download here: https://master.dockerproject.org/ There probably are some other gotchas, but ping me on michael.friis@docker.com if you get something working! |
|
It will probably be a few days before it shows up in a master build. As @TheJayMann mentioned, we need to revendor. There is also this PR that needs to be merged in the docker repository: moby/moby#27838 |
|
argh, sorry - didn't realize this was on swarmkit |
This PR adds Windows named pipe support for SwarmKit to allow running a Worker on Windows and also forming a cluster. Instead of listening a Unix socket, this PR uses Microsoft's
go-winioto start a named pipe server.Tested on a Windows box:
Then
set SWARM_SOCKET=npipe:////./pipe/swarmd.sockUpdated: to make parsing different kind of protocols (
unix,tcp,npipe) being more deterministic, I changed the default sock from/var/...tounix:///var/....