Commit Graph

3088 Commits

Author SHA1 Message Date
Archana Shinde
65865ab74d
Merge pull request #2613 from amshinde/update-kernel-5-4-32
version: Update kernel to lts 5.4.32
2020-04-15 06:29:57 -07:00
Fabiano Fidêncio
bf9758bf86 katautils: Use config paths set during the build
When building kata runtime packagers can simply do something like
`make CONFDIR=/usr/share/kata-containers/defaults` and it'll make
runtime understand that `/usr/share/defaults/kata-containers/` shouldn't
be used as `defaultRuntimeConfiguration` and, instead, runtime will use
whatever as passed to `make` during build time.

This is a quite common approach, mainly for distros, as there's no
perfect agreement on directory layout and whatnot.

Kwowing that, let's also make `containerd-shim-kata-v2`, which reads the
configurations from `pkg/katautils/config-settings.go`, to have a
similar behaviour as `runtime` and respect a "build-time" configured
`defaultRuntimeConfiguration` and `defaultSysConfRuntimeConfiguration`
paths.

Fixes: #2610

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-04-15 13:40:02 +02:00
Penny Zheng
c29dbae5b2 tests: deleting when tests failed
We only dumped test results for debugging, when tests failed.
we should also delete them for avoiding leaving stale test results
under /tmp.

Fixes: #442

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-04-15 13:18:38 +08:00
Jia He
8c850d9e3a config: Add scsi_mod.scan=none for virtio-scsi
As per [1], the default scan mode of scsi is sync.
kata-agent already scans the SCSI buses [2], changing it to none
can reduce the guest boot time.

=Before this patch=
[    0.113828] [    T1] scsi host0: Virtio SCSI HBA
[    0.134006] [    T1] tun: Universal TUN/TAP device driver, 1.6

=After this patch=
[    0.105891] [    T1] scsi host0: Virtio SCSI HBA
[    0.107868] [    T1] tun: Universal TUN/TAP device driver, 1.6

It reduces about 17ms on arm64 for virtio-scsi.

This patch changes the default kernel parameter:
1. If user specifies the scan mode, use that
2. If user doesn't specify it, and the block device is virtio-scsi, use
   "none" by default

[1] https://lwn.net/Articles/201898/
[2] https://github.com/kata-containers/agent/blob/649d44117a/device.go#L322

Fixes: #2560
Signed-off-by: Jia He <justin.he@arm.com
2020-04-15 09:45:48 +08:00
Archana Shinde
07d0a4f0aa version: Update kernel to lts 5.4.32
Update kernel from 5.4.15 to 5.4.32

Fixes #2612

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-04-14 15:10:29 -07:00
Jose Carlos Venegas Munoz
c369692924
Merge pull request #2595 from jcvenegas/fix-2594
clh: virtiofs: Add no_posix_lock option
2020-04-14 13:30:08 -05:00
Salvador Fuentes
84d2bacc74
Merge pull request #2604 from amshinde/update-virtiofs-kernel
versions: Switch to virtio-fs-dev branch for kernel
2020-04-14 12:04:06 -05:00
Graham Whaley
0fe23c85c2
Merge pull request #2591 from darfux/change_log_outpipe_to_rdwr
v2: Open log fifo with `RDWR` instead of `WRONLY`
2020-04-14 14:40:20 +01:00
Fabiano Fidêncio
ab8050c5e0 kata_agent: Don't use dax if virtio_fs_cache is 0
If always using dax, even if virtio_fs_cache is 0, the following error
would happen:

```
[root@f32 runtime]# podman run --security-opt label=disable  --runtime=/usr/local/bin/kata-runtime --rm -id fedora sh
Error: rpc error: code = Internal desc = Could not mount kataShared to /run/kata-containers/shared/containers/: invalid argument: OCI runtime error
```

Fixes: #2464

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-04-13 14:22:52 -07:00
Fabiano Fidêncio
6218b2a558 kata_agent: Remove sharedDirVirtioFSOptions
Although in the earlier stages of development those FUSE client mount
options were needed, when virtiofs got merged the default option values
were baked into virtiofs.ko.

Those options are not only unneeded, but they'd also cause issues when
trying to run recent enough kernels, as shown below:
```
[root@f32 runtime]# podman run --security-opt label=disable  --runtime=/usr/local/bin/kata-runtime --rm -id fedora sh
Error: rpc error: code = Internal desc = Could not mount kataShared to /run/kata-containers/shared/containers/: invalid argument: OCI runtime error
```

Fixes: #2464

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-04-13 14:22:52 -07:00
Fabiano Fidêncio
95ccc0f759 agent: Use "virtiofs" instead of "virtio_fs"
virtio_fs was the name used for the module in the very early stages of
its development.

Fixes: #2462

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-04-13 14:22:52 -07:00
Archana Shinde
4c1cacd31d versions: Switch to virtio-fs-dev branch for kernel
This includes a newer kernel and necessary overlay changes
that fix oustanding issue for running docker in docker using
overlay.

Depends-on: github.com/kata-containers/agent#738
Depends-on: github.com/kata-containers/shim#233

