Commit Graph

1911 Commits

Author SHA1 Message Date
Doug Davis e5dc12a0c9 Add more context around some error cases
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-10-30 10:55:48 -07:00
Dan Walsh 69c3ea4e17 Docker needs to know whether the user requested a relabel
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2015-10-28 15:44:38 -04:00
Qiang Huang 826c92faed README.md: fix description for runc with systemd
Fix the command and elaborate the instruction.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-10-28 04:21:39 -04:00
Qiang Huang d72c391402 README.md: clarify OCI JSON files
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-10-27 15:34:38 +08:00
John Howard fe1cce69b3 Windows: Refactor state struct
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-26 14:45:20 -07:00
Alexander Morozov db21ac7750 Merge pull request #355 from keloyang/nake
Remove naked return
2015-10-25 19:50:41 -07:00
Mrunal Patel 6c36d666a1 Merge pull request #365 from jhowardmsft/jjh/devices
Windows: Tidy libcontainer\devices
2015-10-24 19:36:26 -07:00
Mrunal Patel 0d155ba0fb Merge pull request #362 from jhowardmsft/jjh/configs-cgroup
Windows: Refactor configs/cgroup.go
2015-10-24 19:34:54 -07:00
Mrunal Patel 6d85c27599 Merge pull request #364 from jhowardmsft/jjh/fs-build-tags
Fixes build tags on cgroups\fs\*.go
2015-10-24 19:33:52 -07:00
John Howard 37675129ba Windows: Tidy libcontainer\devices
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-23 13:50:24 -07:00
Alexander Morozov 34fe03fa8a Merge pull request #238 from adrianreber/master
Add criu related debug output
2015-10-23 13:44:03 -07:00
John Howard fb5a8febce Fixes build tags on cgroups\fs\*.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-23 13:41:10 -07:00
Mrunal Patel b741e3dc9d Merge pull request #337 from alban/alban/stdio
libcontainer/SPEC.md: fix /dev/stdio symlinks
2015-10-23 13:40:56 -07:00
John Howard 8690e9cc8c Windows: Refactor configs/cgroup.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-23 13:08:18 -07:00
John Howard 78351a8e3d Windows: Factor down criu_opts
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-23 12:58:59 -07:00
Mrunal Patel bed70ca579 Merge pull request #358 from rajasec/exit-typo
Fixing typo in the comment for exit
2015-10-23 11:12:17 -07:00
Alexander Morozov 989c4ba181 Merge pull request #354 from heavenlyhash/remove-unused-func
Remove fatalf function; unused.
2015-10-23 11:03:42 -07:00
Alexander Morozov 97929bd6dd Merge pull request #335 from crosbymichael/cgroup-order
Add name to cgroup subsystem and set order
2015-10-23 10:38:29 -07:00
Michael Crosby 89c0345b01 Merge pull request #345 from keloyang/arch
Add the conversion of architectures for seccomp config
2015-10-23 10:25:41 -07:00
yangshukui e5ef8d239a Add the conversion of architectures for seccomp config
Signed-off-by: yangshukui <yangshukui@huawei.com>
2015-10-23 10:17:39 +08:00
rajasec 58e3cde8f3 Fixing typo in the comment for exit
Signed-off-by: rajasec <rajasec79@gmail.com>
2015-10-22 19:08:03 +05:30
yangshukui 4584a4e762 Remove naked return
Signed-off-by: yangshukui <yangshukui@huawei.com>
2015-10-22 14:31:15 +08:00
Eric Myhre 01d9b4002e Remove fatalf function; unused.
Signed-off-by: Eric Myhre <hash@exultant.us>
2015-10-21 19:22:14 -05:00
Mrunal Patel 2a6ae44f8e Merge pull request #352 from hqhq/hq_change_setupdev
Correct intuition for setupDev
2015-10-21 09:54:10 -07:00
Alban Crequy f381717120 libcontainer/SPEC.md: fix /dev/stdio symlinks
The spec uses symlinks to "/proc/1/..." but the implementation uses
"/proc/self/...": see setupDevSymlinks (libcontainer/rootfs_linux.go).

The implementation is more correct, so I'm changing the spec to match
the implementation.

Signed-off-by: Alban Crequy <alban.crequy@coreos.com>
2015-10-21 11:10:24 +02:00
Qiang Huang 34cff6f2f3 Correct intuition for setupDev
Minor fix, the former setupDev=true means not setup dev,
which is contrary to intuition, just correct it.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-10-21 16:06:26 +08:00
Qiang Huang 194e0e4db6 Unify behavior for memory cgroup
We have a rule that for optional cgroups, don't fail if some
of them are not mounted, but we want it fail hard when a
user specifies an option and we are unable to fulfill the
request.

