Commit graph

103 commits

Author SHA1 Message Date
Kenfe-Mickael Laventure
fe5f3d5581 Add proper handling for SIGKILL'ed shim
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-07 10:30:02 -07:00
Kenfe-Mickaël Laventure
526a861988 Avoid panicing if cmd.Start() from container.createCmd() failed (#305)
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-08-26 10:56:18 -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
Kenfe-Mickaël Laventure
6dd2f1c422 Merge pull request #281 from mlaventure/use-protobuf-timestamp
Use protobuf timestamp
2016-07-05 13:37:41 -07:00
Kenfe-Mickaël Laventure
af3c4bd9c5 Merge pull request #276 from resouer/fix-fd
Fix controlPipe is not closed
2016-07-05 11:25:07 -07:00
Kenfe-Mickaël Laventure
3104c6b537 Merge pull request #284 from coolljt0725/set_default_shim
set default shim if shim is nil for backward compatibility
2016-07-05 11:23:53 -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
Lei Jitang
bce8df5498 Fix attach to old running container after restart
Get the control pipe of old running container on
containerd restarting.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-07-04 04:19:18 -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
Kenfe-Mickael Laventure
3dfa04b2f4 Log runtime error message on delete error
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-30 14:09:04 -07:00
Harry Zhang
2ef56b2ee8 Fix fd leak
Signed-off-by: Harry Zhang <harryzhang@zju.edu.cn>
Signed-off-by: Harry Zhang <harryz@hyper.sh>
2016-06-29 03:35:27 -04: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
bin liu
004efe5991 fix typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2016-06-22 14:23:32 +08: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
boucher
a135e1093d Support the new --empty-ns flags in RunC for checkpoint/restore.
Signed-off-by: Ross Boucher <rboucher@gmail.com>
2016-06-09 16:49:26 -04: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
Ross Boucher
cf554d59dd Store the checkpoint and restore logs in the same directory as the (#253)
checkpoint image itself.

Signed-off-by: Ross Boucher <rboucher@gmail.com>
2016-06-07 14:05:22 -07:00
Kenfe-Mickaël Laventure
16a8dfe6a8 Add support for updating Kernel Memory Limits (#256)
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-06 11:26:07 -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
Anusha Ragunathan
24144682a0 Micro benchmarks for containerd. (#244)
This is the first in a series of micro benchmarks for containerd.
Performance measurement will use containerd objects and methods
that are not dependent on the grpc API and dont require the daemon
to the running. Test will require containerd-shim and runc.

The motivation is to understand the baseline performance at the lowest
containerd layer. A natural extension to this effort would be to write
macro benchmarks which would include API and daemon.

Note:
- Currently measures only one workload (busybox sh) start times. Will
add other bundles and args soon.
- Can use integration-test utils for bundle processing. However, json
marshal/unmarshal is currently timing out standard benchmark times. So
going with default spec for now.

Sample run:
BenchmarkBusyboxSh-4    / # / # / #        2     576013841 ns/op
ok      github.com/docker/containerd/runtime    1.800s

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-05-27 10:35:42 -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
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
Doug Davis
8ffaa02cd9 Add a better error msg
See https://github.com/docker/docker/issues/22643 for an example
where we get an error running a cmd but there's no output so `b`
is an empty string, which means the user doesn't see any interesting
error message to help them.

This PR will send back the `err` and `b` so that between those two
bits of info they should get something more than a blank string.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-05-18 13:52:57 -07:00
Kenfe-Mickael Laventure
1ebdf69a58 Use the new runtime update command to process UpdateResources requests
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-05-09 11:21:45 -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
Kenfe-Mickael Laventure
7279ff91c4 Add missing shim value when saving container state.json (containerd)
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-05-02 14:02:52 -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
db789045bd Update runc in dockerfile for new commands
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-26 15:06:25 -07:00
Michael Crosby
9ed8422e8c Use runc events --stats for collecting stats
runc `events --stats` now has stable output so we don't need to bind to
libcontainer directly to get stats output for the containers.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-26 14:57:30 -07:00
Michael Crosby
c2df6e08cf Use runc for getting list of processes
runc now has a `ps` command with json output to support listing all the
processes inside a container.  We no longer need to use libcontainer
directly for doing this.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-26 14:40:05 -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
79c35e0306 Merge pull request #218 from crosbymichael/bump_runc
Update runc and runtime-specs dependencies
2016-04-26 14:05:44 -07:00
Michael Crosby
7a1d28e42b Bump runc and runtime-specs deps
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-26 13:38:36 -07:00
HuKeping
ca7c504068 Bugfix: ctr container list can not get the proper status of container
Prior to this patch, when list containers by "ctr containers" or
"ctr containers xxx", it will not get the proper status of conatinser(s).

That was caused by the wrong implementation of State() for structure process,
it only send a signal "0" to ping the "init" process and do nothing.

Since the OCI/runc has implemented an interface Status(), we can use that.
And I think this is more compatible with the design for containerd:
- containerd -> runtime -> fun()

Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-04-26 07:04:26 -04:00
HuKeping
9d30093505 Interface: introduce status to runtime container
Signed-off-by: Hu Keping <hukeping@huawei.com>
2016-04-22 16:09:50 -04: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
Kenfe-Mickael Laventure
07646a7150 Return runtime output on checkpoint operation errors
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-04-17 12:01:19 -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
Michael Crosby
ae107f688e Change sleep to 15ms
This is currently the optimal value for this setting based on runc start
times.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-05 14:07:26 -07: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
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
Kenfe-Mickael Laventure
f07c5ac52a Ensure that runtimeArgs always get passed down to the oci runtime
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-03-29 10:32:37 -07:00
Kenfe-Mickael Laventure
3f388f8638 Take runtimeArgs in account when loading containers state
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-03-25 11:03:11 -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
Tonis Tiigi
bbf760ee6f Add prefixes to external errors
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-22 19:38:22 -07:00
Michael Crosby
142e22a4dc Merge pull request #149 from mlaventure/fix-vet-errors
Fix go vet errors
2016-03-22 10:54:08 -07:00