Commit Graph

2734 Commits

Author SHA1 Message Date
Mrunal Patel ff9cb9b42d Merge pull request #949 from cyphar/fix-cgroup-rt-json
configs: fix json tags for CpuRt* options
2016-07-18 12:47:09 -04:00
Aleksa Sarai aa029491be
configs: fix json tags for CpuRt* options
Previously we used the same JSON tag name for the regular and realtime
versions of the CpuRt* fields, which causes issues when you want to use
two different values for the fields.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-07-18 17:02:30 +10:00
Qiang Huang 1b49d9b4db Merge pull request #936 from macrosheep/set-criupath-helper
libcontainer: Add a helper func to set CriuPath
2016-07-18 09:37:47 +08:00
Yen-Lin Chen a318a2ae1b Fixed typo in build constraint.
Signed-off-by: Yenlin Chen <hencrice@gmail.com>
2016-07-15 19:24:22 -07:00
Qiang Huang 41b12c095b Merge pull request #913 from cloudfoundry-incubator/addgroupsnocompatible
Let the user explicitly specify `additionalGids` on `runc exec`
2016-07-15 10:12:31 +08:00
Mrunal Patel ec01ae5f10 Merge pull request #942 from ggaaooppeenngg/fix-typo
Fix typo
2016-07-14 11:18:06 -04:00
Daniel, Dao Quang Minh 7446e70f42 Merge pull request #939 from mikebrow/additional-list-docs
address issue #797 by adding additional documentation
2016-07-14 11:06:01 +01:00
Peng Gao 765df7eed0 Fix typo
Signed-off-by: Peng Gao <peng.gao.dut@gmail.com>
2016-07-13 23:32:38 +08:00
Mike Brown 50dbe5f474 address issue #797 by adding additional documentation
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2016-07-11 09:31:07 -05:00
Qiang Huang 4eb8c2fb1d Merge pull request #935 from vishh/cgo
Use update time to detect if kmem limits have been set
2016-07-11 10:17:28 +08:00
Hushan Jia bb42f80a86 fix setting net_cls classid
Setting classid of net_cls cgroup failed:

ERRO[0000] process_linux.go:291: setting cgroup config for ready process caused "failed to write 𐀁 to net_cls.classid: write /sys/fs/cgroup/net_cls,net_prio/user.slice/abc/net_cls.classid: invalid argument"
process_linux.go:291: setting cgroup config for ready process caused "failed to write 𐀁 to net_cls.classid: write /sys/fs/cgroup/net_cls,net_prio/user.slice/abc/net_cls.classid: invalid argument"

The spec has classid as a *uint32, the libcontainer configs should match the type.

Signed-off-by: Hushan Jia <hushan.jia@gmail.com>
2016-07-11 05:00:35 +08:00
Zhao Lei cdb552d341 ps: Support muitiple ps arguments
Before patch:
 | # ./runc ps test -- -e -f
 |   PID TTY          TIME CMD
 | 29046 pts/2    00:00:00 sh  <-- The -f option was skipped
 | #

After patch:
 | # ./runc ps test -- -e -f
 | UID        PID  PPID  C STIME TTY          TIME CMD
 | root     29046 29038  0 Jul06 pts/2    00:00:00 sh
 | #

Reported-by: Qiang Huang <h.huangqiang@huawei.com>

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2016-07-07 18:42:47 +08:00
Zhao Lei f5a95fa244 cli: Workaround for ps's argument
Currently, ps command can not support argument:
(But following usage is in manual)
 | # ./runc ps 123 -ef
 | Incorrect Usage.
 |
 | NAME:
 |    runc ps - ps displays the processes running inside a container
 |
 | USAGE:
 |    runc ps [command options] <container-id> [ps options]
 |
 | OPTIONS:
 |    --format value, -f value  select one of: table or json
 |
 | flag provided but not defined: -ef
 | #

Instead of using odd command like:
 | # ./runc ps -- 123 -ef

We can make it seems little better:
 | # ./runc ps 123 -- -ef
 | UID        PID  PPID  C STIME TTY          TIME CMD
 | root     29046 29038  0 11:18 pts/2    00:00:00 sh
 | #

This patch also fixed manual which can not working in current
code.