Memory cgroup should also follow this rule.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-10-20 14:01:48 +08:00
Michael Crosby ba2ce3b25a Cgroup set order for systemd
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-10-19 13:32:45 -07:00
Michael Crosby 2554f49d5e Use array instead of map for cgroup subsystems
Also add cpuset as the first in the list to address issues setting the
pid in any cgroup before the cpuset is populated.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-10-15 15:24:53 -07:00
Michael Crosby 02fdc70837 Add Name() to cgroup subsystems
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-10-15 15:19:23 -07:00
Mrunal Patel 3be7f87b1b Merge pull request #334 from hqhq/hq_set_cpus_mems_first
Set cpuset.cpus and cpuset.mems before join the cgroup
2015-10-15 14:33:28 -07:00
Qiang Huang be6764508e Set cpuset.cpus and cpuset.mems before join the cgroup
It can avoid unnecessary task migrataion, see this scenario:
 - container init task is on cpu 1, and we assigned it to cpu 1,
   but parent cgroup's cpuset.cpus=2
 - we created the cgroup dir and inherited cpuset.cpus from parent as 2
 - write container init task's pid to cgroup.procs
 - [it's possibile the container init task migrated to cpu 2 here]
 - set cpuset.cpus as assigned to cpu 1
 - [the container init task has to be migrated back to cpu 1]

So we should set cpuset.cpus and cpuset.mems before writing pids
to cgroup.procs to aviod such problem.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-10-15 11:16:56 +08:00
Mrunal Patel 7a95a531ba Merge pull request #333 from heavenlyhash/configurable-logfmt
Add ability to use json structured logging format.
2015-10-14 11:23:10 -07:00
Eric Myhre 2add2bc41a Add ability to use json structured logging format.
Signed-off-by: Eric Myhre <hash@exultant.us>
2015-10-13 22:57:07 -05:00
Mrunal Patel 872c4ac223 Merge pull request #332 from LK4D4/fix_panic_in_getpids
Reorder checks in Walk to avoid panics
2015-10-13 15:33:31 -07:00
Alexander Morozov 6c198ae2d0 Reorder checks in Walk to avoid panics
Also added test for host PID namespace

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-10-13 15:06:57 -07:00
Alexander Morozov 2bec85d74b Merge pull request #330 from LK4D4/recursive_pids
Get PIDs from cgroups recursively
2015-10-13 11:06:21 -07:00
Alexander Morozov 6dad176d01 Get PIDs from cgroups recursively
Also lookup cgroup for systemd is changed to "device" to be consistent
with fs implementation.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-10-13 10:19:01 -07:00
Adrian Reber c42ef59bf9 Add criu related debug output
While testing different versions of criu it helps to know which
criu binary with which options is currently used. Therefore additional
debug output to display these information is added.

v2: increase readability of printed out criu options

Signed-off-by: Adrian Reber <adrian@lisas.de>
2015-10-13 10:41:00 +02:00
Alexander Morozov d9ba9cebac Merge pull request #184 from huikang/criu-cgroup-manage-mode
Add option to support criu manage cgroups mode for dump and restore
2015-10-12 10:51:16 -07:00
Michael Crosby 869a582fd2 Merge pull request #177 from LK4D4/avagin_maintainer
Add Andrey Vagin as maintainer for runc
2015-10-12 10:35:33 -07:00
Mrunal Patel bfe2bacbf4 Merge pull request #320 from rhatdan/label
Validate label options
2015-10-11 20:54:38 -07:00
Hui Kang 25da513c4b Add option to support criu manage cgroups mode for dump and restore
CRIU supports cgroup-manage mode from v1.7

Signed-off-by: Hui Kang <hkang.sunysb@gmail.com>
2015-10-11 04:42:54 +00:00
Dan Walsh f8b34352fe Validate label options
Only valid options to --security-opt for label should be
disable, user, role, type, level.

Return error on invalid entry

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2015-10-10 06:51:49 -04:00
Alexander Morozov 76674393ef Merge pull request #324 from mrunalp/add_groups
Add additional groups support
2015-10-09 12:29:07 -07:00
Mrunal Patel f152edcb1c Merge pull request #316 from cpuguy83/race_on_output_start_error
Fix for race from error on process start
2015-10-08 13:51:54 -07:00
Mrunal Patel 7f9864f576 Merge pull request #326 from ZJU-SEL/fix-named
change named to names
2015-10-08 09:27:44 -07:00
xlgao-zju 02fc164456 change named to names
Signed-off-by: xlgao-zju <xlgao@zju.edu.cn>
2015-10-08 21:44:23 +08:00
Brian Goff 7632c4585f Fix for race from error on process start
This rather naively fixes an error observed where a processes stdio
streams are not written to when there is an error upon starting up the
process, such as when the executable doesn't exist within the
container's rootfs.

Before the "fix", when an error occurred on start, `terminate` is called
immediately, which calls `cmd.Process.Kill()`, then calling `Wait()` on
the process. In some cases when this `Kill` is called the stdio stream
have not yet been written to, causing non-deterministic output. The
error itself is properly preserved but users attached to the process
will not see this error.

With the fix it is just calling `Wait()` when an error occurs rather
than trying to `Kill()` the process first. This seems to preserve stdio.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-10-07 21:28:26 -04:00
Mrunal Patel 546c5c80dc Add additional gids support
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-10-07 16:51:53 -04:00