Commit Graph

5325 Commits

Author SHA1 Message Date
Jose Carlos Venegas Munoz
f45b2d9cc6 cgroups: quote some paths on errors.
Some errors propagate with printing showing a cgroup path.
If for some reason this is empty is difficult to know looking
at the logs.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-08-29 14:01:35 -05:00
Jose Carlos Venegas Munoz
6fdbef4ff5 sandbox: Rename constrainHypervisor
constrainHypervisor -> constrainHypervisorVCPUs

Document and rename function.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-08-29 14:01:35 -05:00
Jose Carlos Venegas Munoz
caac68c09f sandbox: cgroup: prefix cgroup related methods
rename to allow group in auto-generated docs.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-08-29 14:01:35 -05:00
Jose Carlos Venegas Munoz
529ec25fb7 sandbox: cgroups: move methods to sandbox file
Move sandbox related methods to its own file.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-08-29 14:01:35 -05:00
Jose Carlos Venegas Munoz
d804c3979c cgroups: container: rename functions
prefix cgroup related methods with cgroups,
make easy to group together in auto-generated docs.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-08-29 14:01:35 -05:00
James O. D. Hunt
a1e0a4c3f5
Merge pull request #1986 from marcov/kvm-required
kata-check: require kvm modules for amd64
2019-08-29 16:31:27 +01:00
Marco Vedovati
ff8d23d75f tests: allow running unit tests using podman
Refactor unit test so that podman can be used to run tests when docker
is not available.

Fixes: #2006

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-08-29 17:06:50 +02:00
Julio Montes
03248f904f
Merge pull request #691 from devimc/topic/obs/fixQEMU4.1
qemu: use upstream patch to fix OBS
2019-08-28 16:32:02 -05:00
Julio Montes
93658b550c qemu: use upstream patch to fix OBS
Apply the upstream patch that fixes OBS

