Commit Graph

250 Commits

Author SHA1 Message Date
Michael Crosby
67232e93dc
Merge pull request #1779 from AkihiroSuda/resolve-util-bin
shim: support non-default binary name
2017-11-17 17:53:43 -05:00
Akihiro Suda
7ef4aa5c25 shim: support non-default binary name
The binary name used for executing "containerd publish" was hard-coded
in the shim code, and hence it did not work with customized daemon
binary name. (e.g. `docker-containerd`)

This commit allows specifying custom daemon binary via `containerd-shim
-containerd-binary ...`.
The daemon invokes this command with `os.Executable()` path.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-11-17 22:21:54 +00:00
Stephen J Day
50532f231a
api: use weak imports for plugin protobufs
Because of a side-effect import, we have the possibility of pulling in
several unnecessary packages that are used by the plugin and not at
runtime to implement protobuf structures. Setting these imports to
`weak` prevents this from happening, reducing the total import set,
reducing memory usage and binary size.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-16 20:18:15 -08:00
Derek McGowan
5c6e789dde
Merge pull request #1769 from stevvooe/split-events-types
api/events: split event types from events service
2017-11-16 16:29:28 -08:00
Stephen J Day
09b5ca1072
api/events: split event types from events service
To avoid importing all of grpc when consuming events, the types of
events have been split in to a separate package. This should allow a
reduction in memory usage in cases where a package is consuming events
but not using the gprc service directly.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-16 15:20:46 -08:00
Stephen J Day
c5022ad92d
protobuf: use the gogo/types package for empty
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-15 19:08:54 -08:00
Michael Crosby
8376b50b19 Add grpc methods to errdefs
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-13 16:45:25 -05:00
Michael Crosby
c81788b129 Remove errdefs and shimapi types from proc package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-13 16:45:25 -05:00
Michael Crosby
9abde39bf7 Fix lint issues on init process
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-13 16:45:25 -05:00
Michael Crosby
66a70e7fda Refactor runtime initialization
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-13 16:45:25 -05:00
Michael Crosby
36e5548e76 Remove namepsaces and id imports from shim
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-13 16:45:25 -05:00
Michael Crosby
a7343b0773 Move events from shim into linux runtime
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-13 16:45:25 -05:00
Michael Crosby
1fe5a251c4 Move Exec creation to init process
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-13 16:45:25 -05:00
Michael Crosby
6e25898ff0 Move shim process code to package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-13 16:45:25 -05:00
Kenfe-Mickael Laventure
231c96098e
containerd-shim: Delete exec pidfile on exit
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-11-13 08:42:25 -08:00
Jess Valarezo
0961807715 rename runcopts to runctypes
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-11-10 11:43:51 -08:00
Jess Valarezo
807f4d2ec7 expose exec-id on ctr task ps
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-11-10 11:38:51 -08:00
Stephen J Day
08d1e72cc0
api,linux,windows: update generated protobufs
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-11-09 13:37:06 -08:00
Michael Crosby
d01fb047f4 Fix runtime root with no-shim
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-07 12:12:53 -05:00
Michael Crosby
fc08f019f3 Fix windows compile for dialer package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-07 10:56:02 -05:00
Michael Crosby
bba473aeb1 Move shim client into subpackage
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-07 10:51:12 -05:00
Michael Crosby
13c7c3ef10 Remove urfave cli dep from shim
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-07 10:51:12 -05:00
Michael Crosby
a70b95b202 Move events exchange into subpackage
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-07 10:51:12 -05:00
Michael Crosby
5fd0415985 Add comments and fix common lint issues
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-20 13:19:14 -04:00
Kenfe-Mickael Laventure
71f0bb3e3c
linux: Pass correct path to runc when doing a checkpoint
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-10-16 10:45:03 -07:00
Stephen J Day
8508e8252b
plugin: refactor plugin system to support initialization reporting
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-10-10 16:40:47 -07:00
Michael Crosby
12c79cc0d9 Merge pull request #1604 from jessvalarezo/windows-listpids
ListPids returns process details in addition to process IDs.
2017-10-10 19:26:47 -04:00
Jess
061c719209 ListPids returns process ID and other info
Signed-off-by: Jess <jessica.valarezo@docker.com>
2017-10-10 22:57:15 +00:00
Kenfe-Mickael Laventure
c807ba8379
Allow setting the uid & gid of the io pipes
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-10-10 13:24:12 -07:00
Phil Estes
987fcd1201 Merge pull request #1598 from Random-Liu/fix-load-task
Fix task load.
2017-10-06 16:38:40 -04:00
Stephen Day
8558b98eb1 Merge pull request #1582 from dmcgowan/metadata-db-object
Create metadata db object
2017-10-05 16:50:44 -07:00
Lantao Liu
28ca8f05d3 Fix task load.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-10-05 21:03:24 +00:00
Derek McGowan
56c1b79a4c
Create metadata db object
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-04 11:16:22 -07:00
Kenfe-Mickael Laventure
26d4c2c217
Add an option to prevent putting the shim in a new mount namespace
This is needed for users on kernel older than 3.18 so they can avoid EBUSY
errors when trying to unlink, rename or remove a mountpoint that is present in
a shim namespace.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-10-04 09:16:02 -07:00
Ace-Tang
2231de3760 Remove a blank line
Signed-off-by: Ace-Tang <aceapril@126.com>
2017-10-03 20:58:51 +08:00
Michael Crosby
451421b615 Comment more packages to pass go lint
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-02 13:54:56 -04:00
Michael Crosby
d67763d922 Add wait API endpoint for waiting on process exit
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-09-21 15:03:58 -04:00
Michael Crosby
7030a4add0 Close epoller on task stop
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-09-20 11:29:13 -04:00
Michael Crosby
d22160c28e Vendor typeurl package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-09-19 09:43:55 -04:00
Kenfe-Mickael Laventure
f2d1459929
Remove omitempty from toml tags
The encoder only support changing the name of the key.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-09-14 20:49:22 -07:00
Michael Crosby
951c129bf1 Handle locking and errors for process state
ref: #1464

