Commit graph

78 commits

Author SHA1 Message Date
Kenfe-Mickael Laventure
b4a299e61d supervisor/shim: add exec support
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-02-07 09:25:55 -08:00
Kenfe-Mickael Laventure
78d7e8b256 supervisor: implement monitoring
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-02-06 15:16:55 -08:00
Kenfe-Mickael Laventure
40b0b211b7 api/execution: add Container suffix to relevant rpc calls
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-02-02 14:40:23 -08:00
Michael Crosby
f187da9485 Port over supervisor to use grpc shim
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-02-01 16:01:53 -08:00
Michael Crosby
e115b52ce2 Remove containerd files
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-11-07 13:10:09 -08:00
Michael Crosby
97c3c3847a Refactor epoll monitor for generic use
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-22 14:03:45 -07:00
Michael Crosby
40003e7085 Add supervisor config
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-20 15:30:35 -07:00
Michael Crosby
058eea362a Remove go-metrics
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-20 10:14:53 -07:00
Kenfe-Mickael Laventure
db9aed5a97 Use uint32 as Event's Status type everywhere
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-19 12:01:34 -07:00
Kenfe-Mickael Laventure
920a9c21d7 Don't hog task queue while waiting for exec process
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-16 13:30:16 -07:00
Phil Estes
8508d2bec9 Don't call runc start when restoring a checkpoint (#302)
The create/start split left checkpoint/restore broken in that the create
side was calling runc restore, which fully restores the process to
operation, leaving a call to `runc start` as an error (process already
started). This patch skips process.Start as it is an unnecessary (and
wrong) step for a restored checkpoint.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2016-08-26 10:25:19 -07:00
Kenfe-Mickaël Laventure
0ac3cd1be1 Fix shim deadlock when joining an existing pid namespace (#290)
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-15 11:49:43 -07:00
Kenfe-Mickaël Laventure
90f827ca10 Streamline events (#287)
* Sync process.State() with the matching events

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>

* Allow requesting events for a specific container

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>

* Sync container state retrieval with other events

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>

* Let containerd take care of calling runtime delete on exit

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>

* Take care of possible race in TestBusyboxTopExecTopKillInit

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-13 11:01:07 -07:00
Lei Jitang
0b15e03da0 set default shim if shim is nil for backward compatibility
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-07-05 09:14:20 -04:00
Kenfe-Mickael Laventure
d8b9559d8e Handle case where shim is reaped before the call to the runtime start
This avoid erroring out with a false positive

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-01 11:26:20 -07:00
Michael Crosby
654c537d38 Call start in containerd
This fixes a sync issue when the containerd api returns after a
container has started.  It fixes it by calling the runtime start inside
containerd after the oom handler has been setup.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-06-27 10:49:20 -07:00
Julio Montes
0227e9fb94 Micro Benchmarks: multiples runtimes (#268)
* Micro benchmarks: use container.Runtime to kill container

Signed-off-by: Julio Montes <julio.montes@intel.com>

* Micro benchmarks: add support for multiples runtimes

Signed-off-by: Julio Montes <julio.montes@intel.com>
2016-06-16 14:39:19 -07:00
Kenfe-Mickaël Laventure
8040df4e89 New oom sync (#257)
* Vendor in runc afaa21f79ade3b2e99a68f3f15e7219155aa4662

This updates the Dockerfile to use go 1.6.2 and install pkg-config are
both are now needed by runc.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>

* Add support for runc create/start operation

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>

* Remove dependency on runc state directory for OOM handler

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>

* Add OOM test

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-09 13:33:26 -07:00
Kenfe-Mickaël Laventure
5624732128 Add golint to test (#255)
* Add a new lint rule to the Makefile

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>

* Fix linter errors

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>

* Allow replacing the default apt mirror

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-03 15:00:49 -07:00
Ross Boucher
e756ae42d1 Add support for specifying a checkpoint directory. (#245)
Signed-off-by: Ross Boucher <rboucher@gmail.com>
2016-05-25 17:42:37 -07:00
Sebastiaan van Stijn
d191f5bd1e
fix typo in error-message
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-05-25 13:26:20 +02:00
Kenfe-Mickaël Laventure
126e5c403e Allow specifying runtime to be used when creating container (#247)
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-05-23 15:43:47 -07:00
Amit Krishnan
62e1370f91 containerd build clean on Solaris (#203)
* containerd build clean on Solaris

Signed-off-by: Amit Krishnan <krish.amit@gmail.com>

* Vendor golang.org/x/sys

Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
2016-05-19 10:12:50 -07:00
Kenfe-Mickael Laventure
7979ac24fe Fix restore to correctly set the exec timeout value (containerd)
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-05-02 14:04:14 -07:00
Michael Crosby
847690583f Remove sigchld reaper from containerd process
Because we are launching alot of different runc commands to do
operations there is a race between doing a `cmd.Wait()` and getting the
sigchld and reaping it.  We can remove the sigchild reaper from
containerd as long as we make sure we reap the shim process if we are
the parent, i.e. not restored.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-27 16:02:03 -07:00
Michael Crosby
f7f4d8677f Remove windows code and simplify linux
Windows will not use containerd and its just unused code and unneed
complexity to keep it all around.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-26 14:10:41 -07:00
Michael Crosby
31270bba69 Remove windows files
Windows is not going to use containerd because there is already a
similar implementation on windows.  This removes all the windows files
because there is no reason to keep this overhead when its not going to
be used.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-26 14:10:33 -07:00
Michael Crosby
c44f03a1bf Merge pull request #215 from HuKeping/runtime_status
Bugfix: ctr container list can not get the proper status of container
2016-04-26 13:43:47 -07:00
HuKeping
40d42a1aac Rework function getContainers
- Use canonical way to check if a map contains a key.
- Use "ci" to keep consistence since it is for "containerInfo".

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-04-22 17:32:41 -04:00
Michael Crosby
c0295fac04 Merge pull request #210 from WeiZhang555/event-types-constant
Move event types constants into single file
2016-04-21 10:24:54 -07:00
Michael Crosby
1b8cc65462 Set fixed event log size
Truncate the event log on disk and in memory so that it does not
grow forever.  This is mainly used for higher levels to receive past
events if they miss any.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-20 15:07:49 -07:00
Kenfe-Mickaël Laventure
b31b8a611e Merge pull request #157 from mYmNeo/binary-path
let user to specify the shim name or path
2016-04-21 00:31:14 +10:00
Zhang Wei
e213e2eb62 Move event types constants into single file
Move all constants for event types to types.go for easier code
readability and maintainance.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-19 19:09:54 +08:00
Michael Crosby
4ae5413ed7 Truncate events log after read
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-15 13:48:02 -07:00
Michael Crosby
28f9453fbb Error oom if container has not stopped
The oom control file may not exist if the container is short lived and
exits before we can open it.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-07 10:44:36 -07:00
Michael Crosby
d34c458529 Merge pull request #186 from coolljt0725/arm64_epoll
move epoll syscall to arch specific to enable containerd run on arm64
2016-04-06 17:19:22 -07:00
mYmNeo
4eb27a5926 let user to specify the shim name or path
Signed-off-by: mYmNeo <thomassong@tencent.com>
2016-04-06 14:42:47 +08:00
Lei Jitang
6299489d03 move epoll syscall to arch specific to enable containerd run on arm64
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-04-05 23:17:30 -04:00
Michael Crosby
3742ae3ec8 Add timeout flag for container start times
This currently depends on a runc PR:

https://github.com/opencontainers/runc/pull/703

We need this pr because we have to SIGKILL runc and the container root
dir will still be left around.

As for the containerd changes this adds a flag to containerd so that you
can configure the timeout without any more code changes.  It also adds
better handling in the error cases and will kill the containerd-shim and
runc ( as well as the user process if it exists ) if the timeout is hit.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-05 13:38:49 -07:00
Tianon Gravi
13f03c3f7a Fix minor "deferred" typo
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2016-04-02 10:28:05 -07:00
Michael Crosby
cb3c208a4d Merge pull request #172 from mlaventure/better-error-for-pause-and-resume
Return the runtime error message on failed pause and resume calls
2016-04-01 14:25:52 -07:00
Michael Crosby
47f239706c Add no pivot root support
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-30 21:52:15 -07:00
Kenfe-Mickael Laventure
fd888e8f34 Return the runtime error message on failed pause and resume calls
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-03-29 11:40:05 -07:00
Michael Crosby
6e4d5b385c Add runtimeArgs to pass to shim
This allows you to pass options like:

```bash
containerd --debug --runtime-args "--debug" --runtime-args
"--systemd-cgroup"
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-24 13:31:27 -07:00
Kenfe-Mickael Laventure
514ca2d407 Fix go vet errors
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-03-22 09:47:03 -07:00
Michael Crosby
52a1dfb418 Call delete before closing IO in shim
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-14 16:58:56 -07:00
Michael Crosby
ca6ae2e64b Remove container on load if it exited
If the shim gets sigkilled while containerd is down we need to be able
to remove the container correctly so that it does not stay in a stopped
state forever.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-14 14:23:24 -07:00
Michael Crosby
94568b7a9b Don't send exit event on failure
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-11 16:40:42 -08:00
Michael Crosby
0dd075a47b Add update rpc for resource updates
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-07 15:23:52 -08:00
Michael Crosby
7cbe3e759d Remove oom flag on daemon
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-01 11:17:29 -08:00