fixes #690

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-28 14:57:45 +00:00
James O. D. Hunt
d89db17407
Merge pull request #545 from stefanha/virtio-fs-no-hugepages
virtiofs: hugepages is no longer required since Kata 1.8
2019-08-28 15:27:46 +01:00
Stefan Hajnoczi
6e9cc36cd3 virtiofs: hugepages is no longer required since Kata 1.8
The documentation says hugepages are required for virtio-fs.  This
limitation was removed in Kata 1.8 in kata-runtime commit
a41894da18 ("runtime: Enable file based
backend").

Fixes: #544
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2019-08-28 14:48:40 +01:00
Jose Carlos Venegas Munoz
af574851be
Merge pull request #1987 from marcov/kata-check-quiet
kata-check: reduce default output verbosity
2019-08-27 17:03:51 -05:00
Marco Vedovati
ceb8600814 how-to: k8s: rewrite intro, add cri-o RuntimeClass
Update the k8s Kata guide introduction, and specify RuntimeClass option
for CRI-O 1.12+.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-08-27 16:06:12 +02:00
Marco Vedovati
4d66559738 how-to: improve landing README.md
Improve landing README.md by categorizing howto guides.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-08-27 13:42:00 +02:00
Marco Vedovati
f91f0cc83b how-to: move k8s guide into a dedicate how-to md
Create a dedicate how-to guide for running Kata with k8s, and link to it
from the original guide location inside the Developer Guide.

Fixes: #333

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-08-27 13:42:00 +02:00
Alex Price
841ac8318a docs: add documentation for privileged and host devices
This commit adds documentation for privileged containers and the mounting of host devices
when privileged is used. It has instructions for disabling this functionality when using
Containerd and CRI.

Fixes #529

Signed-off-by: Alex Price <aprice@atlassian.com>
2019-08-27 08:45:39 +10:00
Salvador Fuentes
65cda02891
Merge pull request #686 from nitkon/vsock
kernel: enable vsock on ppc64le
2019-08-26 10:47:33 -05:00
Eric Ernst
e7c785ed19
Merge pull request #2002 from darfux/prevent_killing_cntr_with_failed_exec
v2: Prevent killing all container processes when exec is failed
2019-08-25 13:59:54 +08:00
Peng Tao
3fb872911e
Merge pull request #1833 from lifupan/fix_cleanuprace
api: add a CleanupContainer api for VC
2019-08-24 14:34:10 +08:00
Eric Ernst
031e036397
Merge pull request #688 from devimc/topic/obs/fixQEMU4.1
obs-packaging: fix qemu 4.1
2019-08-24 13:21:06 +08:00
Eric Ren
712e06ae84 virtio-fs: add virtio_fs_extra_args for virtiofsd
Since virtio-fs is under active development, more
options will be added increasingly. To avaoid frequent
change on runtime side to handle option changes, use
one mingled arg to ease testing new option/feature of
virtiofsd.

See `virtiofsd -h` for more option details.

Fixes: #1999
Signed-off-by: Eric Ren <renzhen@linux.alibaba.com>
2019-08-24 09:16:38 +08:00
lifupan
c91556aa41 api: add a CleanupContainer api for VC
When shimv2 was killed by accident, containerd would try to
launch a new shimv2 binarry to cleanup the container. In order
to avoid race condition, the cleanup should be done serialized
in a sandbox. Thus adding a new api to do this by locking the
sandbox.

Fixes:#1832

Signed-off-by: lifupan <lifupan@gmail.com>
2019-08-24 08:16:02 +08:00
Li Yuxuan
7c4e479956 vc: Remove bind destination when unmounting
`virtcontainers.ensureDestinationExists` will create the bind
destination directory/file, which should be removed properly when
unmounting.

Fixes: #1974

Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2019-08-24 00:46:30 +08:00
Julio Montes
da532e3a3a obs-packaging/qemu-vanilla: include patches
Create symlink to patches directory, the list of patches will be
included in the spec and rules files.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-23 16:41:22 +00:00
Julio Montes
4bfa767367 qemu/patches: fix OBS
add qemu patch to get the right version of python in OBS

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-23 16:41:22 +00:00
Julio Montes
e09d41d8e6 obs-packaging/qemu-vanilla: install bc to compare qemu version
bc is required to compare the qemu version and enable/disable features

fixes #687

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-23 16:41:22 +00:00
Li Yuxuan
4cf0703c58 v2: Prevent killing all container processes when exec is failed
If an exec is failed(such as executable file not found in $PATH), the
`execs.id` will be empty. This leads to all the container processes
being killed when calling `Kill` on such exec id.

Fixes: #2001
Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2019-08-24 00:25:55 +08:00
Peng Tao
eb0a3d23d9
Merge pull request #1977 from Ace-Tang/network-metric
shim v2: add network stat in metric
2019-08-23 19:57:28 +08:00
Peng Tao
1b2ec4e39e
Merge pull request #1992 from Ace-Tang/fix-error
qemu: fix error message miss
2019-08-23 19:53:19 +08:00
Marco Vedovati
5bfca6e38e test: add arch required kernel modules
Add a test for the checkKernelModules returned error count value.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-08-23 11:48:18 +02:00
Peng Tao
346d96ce4e
Merge pull request #1998 from lifupan/fix_wrongresources
Fix the issue of update resources wrong
2019-08-23 10:11:49 +08:00
Marco Vedovati
c54f00a7ca kata-check: reduce default output verbosity
Update kata-check to print by default only relevant information about
the ability to run / create Kata Containers, and omit the list of checks
performed. Checks can still be printed using the --verbose flag.

Fixes: #1944

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-08-22 20:18:26 +02:00
Marco Vedovati
24fcd1b37d test: add a generic function for CLI kata-check command
Add a generic function to run CLI kata-check tests, shared by all the
args.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-08-22 20:18:26 +02:00
lifupan
52e68f5fce virtcontainers: cleanup the container config once failed
When create container failed, it should delete the container
config from sandbox, otherwise, the following new creating container
would get a wrong resources caculating which would contain the previous
failed container resources such as memory and cpu.

Fixes: #1997

Signed-off-by: lifupan <lifupan@gmail.com>
2019-08-22 17:43:04 +08:00
Peng Tao
64caa3f4d3
Merge pull request #346 from nitkon/master
image_builder: create /etc/resolv.conf
2019-08-22 14:39:34 +08:00
Fupan Li
9a6e299827
Merge pull request #1984 from Ace-Tang/fix-monitor-hang
monitor: enlarge watch buffer
2019-08-22 14:20:06 +08:00
lifupan
5b749a56d8 virtcontainers: remove the redundant sandbox config store
The following storeSandbox() will store the sandbox config
data, thus there is no need to store it specifically before
run storeSandbox().

Signed-off-by: lifupan <lifupan@gmail.com>
2019-08-22 12:48:14 +08:00
Hui Zhu
0db6974ace
Merge pull request #1973 from bergwolf/hypervisor-pid
add virtiofsd to sandbox cgroup
2019-08-22 10:58:50 +08:00
Salvador Fuentes
a5b127b1c4
Merge pull request #1990 from lifupan/fix_consolewatching
virtcontainers: Fix the issue of watching console for firecracker
2019-08-21 14:11:07 -05:00
Jose Carlos Venegas Munoz
2d162a5f4c ci: azure: honor depends-on
- Run depends-on for packaging CI.
- Change were yq is installed

Depends-on: github.com/kata-containers/runtime#1996

Fixes: #683

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2019-08-21 14:03:53 -05:00
Julio Montes
483596b1d0 snap: Apply QEMU configs
Apply QEMU configs (Kconfigs) to trim the list of QEMU devices

fixes #682

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-21 15:19:22 +00:00
Julio Montes
b4ba93d910 qemu/configs: add config file to trim the list of qemu devices
In order to trim the list of devices, default-configs/i386-softmmu.mak must
be copied after having configured QEMU. This change helps to reduce the
attack surface and the QEMU binary size.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-21 15:19:22 +00:00
Ace-Tang
50d4188524 qemu: fix error message miss
strErr is qemu log message, should add err in error message, or if fail
before launch qemu, can not get corrent message.

Fixes: #1991

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-08-21 21:11:08 +08:00
lifupan
0926c8d9b4 virtcontainers: Fix the issue of watching console for firecracker
Since firecracker hasn't support console watching by now, so skip
watching console if the consoleURL is empty.

Fixes: #1970

Signed-off-by: lifupan <lifupan@gmail.com>
2019-08-21 20:19:42 +08:00
Nitesh Konkar
515bdc3c3f kernel: enable vsock on ppc64le
Here we bump our kernel version from 4.19.10
to 4.19.67 and enable vsock.

Fixes: #685

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2019-08-21 14:50:37 +05:30
Graham Whaley
3ed59ee50e
Merge pull request #537 from amshinde/add-instruction-pull-image
shimv2: Add instruction to pull image first
2019-08-21 09:13:02 +01:00
Peng Tao
0075bf85ba hypervisor: allow to return a slice of pids
so that for qemu, we can save and export virtiofsd pid,
and put it to the same cgroup as the qemu process.

Fixes: #1972
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-08-21 11:37:01 +08:00
Ace-Tang
88e281cb14 monitor: enlarge watch buffer
enlarge watch buffer, or no one consume monitor watcher if shim.Wait and shim.watchSandbox
simultaneously receive signal

goroutine 60 [semacquire, 641 minutes]:
sync.runtime_SemacquireMutex(0xc00037a144, 0x42cd00)
/usr/local/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc00037a140)
/usr/local/go/src/sync/mutex.go:134 +0x109
github.com/kata-containers/runtime/virtcontainers.(*monitor).stop(0xc00037a140)
/go/src/github.com/kata-containers/runtime/virtcontainers/monitor.go:95 +0x5f
github.com/kata-containers/runtime/virtcontainers.(*Sandbox).Delete(0xc0003c8160, 0x78effdc01, 0x0)
/go/src/github.com/kata-containers/runtime/virtcontainers/sandbox.go:773 +0x4fb
github.com/kata-containers/runtime/containerd-shim-v2.wait(0xc000478b80, 0xc000338240, 0x0, 0x0, 0x107d540, 0xc0000100f0, 0x107d520)
/go/src/github.com/kata-containers/runtime/containerd-shim-v2/wait.go:60 +0x3e5
created by github.com/kata-containers/runtime/containerd-shim-v2.startContainer
/go/src/github.com/kata-containers/runtime/containerd-shim-v2/start.go:74 +0x3e5

