Commit Graph

5012 Commits

Author SHA1 Message Date
Archana Shinde
1f57eb7bcb
Merge pull request #644 from amshinde/creat-VERSION-file
version: Create a VERSION file
2020-04-15 11:01:20 -07:00
Archana Shinde
3597abdb63 version: Create a VERSION file
Since we want to start tagging and branching this repo,
create a VERSION file starting with the last version released.

Fixes #246

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-04-15 10:12:41 -07:00
Julio Montes
a1378594d1
Merge pull request #443 from Pennyzct/clean_up_when_failed
tests: deleting stale test results when tests failed
2020-04-15 10:56:36 -05:00
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
652d1fdfb8 release: Tag and fork documentation repo as part of release
We should start maintaining stable branches for the documentation
repo similar to other repos.

Fixes #1007

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-04-14 16:58:34 -07: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
Jia He
7e22144664 scripts: Disable pie for qemu when static building
--enable-pie is not compatible with --static option for qemu building.
Without this patch, it will report a configure error during static building:

ERROR: static and pie are mutually incompatible

Fixes: #982

Signed-off-by: Jia He <justin.he@arm.com>
2020-04-14 14:48:21 +08: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
James O. D. Hunt
f13b4f582f
Merge pull request #627 from dong-liuliu/xliu2/spdk-vhost-user
Revise use-case of Using-SPDK-vhostuser-and-kata.md
2020-04-09 10:49:40 +01:00
James O. D. Hunt
d71d5e1e54
Merge pull request #639 from amshinde/add-versions-for-privileged
privileged: Add containerd and crio versions.
2020-04-09 10:49:04 +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
Archana Shinde
e5046cc0ef privileged: Add containerd and crio versions.
Add containerd and crio versions that support
`privileged_without_host_devices` behaviour.

Fixes #638

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2020-04-08 16:11:11 -07:00
Salvador Fuentes
367c2ac068
Merge pull request #1005 from jodh-intel/fix-patch-ordering
kernel: Fix patch ordering
2020-04-08 12:55:28 -05:00
GabyCT
c07f20637d
Merge pull request #636 from GabyCT/topic/fixopensuse
docs: Fix opensuse installation guide
2020-04-08 10:51:51 -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
James O. D. Hunt
93da14508f kernel: Fix patch ordering
Fix the `build-kernel.sh` script to sort patches correctly. Previously,
it relied on `find(1)` for the ordering. However, `find(1)` does not
guarantee any ordering of files within a directory. Since the ordering
could therefore be "random", it was quite possible for patches to be
applied in the wrong order, resulting in conflicts.

Fixes: #1003.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2020-04-08 14:21:36 +01: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
Gabriela Cervantes
832aaea1ad docs: Fix opensuse installation guide
This PR fixes the opensuse installation guide, it solves the issue of
having an extra empty space at the end of the distro name which is causing
a failure when we want to add the kata containers obs repository as we
are looking for http://download.opensuse.org/repositories/home:/katacontainers:/releases:/x86_64:/master/openSUSE_Leap_15.1%20/
which is non existing and it is giving us an error of Valid metadata not found at specified URL.
This PR replaces the URL for a correct one.

Fixes #635

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2020-04-07 14:56:38 -05:00
Archana Shinde
9a3a226184
Merge pull request #632 from jcvenegas/docs-pkg-test
release: docs: Add information about package testing
2020-04-07 11:51:56 -07: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
James O. D. Hunt
ed13991f2d
Merge pull request #1002 from GabyCT/topic/removeupdate
tests: Remove performing updates in Fedora dockerfile
2020-04-07 15:03:50 +01: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
ab14b29116 release: docs: Add information about package testing
A basic testing can be done using jenkins pipeline.

Fixes: #631

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-04-06 21:01:35 +00:00
Gabriela Cervantes
59f7678f94 tests: Remove performing updates in Fedora dockerfiles
For obs and running the packages testing in Fedora, we need to remove
the performing of doing an update as it is hit by
https://github.com/kata-containers/runtime/issues/2580. This is needed
to unblock the errors in the testing.

Fixes #1001

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2020-04-06 12:07:11 -05:00
Graham Whaley
c5a5ac9e45
Merge pull request #576 from bergwolf/annotations
howto: add sandbox config annotation howto
2020-04-06 16:16:42 +01:00
Graham Whaley
dce8d66a30
Merge pull request #999 from wilsonianb/fix-k3s
kata-deploy: fix k3s containerd check
2020-04-06 14:20:49 +01:00
Brandon Wilson
96f3b99c7a
kata-deploy: fix k3s containerd check
The default k3s containerRuntimeVersion takes the form of:
containerd://1.3.3-k3s2

The awk was stripping away the k3s portion before checking if it was a
k3s containerd.

fixes #996

Signed-off-by: Brandon Wilson <brandon@coil.com>
2020-04-03 16:38:01 -05: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
Liu Xiaodong
688c88a60f use-cases: avoid binding PCI in using-vhost-user
By default, SPDK's setup.sh will bind PCI devices to
userspace from kernel. This may confuse beginners.
So add PCI_WHITELIST="none" to blacklist all PCI devices.

Fixes: #626

Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
2020-04-02 09:13:07 -04:00
Liu Xiaodong
2c6cb39e07 use-cases: add version notice in using vhost-user
Fixes: #626

Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
2020-04-02 09:13:07 -04:00
Liu Xiaodong
4faf21e80d use-cases: revise config on vhost-user device
Configure parameter "enable_vhost_user_store" is
added as an indicator to enable vhost-user storage
device assignment.
Also notice user hugepage should be enabled for
SPDK vhost target currently.

Fixes: #626

Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
2020-04-02 09:13:07 -04:00
Liu Xiaodong
77fb011bd1 use-cases: re-edit words in using-spdk-vhost-user
Sentences for how to do host setup for vhost-user devices
were not clear, so re-edit them.

Fixes: #626

Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
2020-04-02 09:13:02 -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