This tries to solve issues with races around process state.  First it
adds the process mutex around the state call so that any state changes,
deletions, etc will be handled in order.

Second, for IsNoExist errors from the runtime, return a stopped state if
a process has been removed from the underlying OCI runtime but not from
the shim yet.  This shouldn't happen with the lock from above but its
hare to verify this issue.

Third, handle shim disconnections and return an ErrNotFound.

Forth, don't abort returning all tasks if one task is unable to return
its state.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-09-07 16:22:00 -04:00
Michael Crosby
4c5ed9c068 Move metrics requests to services
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-09-05 17:41:30 -04:00
Michael Crosby
ed45952826 Use cgroups proto for prom metrics
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-09-05 17:26:26 -04:00
Michael Crosby
697dcdd407 Refactor task service metrics
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-09-05 17:26:26 -04:00
Michael Crosby
f5d81a631e Return grpc errs from task service
Closes #1201

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-09-05 16:10:19 -04:00
Kenfe-Mickaël Laventure
b4cc42d028 Merge pull request #1460 from mlaventure/pid-host-kill-init
Ensure all init children are dead when it exits
2017-09-01 15:17:40 -07:00
Kenfe-Mickael Laventure
92772bd471
linux: Ensure all init children are dead when it exits
This ensure that when using the host pid, we don't let process alive,
preventing Wait() to return until they all die.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-09-01 14:50:56 -07:00
Kenfe-Mickael Laventure
9d251cbd1b
Delete bundle dir on restore if we're not debugging the shim
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-09-01 14:50:56 -07:00
Michael Crosby
b04e408a4b Convert OOM Metric to Const
This converts the oom metric to be a const metric so that deleted tasks
do not fill up the metric labels.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-09-01 16:43:30 -04:00
Kenfe-Mickael Laventure
1b79170849
linux: Add RuntimeRoot to RuncOptions
This allow specifying wher the OCI runtime should store its state data.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-08-31 14:35:05 -07:00