Fixes #2603

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-04-13 14:22:52 -07:00
Li Yuxuan
8e0f891ebc v2: Open log fifo with RDWR instead of WRONLY
The container log fifo is opened as `O_WRONLY` now. When the read side
of fifo is closed temporarily such as restarting contaienrd, write to
`tty.Stdout` will get an EPIPE error and finally cause `io.CopyBuffer`
return. Then `ioCopy` closes the tty io and exits. Thus after containerd
restarted, the log fifo can't be reopened. The container will be blocked
forever after stdout/stderr buffer is full.

Opening the log fifo with `RDWR` instead of `WRONLY` avoids the fifo
returning EPIPE when the read side is closed, and keeps the fifo open
until the reader reopening it.

Fixes: #2590

Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2020-04-10 14:58:56 +08:00
James O. D. Hunt
af24829c2a
Merge pull request #2600 from nitkon/master
qemu-ppc64le: Switch off large decrementer capability
2020-04-09 11:30:54 +01:00
Your Name
afbd03cf01 qemu-ppc64le: Switch off large decrementer capability
Large decrementer was introduced in Power 9 cpus.
Switch it off "cap-large-decr=off" as not all KVM hosts
support it

Fixes: #2599

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2020-04-09 00:04:57 -05:00
Jose Carlos Venegas Munoz
432f9bea6e clh: virtiofs: Add no_posix_lock option
This will allow lock operations, needed by programs like
`apt-get upgrade`.

Fixes: #2594

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-04-08 14:54:56 +00:00
Jose Carlos Venegas Munoz
02d8ec0bf8
Merge pull request #2593 from chavafg/topic/update-golang-version
versions: Update go to 1.13.9
2020-04-07 18:05:51 -05:00
Salvador Fuentes
0294fcb992 versions: Update go to 1.13.9
Update golang to 1.13.9 in versions.yaml.
In addition, add same golang version to `.travis.yml` and
delete the call to `.ci/install_go.sh` as it started to
cause problems in travis CI.

Fixes: #2592.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-04-07 13:04:59 -05:00
Yang Bo
c0dc7676e0
Merge pull request #179 from lifupan/fix_potentianl_crash
Fix potentianl crash
2020-04-07 19:58:52 +08:00
Jose Carlos Venegas Munoz
6e398f7c71
Merge pull request #2585 from nitkon/QemuCapablity
qemu_ppc64le: EXpose fs support explicitly
2020-04-03 09:52:42 -06:00
Julio Montes
2b92007a5c
Merge pull request #2583 from fidencio/wip/virtiofsd_not_present
qemu: Don't crash if virtiofsd path is non existent
2020-04-03 09:21:14 -06:00
Archana Shinde
2f07ec9100
Merge pull request #2503 from rhatdan/selinux
Add SELinux support for running VM Confinement
2020-04-03 07:58:58 -07:00
Fabiano Fidêncio
fd625b3fc5 qemu: Don't crash if virtiofsd path is non existent
Instead, report an error and exit gracefully, as shown below:
```
dahmer fidencio # podman run -ti --runtime=/usr/bin/kata-runtime fedora sh
Error: virtiofsd path (/usr/libexec/virtiofsd) does not exist: OCI runtime error
```

Fixes: #2582

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2020-04-03 15:44:06 +02:00
Nitesh Konkar
5eec8bdf9d qemu_ppc64le: EXpose fs support explicitly
Since fs sharing is not assumed as supported by default, expose
explicitly that the qemu_ppc64le supports it.

Fixes: #2584

Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
2020-04-03 19:08:04 +05:30
Daniel J Walsh
e4eb553d12
virtcontainers: Add SELinux support for running VM Confinement
We want to launch the KVM launcher tool (qemu?) with an SELinux label, similar
to what we do with libvirt.

Currently when I use kata with Podman, it complains if we specify a label that
kata does not support SELinux labels. What I would like to do is have kata just
use this label to apply to the KVM launcher. Then I will work to generate a new
policy type (container_kvm_t) that will allow the KVM Launcher tool to do its
thing, but prevent breakout.

Fixes: #2501

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-02 09:19:45 -04:00
fupan.lfp
ba3c732f86 grpc: fix the issue of potential crashes
It's better to check whether the sandbox's get_container
result instead of unwrap it directly, otherwise it would
crash the agent if the conainer id is invalid.

Fixes: #178

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-04-02 18:58:24 +08:00
fupan.lfp
32431d701c rpc: fix the issue of kill container process
When kill a process, if the exec id is empty, then
it means to kill all processes in the container, if
the exec id isn't empty, then it will only kill the
specific exec process.

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-04-02 17:58:46 +08:00
Yang Bo
6d61ab439c
Merge pull request #176 from lifupan/fix_hostname
sandbox: fix the issue of missing setting hostname
2020-04-01 10:00:31 +08:00
fupan.lfp
986e666b0b sandbox: fix the issue of missing setting hostname
When setup the persisten uts namespace, it's should
set the hostname for this ns.

