Commit graph

30 commits

Author SHA1 Message Date
Michael Crosby
f832e757f8 Remove more top level files
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-11-07 13:19:18 -08:00
Michael Crosby
1c6ed30a79 Remove vendor and fix go build
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-11-07 13:15:32 -08:00
Michael Crosby
a861ae9d18 Fix monitor with process events
Monitor was receiving multiple events for the process

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-10-06 15:06:34 -07:00
Michael Crosby
90e4f130c8 Add working shim exec driver for start
Still need to implement a working Wait() on the process using epoll
because of the non-blocking exit fifo

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-10-06 11:39:12 -07:00
Michael Crosby
c76f883ccd Finish port of shim package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-10-05 15:07:20 -07:00
Kenfe-Mickael Laventure
61338577b5 Notify containerd of init death before waiting for children in shim
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-19 15:15:09 -07:00
Kenfe-Mickael Laventure
18c76025a1 Wait for all exec process child before exiting from shim
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-09-16 13:30:16 -07:00
Damien Lespiau
d77bc40d5c shim: Fix description of cwd and arguments given to the shim process (#307)
That comment didn't seem to match the reality and confused me a bit. The
shim takes 3 arguments and the cwd is the containerd state directory.

I'm guessing it's a left over from the containerd split.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2016-08-26 09:41:11 -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
2e4e484237 Stop creating /tmp/shim-delete-<pid> as noone uses it (#278)
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-28 11:52:52 -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
Michael Crosby
f44458d6b5 Return the start error and reap
Make sure that if we get an error from start it is returned and that we
reap the container's process from create before existing if we were to
send a kill signal.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-06-17 11:03:52 -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
Michael Crosby
6f18acda73 Remove dep on larger packages
This removes most of the deps on the larger packages for the shim and
reduces the binary size and memory footprint from a 7.1mb binary to a
2.6mb binary.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-06 11:21:49 -07:00
Tonis Tiigi
fa0efa2906 Fix closing stdin before everything has been written to pipe
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-23 12:12:56 -07:00
Michael Crosby
0969765fad Don't treat runtime error as shim error
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-17 16:32:35 -07:00
Michael Crosby
6ba5767b70 Return errors from shim in log
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-17 14:44: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
Tonis Tiigi
e57fccc481 Wait for stdio to close
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-11 14:49:01 -08:00
Michael Crosby
b68bc651a8 Handle start errors sync with runc
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-11 10:13:34 -08:00
John Howard
b044ff0f29 Refactor process.go for platform specific
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>
2016-02-29 10:43:35 -08:00
Jaana Burcu Dogan
f611b37834 Use a better package name for utility functions. 2016-02-17 00:10:18 +01:00
Michael Crosby
d317f71ac2 Move exec and checkpoint to process state
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-11 11:30:25 -08:00
Michael Crosby
01176f2d7f Add pid and stdio to process state
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-04 14:40:35 -08:00
Michael Crosby
36eb83cb99 Move fifo creation to client
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-03 13:56:15 -08:00
Michael Crosby
a42eb9fd63 Add close stdin
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-02 16:00:22 -08:00
Michael Crosby
277cc920a4 Implement checkpoint / restore for shim
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-02 16:00:22 -08:00
Michael Crosby
835f3b6a97 Update shim for exec
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-02 16:00:22 -08:00
Michael Crosby
fe38efda50 Add shim for reattach of processes
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Remove runtime files from containerd

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Update supervisor for orphaned containers

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Remove ctr/container.go back to rpc calls

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Add attach to loaded container

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Add monitor based on epoll for process exits

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Convert pids in containerd to string

This is so that we no longer care about linux or system level pids and
processes in containerd have user defined process id(pid) kinda like the
exec process ids that docker has today.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Add reaper back to containerd

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Implement list containers with new process model

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Implement restore of processes

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Add NONBLOCK to exit fifo open

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Implement tty reattach

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Fix race in exit pipe creation

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Add delete to shim

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Update shim to use pid-file and not stdout

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-02 16:00:22 -08:00