Commit graph

176 commits

Author SHA1 Message Date
Kenfe-Mickael Laventure
ef03000b27 Revert "proto: move all protos under a single root"
This reverts commit 352c6b590c.
2016-12-01 14:25:03 -08:00
Kenfe-Mickael Laventure
352c6b590c proto: move all protos under a single root
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-12-01 14:17:13 -08:00
Kenfe-Mickael Laventure
4cf40db861 proto: rename container service to execution
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-12-01 13:57:51 -08:00
Kenfe-Mickael Laventure
62ca43566e proto: rename container to execution
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-12-01 13:38:29 -08:00
Stephen J Day
8a36e1c6d1
api: use correct generation helper
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-12-01 13:31:57 -08:00
Stephen J Day
9f90fdbf07
api: generate protobufs using go generate
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-12-01 12:36:19 -08:00
Stephen J Day
4d1a30ff41
api: protos now pass lint checks
Generation is likely broken, but the Makefile linter now passes. Another
pass will have a fully working toolchain.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-12-01 12:22:05 -08:00
Kenfe-Mickael Laventure
6c7b4b4c17 proto: make container.proto compile
Replaced tags with owner. This assumes we will provide a Metadata
endpoint since we're planning on using it for distribution.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-12-01 10:28:38 -08:00
Michael Crosby
3ef3f74878 Add ctr run functions for mocking client
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-11-29 16:52:04 -08:00
Michael Crosby
0806a0d8db Update container protos
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-11-29 15:36:25 -08:00
Michael Crosby
fc577a1cbb Add protos for initial API
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-11-28 15:28:38 -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
b6bf350a07 Merge container.protos
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-22 11:29:20 -07:00
Stephen J Day
32a25d5523
api: begin to define the containerkit api
This commit cuts out the structure for defining grpc services for this
project. To provide compatibility with go package generation and support
reuse, we use a single protobuf file per package and make the import
paths relative to the GOPATH.

This first pass attempts to position the Mount type as the lingua franca
of ContainerKit. The Images service will provide paths prepared for use
as a set of mounts of the container service.