goroutine 53 [chan send, 641 minutes]:
github.com/kata-containers/runtime/virtcontainers.(*monitor).notify(0xc00037a140, 0x107cfe0, 0xc0001ec160)
/go/src/github.com/kata-containers/runtime/virtcontainers/monitor.go:87 +0xed
github.com/kata-containers/runtime/virtcontainers.(*monitor).watchAgent(0xc00037a140)
/go/src/github.com/kata-containers/runtime/virtcontainers/monitor.go:125 +0xab
github.com/kata-containers/runtime/virtcontainers.(*monitor).newWatcher.func1(0xc00037a140)
/go/src/github.com/kata-containers/runtime/virtcontainers/monitor.go:59 +0x72
created by github.com/kata-containers/runtime/virtcontainers.(*monitor).newWatcher
/go/src/github.com/kata-containers/runtime/virtcontainers/monitor.go:49 +0x125

Fixes: #1981

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-08-21 11:35:48 +08:00
Archana Shinde
0ad8270772 shimv2: Add instruction to pull image first
Running the container with `ctr` when the image is not present
on the system gives an error.

Fixes #536

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-08-20 16:02:33 -07:00
Marco Vedovati
db5097835a kata-check: require kvm/vhost modules for amd64
KVM/vhost modules are required when using QEMU or firecracker.

Fixes: #1985

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-08-20 17:58:11 +02:00