Commit Graph

1832 Commits

Author SHA1 Message Date
Mrunal Patel dc185c6e67 Merge pull request #20 from estesp/fix-memory-swappiness-init
Initialize memory.swappiness cgroup to -1
2015-06-23 16:17:10 -07:00
Alexander Morozov f74baf28f9 Merge pull request #21 from unclejack/gofmt_pass
libcontainer: gofmt pass
2015-06-23 16:06:18 -07:00
unclejack 9408c09d50 libcontainer: gofmt pass 2015-06-24 01:57:42 +03:00
Phil Estes 9c732ae501 Initialize memory.swappiness cgroup to -1
Set up memory.swappiness in cgroup config so write is not attempted
unless specifically set.  Fixes running runc on kernels which still have
the cgroup hierarchy write limitation.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-06-23 12:26:01 -07:00
Michael Crosby 5336c57704 Merge pull request #8 from LK4D4/remove_nsinit_readme
Remove nsinit from libcontainer README.md
2015-06-23 11:33:02 -07:00
Michael Crosby a89dd6cc74 Merge pull request #10 from LK4D4/fix_panic_in_tests
Fix panic in seccomp test on error
2015-06-23 11:32:29 -07:00
Lei Xue 682f398e8a Update README.md 2015-06-23 12:16:51 +08:00
Lei Xue f9806effff make the install steps more clear in README.md 2015-06-23 11:39:38 +08:00
Alexander Morozov 5c56d28043 Fix panic in seccomp test on error
It can happen if newContainer is failed. Now test shows real error from
newContainer instead of trace.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-22 19:26:33 -07:00
David Calavera b7ec287550 Merge pull request #11 from justjake/patch-1
Change "... JSON Format;" to "... JSON Format:"
2015-06-22 17:21:43 -07:00
Jake Teton-Landis 5ebf4c94e7 Change "... JSON Format;" to "... JSON Format:" 2015-06-22 11:09:41 -07:00
Alexander Morozov 4ac21b5fd3 Remove nsinit from libcontainer README.md
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-22 10:34:38 -07:00
Michael Crosby f20d95b6f2 Use godeps for building of vendored files
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-22 09:23:17 -07:00
Michael Crosby 9fac183294 Initial commit of runc binary
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-21 19:34:13 -07:00
Michael Crosby 080df7ab88 Update import paths for new repository
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-21 19:29:59 -07:00
Michael Crosby 8f97d39dd2 Move libcontainer into subdirectory
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-21 19:29:15 -07:00
Michael Crosby 4b5bf88a08 Remove nsinit
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-21 19:28:36 -07:00
Alexander Morozov b675770455 Merge pull request #643 from runcom/cleanup-unused
Remove unused code
2015-06-20 09:02:03 -07:00
Antonio Murdaca eb0408b199 Remove unused code
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-20 14:53:44 +02:00
Alexander Morozov a4cc960eaf Merge pull request #642 from crosbymichael/parent-cgroup
Ensure all parent dirs are properly setup
2015-06-19 16:41:48 -07:00
Michael Crosby 5e729ced92 Ensure all parent dirs are properly setup
Even if libcontainer does not create the directories for the cpuset
cgroup we should ensure that they are properly populated with the
parent's cpus and mems values.  Some systems create the directory
structures but do not correctly populate the values and causes our
implementation to fail.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-19 15:56:12 -07:00
Daniel, Dao Quang Minh ae8fc2f8de Merge pull request #640 from estesp/nsinit-memory-swappiness
Fix nsinit to configure default cgroup entry for MemorySwappiness
2015-06-19 12:54:29 +08:00
Phil Estes e1128da32a Fix nsinit to configure default cgroup entry for MemorySwappiness
As related to #639, this at least makes the "nsinit" consumer of
libcontainer initialize the value to "-1" and also allows the user to
specify a setting for the container.

This is an analog to Docker PR docker/docker#14030.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-06-18 23:42:51 -04:00
Mrunal Patel 107b7ed268 Merge pull request #638 from lizf-os/fix-check-cpu-shares
Avoid trying to access cpu.shares when it doesn't exist
2015-06-18 13:41:58 -07:00
Rohit Jnagal ed1146a8ee Merge pull request #637 from hqhq/hq_fix_kmem_cgroup
Fix kmem limit set
2015-06-18 09:45:52 -07:00
Zefan Li f112d83776 Avoid trying to access cpu.shares when it doesn't exist
Even if cpu cgroup controller is enabled it's still possible that
cpu.shares doesn't exist.

This is the case when the kernel config has CONFIG_CGROUP_SCHED
enabled but CONFIG_FAIR_GROUP_SCHED disabled. Then docker fails to
start containers even --cpu-shares isn't specified.

