Commit Graph

510 Commits

Author SHA1 Message Date
David Scott
a48307b5e7 proxy: calling Close() on the Accept()ing fd won't cause it to return
This seems to be a difference between the AF_VSOCK and AF_INET
implementations. We work around it by exiting the proxy process
immediately, which will clean up resources anyway.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
586d9c0598 proxy: fix up the vsock interface
- don't try to create a `FileConn` because the Go library sees through
  the scam and rejects it
- explicitly keep a reference to the `ctl` file just in case the GC
  decides its dead and should be closed.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
1d3b8b566e proxy: tell the /port server the real external IP address
Before this we accidentally told it the vsock address, which obviously
isn't much good.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
b0c4fdae37 proxy: we don't need to explicitly unexposePort any more
The port will be automatically removed when the fd/fid is closed by
a process exit/crash, or by a hypervisor crash.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
e4f405be26 proxy: request a vsock connection rather than a TCP/IP one
Note this means we don't need to figure out our local IP address.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
403ce4e696 proxy: libproxy: add a case for VsockAddr types
The `NewProxy` function already knows how to deal with `net.UDPAddr`
and `net.TCPAddr`, this patch adds similar support for `vsock.VsockAddr`.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
2f80e98e7f proxy: vsock connections support CloseRead and CloseWrite
This patch adds a wrapper around the `net.Conn` to include the
`CloseRead` and `CloseWrite` implementations. This patch also
exposes the `VsockAddr` type, which is similar to `TCPAddr` and
`UDPAddr`.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
3c68728e9f proxy: remove assumption that frontend is a TCPListener
We require the frontend to be a `net.Listener` and the `net.Conn`
connection which are established must be type-switched to
`Conn` to support the `CloseRead` and `CloseWrite` methods.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
2cf9295602 proxy: TCPProxy connects to TCP but can read from other things
The TCPProxy can proxy from anything which satisfies this interface:

type Conn interface {
  	io.Reader
	io.Writer
	io.Closer
	CloseRead() error
	CloseWrite() error
}

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
90b1734a52 proxy: add a vsock package based on vsudd
This package supports a more normal Go interface, in particular it has:

  // Listen returns a net.Listener which can accept connections on the given
  // vhan port.
  func Listen(port uint) (net.Listener, error)

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
David Scott
fb89526498 proxy: simply the Dockerfile by shuffling code under vendor/
Note there is a slight name clash between the final binary 'proxy'
and the library formerly known as 'proxy'. Resolve this by calling
the library 'libproxy'.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 17:24:56 +01:00
Justin Cormack
115373d42e Merge pull request #92 from djs55/go-diagnostics
moby: rewrite diagnostics server in Go
2016-04-15 16:17:08 +01:00
David Scott
4802911c8f moby: rewrite diagnostics server in Go
This will make it easier to add a vsock interface as well as a regular
TCP/IP one.

As a side-effect, the server is now able to handle more than one concurrent
request!

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-15 16:09:54 +01:00
Justin Cormack
8eaf2976b8 Merge pull request #90 from rneugeba/winupstream
Winupstream
2016-04-15 15:49:24 +01:00
Rolf Neugebauer
65cdbdb0c4 license: extract hvtools/llmnrd source code from the initrd
Also add modified chronyd init script

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:29 +01:00
Rolf Neugebauer
fba8a986b9 alpine: create source tarballs for hvtools and llmnrd
Add them to the initrd under /usr/share/src

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:29 +01:00
Rolf Neugebauer
0ae60c99ff iso: use ubuntu instead of debian to reduce the number of base images
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:28 +01:00
Rolf Neugebauer
e953d12e4e shutdown: use poweroff -f instead of halt -f
This is makes fast shutdown work on Hyper-V

While at it, also clean up whitespaces. The file was mixed
tabs and spaces. Now it uses spaces.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:28 +01:00
Rolf Neugebauer
8d5dd9308e mdns: re-enable mDNS when running on Hyper-V
If bonjour is installed on the host, e.g. via iTunes or some other
program, a lookup for `docker.local` works just like on the Mac.

Just like with LLMNR there seems to be a 4-5 second delay before
Windows decides to do a multicast namelook up, though

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:28 +01:00
Rolf Neugebauer
32c999a02f chronyd: don't start it when running on Hyper-V
This is a bit ugly as we copied and then modified the chronyd init.d
script as shipped in the package.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:28 +01:00
Rolf Neugebauer
5d0dfdf4fa hvtools: Fix setting the DNS server when the host reconfigures network
Busybox ifup does not modify /etc/resolv.conf

Update the hv_set_ifconfig script to overwrite /etc/resolv.conf

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:28 +01:00
Rolf Neugebauer
b3a82885ba hvtools: tweak startup sequence
- Don't start hv_fcopy_daemon. It seems to exit and we are not
  using it anyway. Also, remove it from the initrd

- Move hv_kvp_daemon and hv_vss_daemon to start earlier
  (before networking and docker being started)

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 15:10:28 +01:00
Rolf Neugebauer
73a0d1671e kernel,initrd: add CIFS to the kernel and cifs-utils to the initrd
Needed to enable SMB/CIFS mounts on Windows hosts

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 14:51:27 +01:00
Rolf Neugebauer
bcf2cd851d llmnrd: Add a LLMNR Daemon
LLMNR is the Windows equivalent of mDNS.

