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>
* 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>
* 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>
* 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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
Signed-off-by: John Howard <jhoward@microsoft.com>
Move process sorter to new file
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Sort containers by id
This will not be the most accurate sorting but atleast the list will be
consistent inbetween calls.
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Allow runtime to be configurable via daemon start
This allows people to pass an alternate name or location to the runtime
binary to start containers.
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Fix state output for containers
Return the proper state/status for a container by checking if the pid is
still alive. Also fix the cleanup handling in the shim to make sure
containers are not left behind.
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Properly wait for container start
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This event type is used to notify consumers that everything following
are real-time events. This allow clients that request events from the
backlog to detect when those events have all been sent.
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>