Commit Graph

2956 Commits

Author SHA1 Message Date
Wang Long fd92846686 move m.GetPaths out of the loop
only call m.GetPaths once is ok. os move it out of the loop.

Signed-off-by: Wang Long <long.wanglong@huawei.com>
2016-09-13 12:19:48 +00:00
Qiang Huang 710a660506 Merge pull request #1027 from rajasec/bash-completion-create
Adding bash completion for create and run
2016-09-13 16:27:00 +08:00
Qiang Huang 5be3ce2817 Merge pull request #1036 from athomason/1035-update-runtime-spec
Update runtime-spec to current upstream
2016-09-13 16:10:10 +08:00
Michael Crosby ce0553447b Merge pull request #1038 from keloyang/make-release-fix
Fix make release error
2016-09-12 14:04:51 -07:00
Michael Crosby 9a072b611e Merge pull request #1013 from hqhq/fix_ps_issue
Fix runc ps issue
2016-09-12 14:03:21 -07:00
Mrunal Patel 124187bea3 Merge pull request #1028 from YummyPeng/fix-typo
Fix typo.
2016-09-12 10:00:41 -07:00
Mrunal Patel 88c346e2bd Merge pull request #1033 from crosbymichael/classid
Change netclassid json tag
2016-09-12 10:00:19 -07:00
Michael Crosby ad400bb093 Change netclassid json tag
This allows older state files to be loaded without the unmarshal error
of the string to int conversion.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-12 09:31:58 -07:00
rajasec e56e7ce9ca Removing fatal error from events in stopped state
Signed-off-by: rajasec <rajasec79@gmail.com>
2016-09-12 21:06:32 +05:30
Shukui Yang 8b151933ed Fix make release error:
/bin/sh: 1: Syntax error: "(" unexpected
make: *** [release] Error 2
-SHELL ?= $(shell command -v bash 2>/dev/null)
+SHELL := $(shell command -v bash 2>/dev/null)

Signed-off-by: Shukui Yang <yangshukui@huawei.com>
2016-09-12 18:52:24 +08:00
Qiang Huang b5b6989e9a Fix runc pause and runc update
Fixes: #1034
Fixes: #1031

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-09-12 16:02:56 +08:00
Qiang Huang da7bac1c90 Fix runc ps issue
After #1009, we don't always set `cgroup.Paths`, so
`getCgroupPath()` will return wrong cgroup path because
it'll take current process's cgroup as the parent, which
would be wrong when we try to find the cgroup path in
`runc ps` and `runc kill`.

Fix it by using `m.GetPath()` to get the true cgroup
paths.

Reported-by: Yang Shukui <yangshukui@huawei.com>
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-09-12 15:41:16 +08:00
Adam Thomason 98727fbb63 Update spec config path
Tracks schema/schema.json → schema/config-schema.json rename in
59ede1a6ac

Signed-off-by: Adam Thomason <ad@mthomason.net>
2016-09-11 16:48:12 -07:00
Adam Thomason 83cbdbd64c Add checks for nil spec.Linux
Signed-off-by: Adam Thomason <ad@mthomason.net>
2016-09-11 16:31:34 -07:00
Adam Thomason fcbde0ce9f Update runtime-spec to current upstream
runc currently fails to build against the upstream version of
runtime-spec/specs-go.

```
# github.com/opencontainers/runc
./spec.go:189: cannot use specs.Linux literal (type specs.Linux) as type *specs.Linux in field value
```

on account of 63231576ec (diff-7f24d60f0cbb9c433e165467e3d34838R25)

This commit updates the dependency to current runtime-spec master and
fixes the type mismatch.

Fixes #1035

Signed-off-by: Adam Thomason <ad@mthomason.net>
2016-09-11 15:17:14 -07:00
Aleksa Sarai 37f1747aec
Merge branch 'pr-914'
Closes #914
2016-09-10 17:24:16 +10:00
Yuanhong Peng a71a301a28 Fix typo.
Signed-off-by: Yuanhong Peng <pengyuanhong@huawei.com>
2016-09-09 16:18:54 +08:00
rajasec 04f1a4cc98 Adding bash completion for create and run
Signed-off-by: rajasec <rajasec79@gmail.com>
2016-09-08 12:14:42 +05:30
Qiang Huang 99c683a84f Merge pull request #1026 from rajasec/runc-readme
Typo in README.md
2016-09-08 09:50:27 +08:00
Daniel, Dao Quang Minh da202fe232 Merge pull request #1019 from keloyang/remote-by
remove redundant by in annotation(nsexec.c)
2016-09-07 22:01:19 +01:00
Mrunal Patel c6b3e79d30 Merge pull request #1017 from WeiZhang555/version-dirty
Append string "-dirty" to version if git repo is unclean
2016-09-07 12:24:19 -07:00
Mrunal Patel 564866303f Merge pull request #1024 from WeiZhang555/tiny-refactor
Tiny refactor: remove unused local variables
2016-09-07 12:22:37 -07:00
Zhang Wei 7303a9a720 Tiny refactor: remove unused local variables
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-09-06 23:41:40 +08:00
rajasec c4ffabc033 Typo in README.md
Signed-off-by: rajasec <rajasec79@gmail.com>
2016-09-06 20:24:25 +05:30
Zhao Lei a9ec7c631c [check-config] No warning in blank argument
If user run current script whthout argument, the script will search
config in default dir list, but output following message:
 | # script/check-config.sh
 | warning: /proc/config.gz seems not a kernel config, searching other paths for kernel config ...
            ^^^^^^^^^^^^^^^
 | info: reading kernel config from /boot/config-4.7.0_HEAD_523d939ef98fd712632d93a5a2b588e477a7565e_ ...
 | ...