Closes #788

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2016-07-07 18:17:13 +08:00
Yang Hongyang a59d63c5d3 Fix and refactor init args
1. According to docs of Cmd.Path and Cmd.Args from package "os/exec":
   Path is the path of the command to run. Args holds command line
   arguments, including the command as Args[0]. We have mixed usage
   of args. In InitPath(), InitArgs only take arguments, in InitArgs(),
   InitArgs including the command as Args[0]. This is confusing.
2. InitArgs() already have the ability to configure a LinuxFactory
   with the provided absolute path to the init binary and arguements as
   InitPath() does.
3. exec.Command() will take care of serching executable path.
4. The default "/proc/self/exe" instead of os.Args[0] is passed to
   InitArgs in order to allow relative path for the runC binary.

Signed-off-by: Yang Hongyang <imhy.yang@gmail.com>
2016-07-06 23:21:02 -04:00
Yang Hongyang 9ade2cc5ce libcontainer: Add a helper func to set CriuPath
Added a helper func to set CriuPath for LinuxFactory.

Signed-off-by: Yang Hongyang <imhy.yang@gmail.com>
2016-07-06 22:58:55 -04:00
Vishnu kannan c501cc038a Remove unused GetLongBit() function.
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-07-06 15:23:01 -07:00
Vishnu kannan 8dd3d63455 Look at modify time to check if kmem limits are initialized.
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-07-06 15:14:25 -07:00
Mrunal Patel 9d7831e41d Merge pull request #930 from hqhq/fix_state_detection
Make state detection precise
2016-07-06 09:51:55 -07:00
Daniel, Dao Quang Minh 0b5d51cbb0 Merge pull request #928 from mlaventure/add-force-to-delete
Add force to delete
2016-07-06 16:59:58 +01:00
Qiang Huang 14e95b2aa9 Make state detection precise
Fixes: https://github.com/opencontainers/runc/issues/871

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-07-05 08:24:13 +08:00
Ben 14e55d1692 Add unit test for setting the CPU RT sched cgroups values at apply time
Added a unit test to verify that 'cpu.rt_runtime_us' and 'cpu.rt_runtime_us'
cgroup values are set when the cgroup is applied to a process.

Signed-off-by: Ben Gray <ben.r.gray@gmail.com>
2016-07-04 13:11:53 +01:00
ben 950700e73c Set the 'cpu.rt_runtime_us' and 'cpu.rt_runtime_us' values of the cpu cgroup
before trying to move the process into the cgroup.

This is required if runc itself is running in SCHED_RR mode, as it is not
possible to add a process in SCHED_RR mode to a cgroup which hasn't been
assigned any RT bandwidth. And RT bandwidth is not inherited, each new
cgroup starts with 0 b/w.

