Commit Graph

5290 Commits

Author SHA1 Message Date
Liu Xiaodong
126fa157a3 agent: append and handle vhost-user-blk device
Kata-runtime can append vhost-user-blk device to the
device list of a container. And handle volumes who is
a block device and in VhostUserBlk type.

The vhost-user-blk device will be identified by its
PCI address by Kata-agent inside VM.

Fixes: #2380

Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
2020-03-12 03:42:02 -04:00
Liu Xiaodong
cf066b75ac devices: hotplug vhost-user-blk device to qemu
vhost-user-blk device can be hotplugged or hotremoved
by QMP commands.

Fixes: #2380

Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
2020-03-12 03:41:59 -04:00
Liu Xiaodong
3696318436 devices: filter vhost-user-blk/scsi device
Reserved number of Linux device number 241 and 242
are used to identify vhost-user-blk and vhost-user-scsi
devices.
for example, after command:
mknod <Vhost-User-Dir>/block/devices/vhost-dev0 b 241 0
this node will be recognized as vhost-user-blk device.

Fixes: #2380

Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
2020-03-12 03:41:55 -04:00
Liu Xiaodong
54b24dad4d devices: add vhost-user storage configuration
Two parameters are used to set in toml file:

1. Set "enable_vhost_user_store = true" to indicate
that vhost-user storage device feature is enabled.

2. Set "vhost_user_store_path = <Vhost-User-Dir>".
vhost-user socket files will be under
"<Vhost-User-Dir>/block/sockets/"; and device node
for vhost-user device will be under
"<Vhost-User-Dir>/block/devices/"
The default value of "vhost_user_store_path" is
"/var/run/kata-containers/vhost-user/".

Fixes: #2380

Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
2020-03-11 21:18:29 -04:00
Julio Montes
511dc4a0e4
Merge pull request #2510 from awprice/issue-2467
vc: add agent.container_pipe_size annotation
2020-03-11 11:20:16 -06:00
Julio Montes
2fc36daef4
Merge pull request #613 from eadamsintel/qat_update
subsystem: Update QAT instructions to support 5.4 kernel
2020-03-11 09:00:24 -06:00
Jose Carlos Venegas Munoz
aa40eeffe6
Merge pull request #2525 from jcvenegas/fix-ext2-warn
clh: set rootfstype
2020-03-11 08:57:46 -06:00
Jose Carlos Venegas Munoz
4ce44ab067 clh: set rootfstype
set rootfstype=ext4 to make kernel not do print errros like:

```
Mount option "data=ordered" incompatible with ext2
```

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

Fixes: #2524

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-11 12:49:13 +00:00
Alex Price
4c28717335 vc: add agent.container_pipe_size annotation
This adds the `agent.container_pipe_size` annotation which allows
configuration of the size of the pipes for stdout/stderr for containers
inside the guest.

fixes #2467

Signed-off-by: Alex Price <aprice@atlassian.com>
2020-03-11 21:04:26 +11:00
Graham Whaley
397ce26948
Merge pull request #412 from Pennyzct/build_rust_image_on_aarch64
AArch64: Build rust image on aarch64
2020-03-11 09:37:02 +00:00
Fupan Li
5717da9262
Merge pull request #2523 from grahamwhaley/20200310_log_warn
logging: reduce default log level to Warn from Info
2020-03-11 09:23:44 +08:00
Adams, Eric
fa837917e9 subsystem: Update QAT instructions to support 5.4 kernel
The QAT instructions was broken after moving to a newer 4.19 kernel. Now
that the new 5.4 kernel is out, these instructions fix that.

Fixes #612

Signed-off-by: eric.adams@intel.com
2020-03-10 15:14:01 -07:00
Julio Montes
400fed8a0f
Merge pull request #418 from crobinso/nsdax-bin
image-builder: Add NSDAX_BIN for passing in compiled nsdax tool
2020-03-10 16:08:43 -06:00
Julio Montes
fc6db0b8f2
Merge pull request #420 from crobinso/init-no-overwrite
rootfs: Don't overwrite /sbin/init if it already exists
2020-03-10 16:07:38 -06:00
Graham Whaley
ff3b3cd957 howto: fluentd: add details for shimv2
shimv2/containerd logs are placed and formatted differently than for
kata CRI-O. Add some details to the Fluentd parsing document to aid
in parsing those.

Fixes: #610

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-03-10 19:20:36 +00:00
Graham Whaley
eee4d7012d katutils: logging: default log level to Warn
Set the katautils default log level to 'Warn', rather than 'Info',
as 'Info' is rather noisy.

Fixes: #2522

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-03-10 18:28:18 +00:00
Graham Whaley
913d1530fb cli: logging: Default to Warn level
Set the default log level explicitly to 'Warn', rather than taking
the logrus default (which is normally 'Info').

Fixes: #2522

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-03-10 18:28:18 +00:00
Graham Whaley
2cd0c88574 README: logging: add shimv2 information
The shimv2 runtime logs slightly differently - let's clarify
that in the existing OCI/CRI-O only runtime section.

