Commit Graph

3169 Commits

Author SHA1 Message Date
Mrunal Patel 1fb47b08fc Merge pull request #974 from hqhq/fix_cgroup_test
Use absolute cgroup path for integration test
2016-08-08 09:32:35 -07:00
Haiyan Meng def07036a0 Fix the err info of chdir(cwd) failure
Signed-off-by: Haiyan Meng <haiyanalady@gmail.com>
2016-08-08 12:26:59 -04:00
Haiyan Meng f40fbcd595 Fix the err info of mount failure
Signed-off-by: Haiyan Meng <haiyanalady@gmail.com>
2016-08-08 11:58:28 -04:00
Qiang Huang 75f765e961 Use absolute cgroup path for integration test
So we can pass the test in container os local or systemd
environment.

Also fixes: #967

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-08-07 10:47:09 +08:00
Mrunal Patel 142df3836b Merge pull request #968 from hqhq/cleanup_getlongbit
Cleanup GetLongBit
2016-08-02 09:34:53 -07:00
Qiang Huang 6ecb469b2b Fix race condition when using cgroups.Paths
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-08-02 15:43:04 +08:00
Qiang Huang 50f0a2b1e1 Merge pull request #962 from dubstack/fix_kmem_limits
Remove kmem Initialization check while setting memory configuration
2016-08-02 10:04:18 +08:00
Qiang Huang 777ac05e5e Cleanup GetLongBit
Follow up: #962

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-08-02 09:04:30 +08:00
Mrunal Patel 56fc0ac9ce Merge pull request #966 from sjenning/fix-initscope-cgroup-path
fix init.scope in cgroup paths
2016-08-01 14:29:47 -07:00
Buddha Prakash fcd966f501 Remove kmem Initialization check
Signed-off-by: Buddha Prakash <buddhap@google.com>
2016-08-01 09:47:34 -07:00
Seth Jennings 4b44b98596 fix init.scope in cgroup paths
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2016-08-01 11:14:29 -05:00
Qiang Huang 1a81e9ab1f Merge pull request #958 from dubstack/skip-devices
Skip updates on parent Devices cgroup
2016-07-29 10:31:49 +08:00
Buddha Prakash d4c67195c6 Add test
Signed-off-by: Buddha Prakash <buddhap@google.com>
2016-07-28 17:14:51 -07:00
Daniel, Dao Quang Minh 5226749985 Merge pull request #943 from johnbieren/master
Change git -C reset to git reset
2016-07-26 15:40:16 +01:00
Mrunal Patel 21124f6274 Merge pull request #963 from guilhermebr/master
libcontainer: rename keyctl package to keys
2016-07-26 07:34:57 -07:00
Johnny Bieren 2448451a18 Change git -C reset to git reset w/ wking suggestion. fix indentation
Signed-off-by: Johnny Bieren <jbieren@redhat.com>
2016-07-26 09:22:14 -04:00
Qiang Huang 8033a83975 Merge pull request #964 from zhaoleidd/test_fix
UNITTEST: Bypass userns test on platform without userns support
2016-07-26 11:30:17 +08:00
Guilherme Rezende 1cdaa709f1
libcontainer: rename keyctl package to keys
This avoid the goimports tool from remove the libcontainer/keys import line due the package name is diferent from folder name

Signed-off-by: Guilherme Rezende <guilhermebr@gmail.com>
2016-07-25 20:59:26 -03:00
Buddha Prakash ef4ff6a8ad Skip updates on parent Devices cgroup
Signed-off-by: Buddha Prakash <buddhap@google.com>
2016-07-25 10:30:46 -07:00
Zhao Lei bac8b4f0b4 UNITTEST: Bypass userns test on platform without userns support
We should bypass userns test instead of show fail in platform
without userns support.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2016-07-25 15:35:04 +08:00
Mrunal Patel fb221651e5 Merge pull request #850 from hqhq/fix_help_msg
Fix help message for memory-swap
2016-07-21 06:54:37 -07:00
Daniel, Dao Quang Minh f0e17e9a46 Merge pull request #961 from hqhq/revert_935
Revert "Use update time to detect if kmem limits have been set"
2016-07-21 14:51:21 +01:00
Daniel, Dao Quang Minh ff88baa42f Merge pull request #611 from mrunalp/fix_set
Fix cgroup Set when Paths are specified
2016-07-21 14:00:22 +01:00
Qiang Huang 9ebf816d03 Fix help message for memory-swap
Back quotes are the placeholder feature described here:
https://github.com/urfave/cli#placeholder-values

Without this, cli will take `-1` as default value as:
```
   --memory-swap -1             Total memory usage (memory + swap); set `-1` to enable unlimited swap
```

After this patch, it'll act correctly
```
   --memory-swap value          Total memory usage (memory + swap); set '-1' to enable unlimited swap
```

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-07-21 19:37:36 +08:00
Qiang Huang 15c93ee9e0 Revert "Use update time to detect if kmem limits have been set"
Revert: #935
Fixes: #946

I can reproduce #946 on some machines, the problem is on
some machines, it could be very fast that modify time
of `memory.kmem.limit_in_bytes` could be the same as
before it's modified.

And now we'll call `SetKernelMemory` twice on container
creation which cause the second time failure.

Revert this before we find a better solution.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-07-21 19:14:38 +08:00
Mrunal Patel 0ae6018eb9 Merge pull request #956 from dubstack/skip-pid
Allow cgroup creation without attaching a pid
2016-07-20 16:40:13 -07:00
Aleksa Sarai 19d517da6d Merge pull request #954 from hqhq/add_list_man_change
Add runc list man change
2016-07-21 08:10:26 +10:00
Buddha Prakash ebe85bf180 Allow cgroup creation without attaching a pid
Signed-off-by: Buddha Prakash <buddhap@google.com>
2016-07-20 13:49:48 -07:00
Mrunal Patel 7b06cc02c7 Merge pull request #957 from zhaoleidd/fix_exec_test_output
integration_testing: Fix a output typo
2016-07-20 08:35:45 -07:00
Zhao Lei f2c4c4ad35 integration_testing: Fix a output typo
s/destory/destroy for error message output.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2016-07-20 11:17:13 +08:00
Mrunal Patel bd1d3ac048 Merge pull request #951 from hmeng-19/fix_nsener_readme
Fix libcontainer/nsenter/README.md
2016-07-19 13:40:34 -04:00
Haiyan Meng 6d14dd67b2 Fix nsenter/README.md
Signed-off-by: Haiyan Meng <haiyanalady@gmail.com>
2016-07-19 12:11:33 -04:00
Qiang Huang 7e3eb32561 Add runc list man change
Follow up https://github.com/opencontainers/runc/pull/939

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-07-19 08:56:25 +08:00
Mrunal Patel 4dedd09396 Merge pull request #937 from hushan/net_cls-classid
fix setting net_cls classid
2016-07-18 17:18:23 -04:00
Mrunal Patel a0dccbd174 Merge pull request #947 from hencrice/patch-1
Fixed typo in build constraint.
2016-07-18 12:47:37 -04:00
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