We can make output better by restruct the code struct:
1: Specify nothing
   Show info, and search default dir
2: Specify a config file
   Use it directly
3: Specify a wrong config file
   Show warning, and search default dir
4: Specify a dir
   Info, and search specified dir

Test:
 | # script/check-config.sh
 | info: no config specified, searching for kernel config ...
 | info: reading kernel config from /boot/config-4.7.0_HEAD_523d939ef98fd712632d93a5a2b588e477a7565e_ ...
 |
 | # script/check-config.sh /linux/.config
 | info: reading kernel config from /linux/.config ...
 |
 | # script/check-config.sh /linux/.configgg
 | warning: /linux/.configgg seems not a kernel config, searching other paths for kernel config ...
 | info: reading kernel config from /boot/config-4.7.0_HEAD_523d939ef98fd712632d93a5a2b588e477a7565e_ ...
 |
 | # script/check-config.sh /linux
 | info: input is a directory, searching for kernel config in this directory...
 | info: reading kernel config from /linux/.config ...
 |

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2016-09-06 16:29:43 +08:00
Zhao Lei 6683e16c03 [check-config] Search possible files in dir
If we give a dir as argument for check-config, it will treat the
dir as a config file, and grep config contents from the dir,
and get wrong result, as:
 | # script/check-config.sh /linux
 | info: reading kernel config from /linux ...
 |
 | Generally Necessary:
 | - cgroup hierarchy: properly mounted [/sys/fs/cgroup]
 | - CONFIG_NAMESPACES: missing
 | - CONFIG_NET_NS: missing
 | - CONFIG_PID_NS: missing
 | - CONFIG_IPC_NS: missing
 | - CONFIG_UTS_NS: missing
 | - CONFIG_CGROUPS: missing
 | - CONFIG_CGROUP_CPUACCT: missing
 | - CONFIG_CGROUP_DEVICE: missing
 | - CONFIG_CGROUP_FREEZER: missing
 | - CONFIG_CGROUP_SCHED: missing
 | ...

We can search possible config files in the dir,
after patch:
 | # script/check-config.sh /linux
 | warning: /linux seems not a kernel config, searching other paths for kernel config ...
 | info: reading kernel config from /linux/.config ...
 |
 | Generally Necessary:
 | - cgroup hierarchy: properly mounted [/sys/fs/cgroup]
 | - CONFIG_NAMESPACES: enabled
 | - CONFIG_NET_NS: enabled
 | - CONFIG_PID_NS: enabled
 | - CONFIG_IPC_NS: enabled
 | - CONFIG_UTS_NS: enabled
 | - CONFIG_CGROUPS: enabled
 | - CONFIG_CGROUP_CPUACCT: enabled
 | - CONFIG_CGROUP_DEVICE: enabled
 | - CONFIG_CGROUP_FREEZER: enabled
 | - CONFIG_CGROUP_SCHED: enabled
 | ...

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2016-09-06 15:54:45 +08:00
Qiang Huang aeba315e44 Add privileged to make dbuild
So we don't get `mount: permission denied` when make dbuild.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-09-06 14:53:46 +08:00
Zhao Lei 54390f89a7 Introduce make release
So we can make all types of release binary with combination
of following flags:
 seccomp
 selinux
 apparmor
 static

All binary files are put in release/ dir, like:
 [root@zlosvm1 runc]# ls -l release
 total 53556
 -rwxr-xr-x 1 root root 9517965 Aug 24 16:59 runc
 -rwxr-xr-x 1 root root 9673533 Aug 24 17:00 runc.seccomp
 -rwxr-xr-x 1 root root 9705839 Aug 24 17:00 runc.seccomp.selinux
 -rwxr-xr-x 1 root root 9546175 Aug 24 16:59 runc.selinux
 -rwxr-xr-x 1 root root 8205015 Aug 24 16:59 runc.selinux.static
 -rwxr-xr-x 1 root root 8181789 Aug 24 16:59 runc.static
 ...