Fixes: #2520

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-03-10 16:01:47 +00:00
Julio Montes
a5436627f5
Merge pull request #2517 from darfux/remove_ctr_share_dir_when_stop
vc: Remove container share dir when stopping
2020-03-10 08:10:44 -06:00
Penny Zheng
67343a178c rust-agent: Separate the build up of rust-agent and go-agent
Separate the build up of rust-agent and go-agent, hence you only
select one as kata-agent.
I've added the generation of rust-agent systemd service files into
rust-agent Makefile.
Therefore, we could use same `make` commands to build go-agent and
rust-agent.

Fixes: #411

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-03-10 21:20:53 +08:00
Penny Zheng
a390a360db rootfs: remove RUST_SRC_PATH
If user wants to use customized rust-agent, they could use
AGENT_SOURCE_BIN to pass the static binary.
The rust-agent is always statically linked with musl.

Fixes: #411

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-03-10 21:20:48 +08:00
Penny Zheng
41aaa36e6f ubuntu/debian: create aarch64-specific Dockerfile.in
The musl package in ubuntu/debian could not provide everything we need
on aarch64.
e.g. we need `aarch64-linux-musl-gcc` as linker, and it's not provided
in package.

Fixes: #411

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-03-10 21:20:43 +08:00
Penny Zheng
9cba8c4c27 musl: install musl on aarch64
The original musl-installing method is only for x86_64 and i386(see
musl config.mak template file).
musl.cc provides small and reliable pre-built musl toolchains
for many architectures.
Static so they run on supported platforms without dependencies.

Fixes: #411

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-03-10 21:20:38 +08:00
Jia He
3670074392 scripts: Disable a few options to reduce qemu binary size on generic architectures
This disables a few configure options on generic arches to reduce qemu
binary size.

Fixes #926
Signed-off-by: Jia He <justin.he@arm.com>
2020-03-10 09:23:24 +08:00
Jia He
711eae642c scripts: Set --enable-pie on aarch64 arch
PIE (position-independent executables) does good to security.

For some historical reason(compliation failure), it was disabled. But it
can be supported now on aarch64.

Fixes #926
Signed-off-by: Jia He <justin.he@arm.com>
2020-03-10 09:23:24 +08:00
Jia He
7cdf113cf0 scripts: Relax the version limitation for qemu
Currently arm64 kata uses 3.0 qemu version. Hence aarch64 can't use some
--disable configure options between [3.1, 4.0].