$ sudo docker run -i -t ubuntu:14.04
Error response from daemon: Cannot start container 5600ae87eb9d0eca49f6bcee012247d6b4beb49c426d6cf17e2456279f9311f6: [8] System error: open /sys/fs/cgroup/cpu/docker/5600ae87eb9d0eca49f6bcee012247d6b4beb49c426d6cf17e2456279f9311f6/cpu.shares: no such file or directory

Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-06-18 21:15:52 +08:00
Qiang Huang 39279b1762 Fix kmem limit set
Currently we can't start container with kmem limit, because we
set kmem limit after processes joined to cgroup, we'll get device
busy error in this case.

Fix it by moving set before join.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-06-18 15:44:30 +08:00
Daniel, Dao Quang Minh ca3ab4ba40 Merge pull request #635 from LK4D4/vet_only_needed
Fix some suspicious things in vendor
2015-06-17 11:18:41 +08:00
Alexander Morozov 76ed4ed758 Fix suspicious places in vendor
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-16 09:59:40 -07:00
Alexander Morozov 6585cf0147 Use validate-vet script from docker
It tests only changed files from commit.
We can't expect vet fixes from all projects from vendor directory.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-16 09:45:01 -07:00
Mrunal Patel 6029e2334a Merge pull request #634 from unclejack/gofmt_pass
gofmt to fix formatting
2015-06-16 09:27:08 -07:00
unclejack 19f9dea4a8 gofmt to fix formatting
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2015-06-16 12:26:27 +03:00
Michael Crosby 73eab50ed6 Merge pull request #630 from tsuna/master
Handle SYS_setns not existing but __NR_setns does.
2015-06-15 10:34:30 -07:00
Daniel, Dao Quang Minh 5dc7ba0f24 Merge pull request #627 from mrunalp/add_groups_check
Only try to get AdditionalGroups if they are configured.
2015-06-15 17:03:53 +08:00
Benoit Sigoure 6aeb7e1fa5 Handle SYS_setns not existing but __NR_setns does.
On some older Fedora distros SYS_setns was not defined, but
__NR_setns is a usable replacement.

Signed-off-by: Benoit Sigoure <tsunanet@gmail.com>
2015-06-14 02:54:44 -07:00
Alexander Morozov 61adc0d9c5 Merge pull request #622 from ktraghavendra/621_container_swappiness
Add the memory swappiness tuning support to libcontainer
2015-06-12 13:37:23 -07:00
Mrunal Patel ab3d3ce15e Only try to get AdditionalGroups if they are configured.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-06-12 13:20:44 -04:00
Michael Crosby 33b3f3801a Merge pull request #626 from icecrime/fix_nsinit_config_link
Fix nsinit README.md config link
2015-06-11 17:22:54 -07:00
Arnaud Porterie abeeada1b5 Fix nsinit README.md config link
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-06-11 17:10:25 -07:00
Alexander Morozov 024e2020d5 Merge pull request #625 from mchasal/13856-ppcifrDataByte
Additional ppc architectures follow the arm datatype
2015-06-11 16:18:18 -07:00
Mrunal Patel 73f967559b Merge pull request #624 from LK4D4/improve_cgroupmount
Use simpler parsing of /proc/self/mountinfo for FindCgroupMountpoint
2015-06-11 13:47:13 -07:00
Michael Chase-Salerno 251880b22d Additional ppc architectures follow the arm datatype
Signed-off-by: Michael Chase-Salerno <bratac@linux.vnet.ibm.com>
2015-06-11 20:07:33 +00:00
Alexander Morozov 3716bd9db2 Use simpler parsing of /proc/self/mountinfo for FindCgroupMountpoint
It sped up this function x10 times(because of not using Ssprintf).
It was one of two major performance drawbacks in docker, because we're parsing
this file pretty often.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-11 12:56:55 -07:00
Raghavendra K T ddd92caf18 Add the memory swappiness tuning support to libcontainer
Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
2015-06-11 16:56:03 +05:30
Daniel, Dao Quang Minh 2a3954f053 Merge pull request #620 from hqhq/hq_memswap_change
Don't change memswap value in libcontainer
2015-06-11 12:51:32 +08:00
Qiang Huang f7c16f1d3e Don't change memswap value in libcontainer
As discussed in https://github.com/docker/libcontainer/issues/616,
remove this logic in libcontainer.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-06-11 08:54:24 +08:00
Victor Marmol cb2d973545 Merge pull request #603 from dqminh/mrunalp-add_groups_lookup
Rebased: Additional groups lookup
2015-06-10 09:56:56 -04:00
Daniel, Dao Quang Minh d4ece29c0b refactor GetAdditionalGroupsPath
This parses group file only once to process a list of groups instead of parsing
once for each group. Also added an unit test for GetAdditionalGroupsPath

Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
2015-06-09 23:54:03 -04:00
Mrunal Patel 50603caabe Adds tests for Additional Groups.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-06-09 23:12:07 -04:00
Mrunal Patel f28dff5539 Add flags for specifying additional groups.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-06-09 23:12:07 -04:00