Closes #899

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2016-09-06 11:22:34 +08:00
Qiang Huang 7b0b628a9b Merge pull request #1020 from forever043/fix-makefile-integration
Makefile: Fix wrong dependency of "integration" target
2016-09-06 09:05:28 +08:00
Jiuyue Ma 4bc8637393 Makefile: Fix wrong dependency of "integration" target
Change dependency of integration to runcimage.

Signed-off-by: Jiuyue Ma <majiuyue@huawei.com>
2016-09-06 08:38:32 +08:00
Shukui Yang e15af9ffbb remove redundant by in annotation(nsexec.c)
Signed-off-by: Shukui Yang <yangshukui@huawei.com>
2016-09-05 10:53:19 +08:00
Zhang Wei 9f80653779 Append string "-dirty" to version if git repo is unclean
If runc binary is compiled from codes with modified but not commited
files, git commits should report "COMMIT-dirty" instead of single
"COMMIT" to warn users.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-09-04 16:08:39 +08:00
Qiang Huang 10da74affe Merge pull request #1012 from hqhq/fix_null_point_reference
Fix null point reference panic
2016-09-02 09:15:40 +08:00
Qiang Huang aa2dd02f5a Fix null point reference panic
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-09-01 08:34:22 +08:00
Mrunal Patel b79076544e Merge pull request #1009 from hqhq/fix_default_cgroup_parent
Fix default cgroup path
2016-08-31 14:23:14 -07:00
Mrunal Patel 795d5ce2da Merge pull request #1008 from hqhq/combine_runc_image
Combine runctestimage and runcimage
2016-08-31 14:22:11 -07:00
Michael Crosby bf8d1296a9 Merge pull request #1011 from jonboulle/master
Fix runtime-spec repository reference in README
2016-08-31 09:55:42 -07:00
Jonathan Boulle 67a6e679c6 Fix runtime-spec repository reference in README
Signed-off-by: Jonathan Boulle <jonathanboulle@gmail.com>
2016-08-31 18:43:57 +02:00
Qiang Huang a8f66ffcaf Update golang to 1.7.0
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-08-31 14:32:02 +08:00
Qiang Huang 220e5098a8 Fix default cgroup path
Alternative of #895 , part of #892

The intension of current behavior if to create cgroup in
parent cgroup of current process, but we did this in a
wrong way, we used devices cgroup path of current process
as the default parent path for all subsystems, this is
wrong because we don't always have the same cgroup path
for all subsystems.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-08-30 14:12:15 +08:00
Qiang Huang 0c80599812 Combine runctestimage and runcimage
There is no need that keep them separate, it also
fixes #1006.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-08-30 09:46:47 +08:00
Qiang Huang 189a2ab2f7 Merge pull request #1003 from rajasec/container-error
Error handling when container not exists
2016-08-27 11:18:55 +08:00
Qiang Huang face64a1ed Merge pull request #880 from rajasec/exec-status
Not exec a container from stopped state
2016-08-27 11:07:02 +08:00
Qiang Huang dc9be6cab1 Merge pull request #933 from zhaoleidd/workaround_for_ps
cli: Workaround for ps's argument
2016-08-27 10:57:17 +08:00
Mrunal Patel 9b53b362e2 Merge pull request #906 from TristanCacqueray/master
Add "--" exec cli support for command arguments
2016-08-26 10:35:26 -07:00
Tristan Cacqueray c562e4cd91 exec: Support command arguments
This enables support for exec command argument starting with a '-'.
This uses the usual argument separator '--', for example:
  runc exec containerid -- ps -afx

Without this, cli interprets command argument and fails with
'flag provided but not defined'.

Signed-off-by: Tristan Cacqueray <tdecacqu@redhat.com>
2016-08-26 02:01:40 +00:00
Qiang Huang 1e319efa36 Merge pull request #815 from rajasec/basecont-comments
Updated the libcontainer interface comments
2016-08-26 09:43:50 +08:00
rajasec 714550f87c Error handling when container not exists
Signed-off-by: rajasec <rajasec79@gmail.com>

Error handling when container not exists

Signed-off-by: rajasec <rajasec79@gmail.com>

Error handling when container not exists

Signed-off-by: rajasec <rajasec79@gmail.com>

Error handling when container not exists

Signed-off-by: rajasec <rajasec79@gmail.com>
2016-08-26 00:00:54 +05:30
Daniel, Dao Quang Minh 91dd6d2452 Merge pull request #1002 from crosbymichael/stopped
Return 0 for pid if container is stopped
2016-08-25 18:18:32 +01:00
Michael Crosby 4294d882b1 Return 0 for pid if container is stopped
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-08-25 09:44:48 -07:00