Besides, due to upstream qemu bug about --disable-replication, still
enable the replication on aarch64 for qemu 3.0. Please refer to the
commit 3ebb9c4f52 ("migration/colo.c: Fix compilation issue when disable
replication")

Fixes #926
Signed-off-by: Jia He <justin.he@arm.com>
2020-03-10 09:23:24 +08:00
Jia He
0871391efa scripts: Remove obsoleted --disable-uuid
Qemu commit 315d318 uses built-in UUID implementation, hence we can't
disable uuid. This option is for generic arch, not only for aarch64.

Otherwise there is a warning during configure:
configure: --disable-uuid is obsolete, UUID support is always built

Fixes #926
Signed-off-by: Jia He <justin.he@arm.com>
2020-03-10 09:23:24 +08:00
Jia He
878a223827 scripts: Disable xen when builing qemu on generic architectures
Previously, it misses to add the --disable-xen for reducing qemu size
on aarch64. This patch add disable-xen on all arches, hence the case
switch is removed.

Fixes #926
Signed-off-by: Jia He <justin.he@arm.com>
2020-03-10 09:23:24 +08:00
Li Yuxuan
ed43117554 vc: Remove container share dir when stopping
Remove the rootfs bind dest and finally remove the created share
directory when stopping the container.

Fixes #2516
Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
2020-03-10 01:12:30 +08:00
Julio Montes
be273aa43d
Merge pull request #416 from crobinso/tests-dev-mode
tests: Improve running test_images.sh locally
2020-03-09 09:33:49 -06:00
Jose Carlos Venegas Munoz
2656d1da22
Merge pull request #2509 from likebreath/hotplug_cpu
clh: enable CPU hotplug
2020-03-09 09:01:55 -06:00
Jia He
f599c8e009 kernel: Install uncompressed kernel by Image instead of
vmlinux on arm64

arm64 does not use vmlinux to boot, Image is used instead.

Otherwise, kata can't boot from vmlinux.container

Besides, given that firecracker only supports booting from Image,
don't set vmlinux for firecracker target

Fixes #930
Signed-off-by: Jia He <justin.he@arm.com>
2020-03-09 12:05:27 +08:00
Julio Montes
b99f8f7855
Merge pull request #968 from likebreath/enable-acpi-ged
ACPI: Always build evged in for experimental kernel
2020-03-06 15:27:13 -06:00
Bo Chen
17b9de140f clh: enable CPU hotplug
With the HTTP API 'vm.resize()', the CPU hotplug with CLH is much simpler
comparing with QEMU. This is because we don't need to distinguish adding from
removing CPUs.

Fixes: #2495

Depends-on: github.com/kata-containers/packaging#968
Depends-on: github.com/kata-containers/tests#2364

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-03-06 11:26:58 -08:00
Cole Robinson
87a5d5c8d7 rootfs: Don't overwrite /sbin/init if it already exists
The prepare_overlay() code path is called when rootfs.sh is invoked
with no passed in distro string. This is used for the dracut case
from the Makefile for example. In that particular case, the starting
root directory is empty.

It's also valid to pass a prepopulated directory to rootfs.sh, which
is essentially a request for the script to just make the necessary
kata changes. Currently though prepare_overlay() makes some changes
that could wipe out pre-arranged /sbin/init setup.

Check first to see if /sbin/init exists in the rootfs dir, and if so,
skip the symlink changes

Fixes: #419

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-06 13:29:28 -05:00
GabyCT
2391118363
Merge pull request #607 from grahamwhaley/20200305_v2_debug
Dev: shimv2 logs: Elaborate on shimv2 log enabling
2020-03-06 10:57:41 -06:00
Graham Whaley
e92f3db1ff actions: change trigger phrase for kata-deploy action
Let's change the kata-deploy github action trigger from:
  '/test kata-deploy'
to
 '/test-kata-deploy'

which will hopefully reduce the number of false triggers caused when
we issue the 'normal' CI runs that are triggered by other
'/test xxxx' phrases.

Fixes: #971

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-03-06 15:37:23 +00:00
Cole Robinson
6cae294e83 initrd-builder: Don't error if run as non-root
Nothing inherently requires root here. If the ROOTFS_DIR is only
root accessible then the operation may fail, but better IMO to let
that fail naturally

Fixes: #422

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-05 16:11:39 -05:00
Cole Robinson
4004bd8fbe image-builder: Add NSDAX_BIN for passing in compiled nsdax tool
In Fedora we are running the osbuilder scripts on the client machine,
to generate an initrd for the running host kernel. In this setup,
there's currently a runtime dependency on gcc for compiling the nsdax
tool, which is suboptimal.

Add NSDAX_BIN environment variable; if specified, image-builder.sh
will use that path as the nsdax tool. This let's ship a compiled
nsdax tool to users and drop the runtime gcc dependency

Fixes: #417

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-03-05 14:47:03 -05:00
Bo Chen
c3949fdd60 ACPI: Always build evged in for experimental kernel
This is required to support hotplug CPU/memory with cloud-hypervisor.

Fixes: #967

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-03-05 06:12:30 -08:00
Graham Whaley
bce991b505 Dev: shimv2 logs: Elaborate on shimv2 log enabling
There are two 'debug' settings in the containerd config file that
affect the shimv2 runtime log output. Add the other method to the
existing documentation, and also note that enabling full containerd
debug also affects all of containerd.

The commit also re-generates the TOC, which seems to correct a
few anomolies there.

Fixes: #596

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-03-05 14:05:49 +00:00
Jose Carlos Venegas Munoz
8cffbde514
Merge pull request #2507 from likebreath/fix-persist-clh
clh: add 'APIsocket' to persist HypervisorState
2020-03-04 16:45:09 -06:00
GabyCT
22afde1850
Merge pull request #158 from jcvenegas/fix-157
actions: Add verbose information
2020-03-04 15:15:42 -06:00
GabyCT
844f21ce5a
Merge pull request #964 from GabyCT/topic/removeoldf
obs: Update obs packages for ppc64le
2020-03-04 11:41:36 -06:00
Bo Chen
63c7ac5bbe clh: add 'APIsocket' to persist HypervisorState
The 'apiSocket' member in the CloudHypervisorState struct needs to be kept
across different executions of kata-runtime with persist HypervisorState, so
that kata-runtime can talk with the same running cloud-hypervisor through
HTTP/REST API calls.

Fixes: #2506

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-03-04 09:15:36 -08:00
Jose Carlos Venegas Munoz
cd233c047a actions: Add verbose information
Add a logs to debug actions easily

Fixes: #157

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2020-03-04 16:02:06 +00:00
Julio Montes
83eef430bd
Merge pull request #2008 from darfux/use_block_index_map_instead
vc: Use BlockIndexMap instead of BlockIndex
2020-03-04 09:34:35 -06:00
Julio Montes
5ec99d8c2b
Merge pull request #966 from devimc/topic/qemu/enableLibpmem
scripts: enable libpmem only for x86_64
2020-03-04 08:10:19 -06:00
Alex Price
204edf0e51 agent: add configurable container pipe size cmdline option
Adds a cmdline option to configure the stdout/stderr pipe sizes.
Uses `F_SETPIPE_SZ` to resize the write side of the pipe after
creation.

Example Cmdline option: `agent.container_pipe_size=2097152`

fixes #152

Signed-off-by: Alex Price <aprice@atlassian.com>
2020-03-04 15:31:59 +11:00
Julio Montes
83a69de4a2 scripts: enable libpmem only for x86_64
Not all architectures have support for libpmem.
Enable libpmem only for x86_64

fixes #965

Signed-off-by: Julio Montes <julio.montes@intel.com>
2020-03-03 21:24:59 +00:00