Commit Graph

4802 Commits

Author SHA1 Message Date
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
Salvador Fuentes
1935bf193c
Merge pull request #1979 from devimc/topic/versions/bumpQemu
versions: update version of qemu to 4.1.0
2019-08-20 09:25:54 -05:00
Salvador Fuentes
0ec23be295
Merge pull request #680 from devimc/topic/patches/qemu4.1
patches: add patches for qemu 4.1.x
2019-08-20 09:24:58 -05:00
James O. D. Hunt
83faa9787b
Merge pull request #677 from devimc/topic/fixCVEs
Use and install the latest version of packages
2019-08-20 08:37:19 +01:00
Salvador Fuentes
c80a4afded
Merge pull request #670 from devimc/topic/snap/runAllTests
snap/ci: run all tests in the CI
2019-08-19 14:36:49 -05:00
Julio Montes
2c478f58bb patches: add patches for qemu 4.1.x
Add patches for qemu 4.1.x

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

fixes #679

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-19 19:22:53 +00:00
Marco Vedovati
66b3590533
Merge pull request #534 from marcov/revamp-install-readme
install: refresh installation guide README
2019-08-19 18:34:54 +02:00
Marco Vedovati
c3fca8b35f
Merge pull request #675 from marcov/leap-update
OBS: upgrade openSUSE Leap version
2019-08-19 18:04:08 +02:00
Julio Montes
4deeb058db versions: update version of qemu to 4.1.0
Update qemu version to bring the latest fixes and improvements:
* migration: allow private destination ram with x-ignore-shared
* hw/i386: Fix linker error when ISAPC is disabled
* hw/i386: turn off vmport if CONFIG_VMPORT is disabled

Depends-on: github.com/kata-containers/packaging#680

fixes #1978

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-19 15:39:47 +00:00
Marco Vedovati
c704edbff6 install: refresh installation guide README
Refresh installation guide README with a clearer structure, and provide
a list of distribution with official Kata packages. This also updates
the openSUSE Leap versions supported to 15 and 15.1.

Fixes: #533

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-08-19 17:32:30 +02:00
Ace-Tang
4a28b52553 test: add test for network metric
add test for metric interface

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-08-19 19:42:54 +08:00
Ace-Tang
dc38ba77bd test: fix cgroup mock test
fix cgroup mock test because of containerd/cgroup vendor update

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-08-19 18:15:06 +08:00
Ace-Tang
6534357925 shim-v2: add network stat in metric
improve metric message, add network stat, base on agent PR: #538 and
containerd/cgroup PR #81

Fixes: #1976

Signed-off-by: ZeroMagic <anthonyliu@zju.edu.cn>
Signed-off-by: Ace-Tang <aceapril@126.com>
2019-08-19 18:15:06 +08:00
Ace-Tang
21698aadc1 vendor: update cgroup
detail commit change

$ git log --no-merges --abbrev-commit --pretty=oneline "5017d4e9a9cf2d4381db99eacd9baf84b95bfb14..c4b9ac5c7601384c965b9646fc515884e091ebb9" | sed 's/^/    /g'
    f627015 avoid adding io_serviced and io_service_bytes duplicately
    13a3ac4  fixed an issue with invalid soft memory limits
    215221e Add makefile for go and protos
    0ecd2b6 cgroups: fix MoveTo function fail problem
    38dc3ac Correct forked Travis builds
    a9a304a Add Go 1.12 to Travis
    51dcf5f Fix cgroup hugetlb size prefix for kB
    1741ae0 add network stats
    453efe3 Return ErrCgroupDeleted when no subsystems
    4a9f0f7 Add SkipOpts for handling how subsystems are registered
    4dacf2b Check for non-active/supported cgroups
    2fd912c Add tests for pids
    afd5981 Gofmt cgroup_test
    f48bd85 Fixs return error message
    64bade4 Take value instead of pointer value
    b49c471 Correct ineffassign warning
    6b552a8 Fix net_prio typo
    a31a0ff Add functionality for retrieving all tasks of a cgroup
    7d825b2 Add test for cgroups load when missing hierarchy in one subsystem
    f6cbfb4 Change Load function in order to be more lenient on subsystems' checking
    ab9ec0e Add go-systemd dep for CI testing
    9a09e58 Fix gofmt of systemd.go
    e13f6cc Add GoReportCard badge to README
    d124595 Add Go 1.11 to Travis
    d961ab9 Correct typo
    e4cf832 Add project references and use common project travis
    9de57ff Add godoc badge to README.md

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-08-19 16:31:15 +08:00
Hui Zhu
7019ce5c9b
Merge pull request #1964 from bergwolf/qemu-improvements
qemu interaction improvements
2019-08-19 11:08:36 +08:00
Julio Montes
c79a01b3f9 static-build: upgrade the container before building qemu and nemu
Upgrade the container before building qemu and nemu in order to install
the latest fixes for the CVEs.

fixes #676

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-16 20:42:00 +00:00
Julio Montes
decb9de7df static-build: do not use cache to build docker images
Do not use cache to build the docker images that build static  qemu and nemu.
The latest version of the packages must be installed, since they may include
the fixes for theirs CVEs.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-16 20:42:00 +00:00
Julio Montes
7892608589 static-build/qemu: use the latest ubuntu long term to build qemu
In theory the latest ubuntu long term may have less CVE than previous versions,
so let's use it to build the static QEMU.

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-16 20:42:00 +00:00
Julio Montes
33368859d9 qemu/nemu: remove blacklisted binaries
Remove blacklisted binaries, since they are not needed in kata and may have
CVEs.

fixes #311

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-16 20:42:00 +00:00
Julio Montes
54102ca98a snap/ci: run all tests
All test should pass in the snap CI

fixes #669

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-08-16 15:44:15 +00:00
Julio Montes
ed7d57349a
Merge pull request #668 from devimc/topic/snap/supportRoofsImg
snap: support rootfs image
2019-08-16 10:43:29 -05:00
Salvador Fuentes
3dadaf64c5
Merge pull request #532 from gabibeyer/updateDocs
Update fedora version support
2019-08-16 07:59:51 -05:00
Peng Tao
e7457e6248 qemu: add logfile when debug is on
So that we can check qemu log to see if something goes wrong.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-08-16 12:58:25 +00:00
Peng Tao
aebc49692b qemu: fix memory prealloc option handling
Memory preallocation is just a property that hugepage, file backed
memory and memory-backend-ram can each choose to configure.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-08-16 12:58:25 +00:00