Commit Graph

12 Commits

Author SHA1 Message Date
Kunal Kushwaha
b12c3215a0 Licence header added
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-02-19 10:32:26 +09:00
Stephen J Day
71e9f6dac2
cmd/containerd-shim, reaper: reduce channel allocation
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2018-01-24 15:14:08 -08:00
Phil Estes
f47f6af585
Remove unnecessary subreaper API from sys/
Given these same exact functions are both now available in
opencontainers/runc (libcontainer/system) package, and we only use the
`SetSubreaper` today from the shim, there seems to be no reason for
duplication.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2018-01-23 10:30:29 -05:00
Stephen J Day
2d966df174
cmd/containerd-shim: require unix socket credentials
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-30 20:34:29 -08:00
Michael Crosby
74b3cb3391 Fix exit event handling in shim
Could issues where when exec processes fail the wait block is not
released.

Second, you could not dump stacks if the reaper loop locks up.

Third, the publisher was not waiting on the correct pid.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-28 14:32:06 -05:00
Stephen J Day
e8f52c35ce
linux/shim: reduce memory overhead by using ttrpc
By replacing grpc with ttrpc, we can reduce total memory runtime
requirements and binary size. With minimal code changes, the shim can
now be controlled by the much lightweight protocol, reducing the total
memory required per container.

When reviewing this change, take particular notice of the generated shim
code.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-22 12:21:48 -08:00
Michael Crosby
f43b7acfd2 Update files based on go lint
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-02 10:15:28 -04:00
Kenfe-Mickael Laventure
587a811d09
Check credentials when connecting to shim
NewUnixSocketCredentials was actually never invoked before.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-08-11 09:34:29 -07:00
Tobias Klauser
4a6a2b9db0 Switch from package syscall to golang.org/x/sys
The syscall package is locked down and the comment in [1] advises to
switch code to use the corresponding package from golang.org/x/sys. Do
so and replace usage of package syscall with package
golang.org/x/sys/{unix,windows} where applicable.

  [1] https://github.com/golang/go/blob/master/src/syscall/syscall.go#L21-L24

This will also allow to get updates and fixes for syscall wrappers
without having to use a new go version.

Errno, Signal and SysProcAttr aren't changed as they haven't been
implemented in x/sys/. Stat_t from syscall is used if standard library
packages (e.g. os) require it. syscall.ENOTSUP, syscall.SIGKILL and
syscall.SIGTERM are used for cross-platform files.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2017-08-09 13:41:16 +02:00
Ian Campbell
8b365117a2 containerd-shim: Do not remount root MS_SLAVE
Mounting as MS_SLAVE here breaks use cases which want to use
rootPropagation=shared in order to expose mounts to the host (and other
containers binding the same subtree), mounting as e.g. MS_SHARED is pointless
in this context so just remove.

Having done this we also need to arrange to manually clean up the mounts on
delete, so do so.

Note that runc will also setup root as required by rootPropagation, defaulting
to MS_PRIVATE.

Fixes #1132.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
2017-07-20 10:50:08 +01:00
Kenfe-Mickael Laventure
d3e7af2c0a
containerd-shim: Refuse connection from uid/gid different from the shim process
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-06-23 17:50:13 -07:00
Justin Cormack
6a571ecd40 Portability fixes for containerd shim
Update go-runc to master with portability fixes.

Subreaper only exists on Linux, and only Linux runs the shim in a
mount namespace.

With these changes the shim compiles on Darwin, which means the
whole build compiles without errors now.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-05-16 17:13:32 +01:00