Import the LLMNR daemon from https://github.com/tklauser/llmnrd
It needed some small modification to compile cleanly on Moby

LLMNRD is only started when running inside a Hyper-V VM

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2016-04-15 14:51:10 +01:00
Justin Cormack
5910d4870d Merge pull request #87 from dave-tucker/util-linux
Add util-linux for K8's
2016-04-15 13:06:32 +01:00
Justin Cormack
713d7e8209 Merge pull request #88 from dsheets/hostsettings-etc-sysctl.conf
hostsettings: correctly install multiline /etc/sysctl.conf files
2016-04-15 10:58:49 +01:00
David Sheets
d99812e7d3 hostsettings: correctly install multiline /etc/sysctl.conf files
echo will destroy newlines in arguments.

Signed-off-by: David Sheets <dsheets@docker.com>
2016-04-15 10:57:32 +01:00
Dave Tucker
c5cbb9aaa2 Add util-linux for K8's
Signed-off-by: Dave Tucker <dt@docker.com>
2016-04-14 18:27:00 +01:00
David Sheets
a49bb9a4b2 Merge pull request #86 from dsheets/transfused-event-stream
transfused: update the event protocol for streaming vsock
2016-04-14 15:07:02 +01:00
David Sheets
b894b67417 transfused: update the event protocol for streaming vsock
Signed-off-by: David Sheets <dsheets@docker.com>
2016-04-14 14:57:06 +01:00
Dave Scott
43c35b842c Merge pull request #85 from djs55/docker.1.11.0
Bump docker to 1.11.0 final
2016-04-13 22:52:07 +01:00
David Scott
6c18dec743 docker: switch the branch to djs55/moby temporarily
Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-13 22:50:40 +01:00
David Scott
a6fb594b44 Bump docker to 1.11.0 final
Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-13 21:43:17 +01:00
Justin Cormack
32e840da1b Merge pull request #81 from dsheets/transfused-vsock
transfused: use vsock transport instead of 9p
2016-04-13 14:53:34 +01:00
Justin Cormack
2d492afe50 Merge pull request #83 from ijc25/hyperv-sockets
hyperv-socks: Backport patches.
2016-04-13 14:53:01 +01:00
Justin Cormack
67ed7e1cdf add more dockerignores
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-13 11:24:31 +01:00
David Sheets
cb08ad76d3 transfused: use vsock transport instead of 9p
Signed-off-by: David Sheets <dsheets@docker.com>
2016-04-12 16:38:06 +01:00
Justin Cormack
aaebcf5866 be better at checking strings which aere mainly empty
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-12 15:38:18 +01:00
Justin Cormack
0390b2ba4d Merge pull request #80 from ijc25/vsock
Update vsock patches
2016-04-12 15:02:10 +01:00
Ian Campbell
5aa8173876 hyperv-socks: Backport patches.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-04-12 14:36:58 +01:00
Ian Campbell
f2171c7beb Update vsock patches
Upstream commit 598881800825 ("vsock: Fix blocking ops call in
prepare_to_wait") was subsequently reverted in 6f57e56a1527, which said:

    The commit reverted with this patch caused us to potentially miss wakeups.
    Since the condition is not checked between the prepare_to_wait and the
    schedule(), if a wakeup happens after the condition is checked but before
    the sleep happens, we will miss it. ( A description of the problem can be
    found here: http://www.makelinux.net/ldd3/chp-6-sect-2 ).

The underlying issue has been fixed instead with f7f9b5e7f8ec ("AF_VSOCK:
Shrink the area influenced by prepare_to_wait").

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-04-12 14:33:32 +01:00
Justin Cormack
4b0116ea07 bump to docker 1.11.0-rc5
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-12 10:28:25 +01:00
Justin Cormack
53116c29a5 Merge pull request #76 from djs55/clunk-port
proxy: keep the fd open to the control file
2016-04-11 22:09:35 +02:00
David Scott
d5f25d2727 proxy: keep the fd open to the control file
A future version of the 9P server will shutdown the forward on 9P
clunk, so if this process crashes the forward will be cleaned up
properly.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-04-11 18:27:11 +01:00
Justin Cormack
e49fff3c5e fix hupper path
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-11 16:10:28 +01:00
Justin Cormack
9844e5f82f empty config files should not be marked for exists
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-11 13:41:17 +01:00
Justin Cormack
bd0d295eaf use docker git fork for our patches version, rather than having patches here, for more transparency
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-11 12:32:11 +01:00
Justin Cormack
713af4332b clean up config options
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-04-11 11:09:55 +01:00
Justin Cormack
9be06ba517 Merge pull request #73 from ijc25/vsock
vsudd bugfixes
2016-04-08 16:05:36 +01:00
Ian Campbell
dad42c8dc4 vsudd: Close via the File vsock not the raw fd.
Otherwise the underlying gets closed twice, once by the File's finalizer (which
occurs at whichever point vsock appears no longer used) and another time by the
syscall.Close(), which leads to EBADF. The various syscall.shutdown can also
suffer from this if the File happens to get finalized first, but the reference
in the defer'd function now keeps the File alive until we are truly done with
the socket.

This seems to resolve the random stalls and failures seen in "make test".

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2016-04-08 15:08:10 +01:00