Signed-off-by: Ben Gray <ben.r.gray@gmail.com>
2016-07-04 13:10:21 +01:00
Mrunal Patel 7221e38782 Merge pull request #929 from mlaventure/tag-image-with-git-branch
Use git branch name as tag when building images
2016-07-01 15:11:51 -07:00
Kenfe-Mickael Laventure 9fc9d10e57 Add `--force` flag to `runc delete`
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-30 07:55:44 -07:00
Kenfe-Mickael Laventure 9977d24388 Use git branch name as tag when building images
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-06-29 07:26:48 -07:00
Alexander Morozov 629e35666d Merge pull request #925 from cyphar/fix-path-checks
rootfs: clean up
2016-06-24 12:10:23 -07:00
Mrunal Patel 9123ce66ce Merge pull request #922 from cyphar/test-uid-gid
tests: add tests with {u,g}id != 0
2016-06-24 12:09:14 -07:00
Aleksa Sarai c29695ad0a
rootfs: don't change directory
There's no point in changing directory here. Syscalls are resolved local
to the linkpath, not to the current directory that the process was in
when creating the symlink. Changing directories just confuses people who
are trying to debug things.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-06-24 16:44:40 +10:00
Mrunal Patel 9b3a2f1634 Merge pull request #919 from zhaoleidd/fix_ps_argument_manual
Fix ps argument manual
2016-06-23 10:17:47 -07:00
Aleksa Sarai 0f1d6772c6
libcontainer: rootfs: use CleanPath when comparing paths
Comparisons with paths aren't really a good idea unless you're
guaranteed that the comparison will work will all paths that resolve to
the same lexical path as the compared path.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-06-22 01:45:32 +10:00
Petar Petrov f9b72b1b46 Allow additional groups to be overridden in exec
Signed-off-by: Julian Friedman <julz.friedman@uk.ibm.com>
Signed-off-by: Petar Petrov <pppepito86@gmail.com>
Signed-off-by: Georgi Sabev <georgethebeatle@gmail.com>
2016-06-21 10:35:11 +03:00
Aleksa Sarai c77eb1c413 tests: add tests with {u,g}id != 0
This is a very important testcase, as certain permission issues can
arise if we don't test this automatically.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2016-06-18 12:16:42 +10:00
Zhao Lei 71929e0f9d Fix ps argument manual
Argument of "ps options" for ps command is a optional parameter.
Should use [] instead of <> in manual.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2016-06-17 19:07:30 +08:00
Daniel, Dao Quang Minh 5dc3f3576e Merge pull request #917 from xiekeyang/master
remove unused returned variables name
2016-06-16 13:01:58 +01:00
Alexander Morozov cc29e3dded Merge pull request #912 from crosbymichael/fifo-userns
Fix fifo usage with userns and not root users
2016-06-15 13:00:28 -07:00
xiekeyang 55e783b57a remove unused returned variables name
The returned variables name seems be able to removed.

Signed-off-by: xiekeyang <xiekeyang@huawei.com>
2016-06-15 17:41:57 +08:00
Qiang Huang 42dfd60643 Merge pull request #904 from euank/fix-cgroup-parsing-err
cgroups: Fix issue if cgroup path contains :
2016-06-14 14:19:20 +08:00
Michael Crosby 5ce88a95f6 Fix fifo usage with userns
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-06-13 20:20:48 -07:00
Mrunal Patel c0461277f9 Merge pull request #879 from hqhq/list_use_cli_default
Use cli default value for list format
2016-06-13 16:06:13 -07:00
Mrunal Patel f5b6ff23b8 Merge pull request #881 from rajasec/update-status
Update for stopped container
2016-06-13 16:05:25 -07:00
Mrunal Patel 96c15e6e3c Merge pull request #889 from cyphar/tests-provide-debug
tests: add debug information for failing tests
2016-06-13 16:04:44 -07:00
Alexander Morozov 85873d917e Merge pull request #886 from crosbymichael/start-pipe
Use fifo for create / start instead of signal handling
2016-06-13 12:36:38 -07:00
Michael Crosby 3aacff695d Use fifo for create/start
This removes the use of a signal handler and SIGCONT to signal the init
process to exec the users process.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-06-13 11:26:53 -07:00
Mrunal Patel 8109ec1cc9 Merge pull request #908 from rajasec/stats-var-remove
Removing unused variable for cgroup subsystem
2016-06-13 11:07:55 -07:00
Daniel, Dao Quang Minh 8fbe19e020 Merge pull request #905 from crosbymichael/update-readme
Update readme for create start
2016-06-13 14:24:42 +01:00
Qiang Huang c669b8d156 Adjust man pages for create start split
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-06-12 20:38:45 +08:00
Aleksa Sarai 0636bdd45b Merge pull request #874 from crosbymichael/keyring
Add option to disable new session keys
2016-06-12 21:44:45 +10:00
rajasec 146218ab92 Removing unused variable for cgroup subsystem
Signed-off-by: rajasec <rajasec79@gmail.com>
2016-06-12 12:35:49 +05:30
Mrunal Patel a513998702 Merge pull request #893 from keloyang/leafweight
bug fix, LeafWeight nil err
2016-06-11 09:38:18 -07:00
Euan Kemp 394610a396 cgroups: Parse correctly if cgroup path contains :
Prior to this change a cgroup with a `:` character in it's path was not
parsed correctly (as occurs on some instances of systemd cgroups under
some versions of systemd, e.g. 225 with accounting).

This fixes that issue and adds a test.

Signed-off-by: Euan Kemp <euank@coreos.com>
2016-06-10 23:09:03 -07:00