We'll need to merge the container service in place with new file defined
here.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-09-20 20:22:23 -07:00
Michael Crosby
0dcd3a034d Add additional request/response protos
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-20 12:01:28 -07:00
Michael Crosby
ce7702f2db Add initial container protos and service
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-20 11:20:48 -07:00
Michael Crosby
97dbfe9e1f Move cputicks into osutils package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-20 11:20:17 -07:00
Michael Crosby
435a1c825d Refactor api/http to just pprof
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-20 10:22:19 -07:00
Mike Danese
3492af35ba grpc: regenerate protos and adjust for new package API
Signed-off-by: Mike Danese <mikedanese@google.com>
2016-09-12 11:37:24 -07:00
Yu, Zou
79c7673858 add more blkio subsystem parameters to control according to ones provided by runc. (#304)
Signed-off-by: Yu Zou <zouyu7@huawei.com>
2016-08-26 11:07:45 -07:00
Harry Zhang
9df37c23e4 Fix wrong field name
Signed-off-by: Harry Zhang <harryz@hyper.sh>
2016-07-14 17:06:01 +08: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-Mickael Laventure
dfb626dccc Use protobuf Timestamp type instead of uint64
This will ensure nanoseconds are taken in account.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-07-01 09:37:21 -07:00
Kenfe-Mickaël Laventure
098f9f1a1b Use uin64 for UpdateResource rpc (#265)
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-13 10:59:12 -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
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
Michael Crosby
7fa8fc1477 Regen proto for checkpoint pr (#249)
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-25 17:52:46 -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
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
Michael Crosby
614df93b92 Update grpc and protobufs dep (#243)
* Update grpc and protobufs dep

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

* Fix grpc error check

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-18 09:16:55 -07:00
Kenfe-Mickaël Laventure
57b7c3da91 Merge pull request #237 from crosbymichael/create-status
Use state for container create
2016-05-09 14:55:08 -07:00
Michael Crosby
6fae7fd8fc Use state for container create
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-05-09 14:51:19 -07:00
Kenfe-Mickael Laventure
ba465c17a7 Add new GetServerVersion rpc method
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-05-09 11:38:28 -07:00
Tonis Tiigi
62c89c1c50 Fix including memory stats field
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-04-27 18:42:16 -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
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
Michael Crosby
63001ee20d Merge pull request #185 from LK4D4/fix_pprof_address
api: fix pprof-address usage
2016-04-18 11:01:31 -07:00
Alexander Morozov
9416996835 api: fix pprof-address usage
those handlers already added by init functions

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-04-05 11:36:51 -07:00
Aleksa Sarai
696cb97c28 api: grpc: add Limit to PidsStats
This will be filled by the value of pids.max, allowing clients to render
usage statistics for PIDs in a container.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-04-05 01:47:32 +10: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
Michael Crosby
3d72dc1e4e Merge pull request #161 from calavera/enable_pprof
Enable http pprof connections when pprof-address flag is set
2016-03-25 17:27:08 -07:00
David Calavera
06bcd7d03c Enable http pprof connections when pprof-address is set.
Add flag to specify the address where those connections listen.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-03-25 17:46:10 -04:00
Kenfe-Mickael Laventure
bac78851e0 Append error message to internal errors
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-03-25 11:03:11 -07:00
Ben Firshman
9979502ca8 Fix spacing in api.proto
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2016-03-18 17:37:59 -07:00
Michael Crosby
a4844a68a6 Add exec rlimit support to containerd
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-15 11:46:47 -07:00
Michael Crosby
e637c1ea80 Update specs imports for specs-go
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-15 11:31:32 -07:00
Tonis Tiigi
ab5eae56bf Add pids stats
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-08 16:13:10 -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
44d6a60e7e Add process cap support to add process rpc
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-03-07 11:01:28 -08:00
John Howard
d4ca79c978 Getting ctr closer to compiling on Windows
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-02-29 12:42:30 -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
John Howard
dd192f4cd9 Final bit of compiling on Windows
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-02-26 15:38:05 -08:00
John Howard
2b8f022950 runtime compiles on Windows
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-02-26 14:01:06 -08:00
Kenfe-Mickael Laventure
d8fce0997e Fill forgotten KernelUsage field of CgroupStats.MemoryStats
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-02-23 10:51:28 -08:00
Kenfe-Mickael Laventure
9f8e542234 Add Limit field to rpc MemoryStats.MemoryData
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-02-23 10:51:28 -08:00
Michael Crosby
a2461f1b6b Merge pull request #99 from mlaventure/system-usage-stats
Add SystemUsage to returned stats
2016-02-23 10:15:42 -08:00
Kenfe-Mickael Laventure
da5d876d91 Add SystemUsage to returned CpuStats
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-02-20 23:40:09 -08:00
Michael Crosby
4e05bf491a Remove eventloop package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-19 13:21:21 -08:00
Michael Crosby
d19c818cdc Don't get pids on create
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-12 14:01:24 -08:00
Michael Crosby
1d8dc2a072 Fix time parsing from API default value
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-12 13:29:53 -08:00
Michael Crosby
7b182bd898 Remove name from container proto
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-12 13:08:38 -08:00
Michael Crosby
9341a95c26 add event log and timestamp to events api
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-12 10:17:59 -08:00
Michael Crosby
3dc59d565a Rename Events to task in supervisor
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-11 17:26:24 -08:00
Michael Crosby
d2bf71043f Fix memory value in stats api
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-11 15:55:19 -08:00
Michael Crosby
bdeb87a090 Implement stats for containerd
This is a single endpoint that clients will poll

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-11 14:36:32 -08:00
Michael Crosby
532697f32f Add all pids to state output
Also update libcontainer dep

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-11 14:07:34 -08:00
Michael Crosby
d6bd304c92 Add labels for containers
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-11 13:44:25 -08:00
Michael Crosby
76d69b4ed8 Add id to state command to return single container
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-11 12:20:29 -08:00
Michael Crosby
58c5eb5ecb Return container on start
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-02-11 11:56:11 -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
Burcu Dogan
167219101f runtime: remove unnecessary intermediate type, Status
Signed-off-by: Burcu Dogan <jbd@google.com>
2016-01-28 00:31:33 +01:00
Antonio Murdaca
6bc0dcf4e9 api: grpc: types: align fields in api.proto
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-01-22 21:29:37 +01:00
Alexander Morozov
69f8f566a2 Move supervisor to it's own package
It allows to keep main namespace cleaner

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-12-17 16:18:48 -08:00
Michael Crosby
76cf593212 Add oom notifications and pid to create response
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-15 16:22:53 -08:00
Michael Crosby
ec31245f54 Add exec process log support
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-15 11:43:51 -08:00
Michael Crosby
d542ece69c Add tty support from client
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-14 16:47:42 -08:00
Michael Crosby
b2e649b164 Add console to proto
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-14 16:27:28 -08:00
Alexander Morozov
4bc322397f Add initial implementation of stats
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-12-14 14:45:06 -08:00
Alexander Morozov
ce387dc505 Add datastructures for stats API
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-12-14 14:43:56 -08:00
Michael Crosby
92c0790899 Add stdin support for client and daemon
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-14 14:40:50 -08:00
Michael Crosby
c4aa39a818 Update protos with stdin for container create
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-14 14:18:42 -08:00
Michael Crosby
e9f63fc9a4 Add basic fifo support for IO copy
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-14 14:15:26 -08:00
Michael Crosby
e5545a1461 Add basic logging to file support
This currently logs to a json file with the stream type.  This is slow
and hard on the cpu and memory so we need to swich this over to
something like protobufs for the binary logs but this is just a start.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-11 10:26:49 -08:00
Alexander Morozov
04d2034a83 Add initial documentation for api
Cool that protoc generates docstrings for pb.go file

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-12-10 14:43:23 -08:00
Michael Crosby
71ef776082 Add events support in client
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-10 12:30:20 -08:00
Michael Crosby
1d3349128e Replace rest api with grpc api
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-09 15:39:27 -08:00
Michael Crosby
11c27935d0 Replace api cli with grpc cli
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-09 15:37:04 -08:00
Alexander Morozov
e14e4576c9 Prototype of grpc API
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-12-09 15:05:50 -08:00
Michael Crosby
e87f8336c4 Add more client methods
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-12-08 13:31:20 -08:00