Fixes: #175

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-03-31 17:22:24 +08:00
fupan.lfp
7d9bdf7b01 grpc: Fix the issue passing wrong exec_id to exec process
This issue was brought accidently by PR #174, fix this issue.

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-03-31 17:19:40 +08:00
Jose Carlos Venegas Munoz
705713b4f9
Merge pull request #2571 from jcvenegas/caps-clh
clh:  Implment capabilities
2020-03-30 16:33:42 -06:00
Jose Carlos Venegas Munoz
9fd7189388
Merge pull request #2536 from openSUSE/golang-update
Update go to v1.13.8
2020-03-30 12:12:41 -06:00
Julio Montes
e2d346c61d
Merge pull request #2566 from jcvenegas/fix-2565
Makefile: Allow change default hypervisor via env var
2020-03-30 07:30:49 -06:00
James O. D. Hunt
c948d8a802
Merge pull request #174 from lifupan/unify_log
unify the rustjail's log to contain container id and exec id
2020-03-30 10:02:39 +01:00
James O. D. Hunt
891b61c993
Merge pull request #405 from justin-he/boundary_mb
image_builder: Reduce the boundary mb for reducing image size on arm64
2020-03-30 09:57:06 +01:00
James O. D. Hunt
0312a60287
Merge pull request #423 from crobinso/initrd-nonroot
initrd-builder: Don't error if run as non-root
2020-03-30 09:56:38 +01:00
James O. D. Hunt
7cb647a78b
Merge pull request #439 from alicefr/skip-rust-s390x
s390x: Skip rust for s390x
2020-03-30 09:54:47 +01:00
Jose Carlos Venegas Munoz
e525003e96
Merge pull request #2552 from likebreath/warn_only_resizeCPU
clh: Report warning when requested vCPUs exceeds maxVCPU allowed
2020-03-27 13:01:48 -06:00
fupan.lfp
9220fb8e0c rustjail: unify the rustjail's log to contain container id and exec id
Add the container id and exec id to start container's log
which would make it clearly to check the log.

Fixes: #173

Signed-off-by: fupan.lfp <fupan.lfp@antfin.com>
2020-03-27 20:10:50 +08:00
Alice Frosi
2ac3090c20 s390x: Skip rust for s390x
Need to verify that rust deps are available on s390x

Fixes #438

Signed-off-by: Alice Frosi <afrosi@de.ibm.com>
2020-03-27 10:01:54 +01:00
Jose Carlos Venegas Munoz
39e354f609 clh: Implement capabilities
Make explicit that sharedfs is supported.

Other features are not supported today.

Fixes: #2567

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-27 06:14:20 +00:00
Jose Carlos Venegas Munoz
0a1ffc1d97 types: Make FS sharing disable by default
All the other caps are inverted (not supported by default).

Make fs sharing not supported by default and let hypervisors
expose if it supports it.

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-27 06:14:20 +00:00
Bo Chen
669b6e32a5 clh: Report warning when requested vCPUs exceeds maxVCPU allowed
To have a consistent behavior of CPU hotplug with qemu in clh, we should
only report warning instead of errors when the requested vCPUs exceeds
the maximum number of vCPUs allowed.

Fixes: #2551

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-03-26 19:36:09 -07:00
Jose Carlos Venegas Munoz
2a19de8aa9
Merge pull request #2556 from jcvenegas/mem-hotplug-clh-v2
clh: Enable memory hotplug
2020-03-26 15:48:19 -06:00
Jose Carlos Venegas Munoz
7997218ced Makefile: Allow change default hypervisor via env var
- Add support to change default hypervisor via env variable.

- Show in the summary the default hypervisor to be used.

```
export DEFAULT_HYPEVISOR=cloud-hypervisor
make
sudo -E make install
```

Fixes: #2565

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-26 20:59:38 +00:00
Julio Montes
4fe62ade7f
Merge pull request #2543 from devimc/topic/virtcontainers/fixQ35vfioHotplug
virtcontainers: check PCI resource format before using it
2020-03-26 14:29:26 -06:00
Jose Carlos Venegas Munoz
11c998b6c7
Merge pull request #2515 from devimc/topic/pmem-CSI
Support persistent memory volumes
2020-03-26 11:57:17 -06:00
Graham Whaley
92b2ff723c
Merge pull request #2563 from chavafg/topic/update-containerd-version
versions: Update containerd commit
2020-03-26 09:33:24 +00:00
Jose Carlos Venegas Munoz
aab82f6745 clh: Add memory hotplug
Request memory to resize memory to hypervisor.

Depends-on: github.com/kata-containers/tests#2413

Fixes: #2526

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-26 04:31:21 +00:00
Salvador Fuentes
e62a8aa98e versions: Update containerd commit
We currently use containerd v1.3.0, but this version has an
issue when running the containerd/cri tests with go 1.13.
This commit: 3a4acfbc99aa976849f51a8edd4af20ead51d8d7 from
branch release/1.3 contains the fix to be able to run the
tests with go 1.13.

Depends-on: github.com/kata-containers/tests#2415
Fixes: #2562.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
2020-03-25 18:10:52 -06:00