Commit Graph

10565 Commits

Author SHA1 Message Date
Fabiano Fidêncio
392c87550f
Merge pull request #6111 from littlejawa/bump_cni_plugins_to_120
versions: update cni plugins version
2023-01-25 12:40:55 +01:00
Greg Kurz
39fe4a4b6f runtime: Collect QEMU's stderr
LaunchQemu now connects a pipe to QEMU's stderr and makes it
usable by callers through a Go io.ReadCloser object. As
explained in [0], all messages should be read from the pipe
before calling cmd.Wait : introduce a LogAndWait helper to handle
that.

Fixes #5780

Signed-off-by: Greg Kurz <groug@kaod.org>
2023-01-24 23:09:17 +01:00
Greg Kurz
a5319c6be6 runtime: Start QEMU undaemonized
QEMU has always been started daemonized since the beginning. I
could not find any justification for that though, but it certainly
introduces a problem : QEMU stops logging errors when started this
way, which isn't accaptable from a support standpoint. The QEMU
community discourages the use of -daemonize ; mostly because
libvirt, QEMU's primary consummer, doesn't use this option and
prefers getting errors from QEMU's stderr through a pipe in order
to enforce rollover.

Now that virtcontainers knows how to start QEMU with a pre-
established QMP connection, let's start QEMU without -daemonize.
This requires to handle the reaping of QEMU when it terminates.
Since cmd.Wait() is blocking, call it from a goroutine.

Signed-off-by: Greg Kurz <groug@kaod.org>
2023-01-24 23:09:11 +01:00
Greg Kurz
bf4e3a618f runtime: Launch QEMU with cmd.Start()
LaunchCustomQemu() currently starts QEMU with cmd.Run() which is
supposed to block until the child process terminates. This assumes
that QEMU daemonizes itself, otherwise LaunchCustomQemu() would
block forever. The virtcontainers package indeed enables the
Daemonize knob in the configuration but having such an implicit
dependency on a supposedly configurable setting is ugly and fragile.

cmd.Run() is :

func (c *Cmd) Run() error {
	if err := c.Start(); err != nil {
		return err
	}
	return c.Wait()
}

Let's open-code this : govmm calls cmd.Start() and returns the
cmd to virtcontainers which calls cmd.Wait().

If QEMU doesn't start, e.g. missing binary, there won't be any
errors to collect from QEMU output. Just drop these lines in govmm.
Similarily there won't be any log file to read from in virtcontainers.
Drop that as well.

Signed-off-by: Greg Kurz <groug@kaod.org>
2023-01-24 23:09:11 +01:00
Greg Kurz
8a1723a5cb runtime: Pre-establish the QMP connection
Running QEMU daemonized ensures that the QMP socket is ready to
accept connections when LaunchQemu() returns. In order to be
able to run QEMU undaemonized, let's handle that part upfront.
Create a listener socket and connect to it. Pass the listener
to QEMU and pass the connected socket to QMP : this ensures
that we cannot fail to establish QMP connection and that we
can detect if QEMU exits before accepting the connection.
This is basically what libvirt does.

Signed-off-by: Greg Kurz <groug@kaod.org>
2023-01-24 23:09:11 +01:00
Greg Kurz
8a4f08cb0f govmm: Optionally pass QMP listener to QEMU
QEMU's -qmp option can be passed the file descriptor of a socket that
is already in listening mode. This is done with by passing `fd=XXX`
to `-qmp` instead of a path. Note that these two options are mutually
exclusive : QEMU errors out if both are passed, so we check that as
well in the validation function.

While here add the `path=` stanza in the path based case for clarity.

Signed-off-by: Greg Kurz <groug@kaod.org>
2023-01-24 23:08:48 +01:00
Greg Kurz
219bb8e7d0 govmm: Optionally start QMP with a pre-configured connection
When QEMU is launched daemonized, we have the guarantee that the
QMP socket is available. In order to launch a non-daemonized QEMU,
the QMP connection should be created before QEMU is started in order
to avoid a race. Introduce a variant of QMPStart() that can use such
an existing connection.

Signed-off-by: Greg Kurz <groug@kaod.org>
2023-01-24 19:16:47 +01:00
Julien Ropé
a85d0e465c versions: update cni plugins version
Use cni plugins v1.2.0 to get latest fixes.

Fixes: #6110

Signed-off-by: Julien Ropé <jrope@redhat.com>
2023-01-23 14:24:29 +01:00
Bo Chen
40c6904324
Merge pull request #6098 from likebreath/0117/clh_v29.0
versions: Upgrade to Cloud Hypervisor v29.0
2023-01-18 10:59:40 -08:00
GabyCT
421a33f846
Merge pull request #6096 from dcantah/kataruntime-use_hyp_consts
runtime: Use consts in `kata-runtime check`
2023-01-18 10:54:42 -06:00
Fabiano Fidêncio
980a2c7794
Merge pull request #6103 from fidencio/topic/bump-qemu-to-7.2.0
versions: Bump QEMU to v7.2.0
2023-01-18 17:38:47 +01:00
Fabiano Fidêncio
676d028504 versions: Bump QEMU to v7.2.0
As QEMU released its v7.2.0 version in December last year, last do the
bump on our side.

A few configuration options have been removed between the v6.2.0 (the
version we currently use) and v7.2.0, so those have also been dropped
from our configure-hypervison.sh script (for this specific version).

Also, we're explicitly setting --disable-virtiofsd for the platforms
that we're testing using the rust version.
See: a8d6abe129/docs/about/deprecated.rst (virtiofsd)

Fixes: #6102

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-18 13:11:12 +01:00
Bin Liu
083facd5ae
Merge pull request #5256 from Yuan-Zhuo/fix-agent-metrics
agent: Eliminate unnecessary metrics
2023-01-18 11:43:37 +08:00
Peng Tao
7d1a604bad
Merge pull request #6060 from ls-ggg/6055/service.mu-deadlock
runtime:all APIs are hang in the service.mu
2023-01-18 10:50:00 +08:00
Chelsea Mafrica
fa1f08f5da
Merge pull request #5812 from amshinde/kata-ctl-env-util
Utility functions for kata-env
2023-01-17 18:45:54 -08:00
Bo Chen
861c38b6aa versions: Upgrade to Cloud Hypervisor v29.0
Details of this release can be found in our new roadmap project as
iteration v29.0: https://github.com/orgs/cloud-hypervisor/projects/6.

Fixes: #6097

Signed-off-by: Bo Chen <chen.bo@intel.com>
2023-01-17 15:45:23 -08:00
David Esparza
c8596a4065
Merge pull request #6085 from GabyCT/topic/uconmonversion
versions: Update conmon version
2023-01-17 11:33:02 -06:00
Danny Canter
ba87e0afea runtime: Use consts in kata-runtime check
Fixes: #6095

We're already importing the virtcontainers package so might as well
use the constants for the hypervisor types we're checking against instead
of typing the names out in the switch cases.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-01-17 06:55:36 -08:00
Chao Wu
9f490d16fe upcall: add document for upcall
In order for users to get better understand of upcall features, we add
this document for upcall to illustrate what is upcall and how to enable
upcall.

fixes: #6054
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2023-01-17 14:53:47 +08:00
Bin Liu
790f45190b
Merge pull request #6074 from zhaojizhuang/enablevhostuserstore
runtime: paas enablevhostuserstore annotation to hypervisor config
2023-01-17 11:43:43 +08:00
Bin Liu
42efe013c1
Merge pull request #6078 from utam0k/libcli-0.4.0
runk: Upgrade liboci-cli to v0.0.4
2023-01-17 09:48:09 +08:00
Gabriela Cervantes
596037e20c versions: Update conmon version
This PR updates the conmon version that we are using in our versions.yaml

Fixes #6084

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-01-16 22:20:53 +00:00
utam0k
095e8fdef4
runk: Use the original Kill command instead of the customed it.
We can remove the custom kill command.

Fixes: #6083

Signed-off-by: utam0k <k0ma@utam0k.jp>
2023-01-16 21:35:47 +09:00
utam0k
0f9e23a3d9
runk: Upgrade liboci-cli to v0.0.4
https://github.com/containers/youki/releases/tag/v0.0.4

Fixes: #6083

Signed-off-by: utam0k <k0ma@utam0k.jp>
2023-01-16 21:35:09 +09:00
Tim Zhang
20196048bf
Merge pull request #6030 from liubin/fix/6029-use-system-hugepagesize
runtime: use system pagesize for hugepage test
2023-01-16 16:57:55 +08:00
Fupan Li
a1a7ed98df
Merge pull request #6040 from liubin/fix/6039-update-cgroup-rs
dependency: update cgroups-rs
2023-01-16 16:51:41 +08:00
ls
69fc8de712 runtime:all APIs are hang in the service.mu
When the vmm process exits abnormally, a goroutine sets s.monitor
to null in the 'watchSandbox' function without getting service.mu,
This will cause another goroutine to block when sending a message
to s.monitor, and it holds service.mu, which leads to a deadlock.
For example, the wait function in the file
.../pkg/containerd-shim-v2/wait.go will send a message to s.monitor
after obtaining service.mu, but s.monitor may be null at this time

Fixes: #6059

Signed-off-by: ls <335814617@qq.com>
2023-01-16 14:45:37 +08:00
Archana Shinde
8d4c2cf1b9 kata-ctl: Allow certain constants to go unused
The generic constants for cpu vendor and model may be superseded
by architecture specific constants. Allow these to be marked as
dead code to ignore warnings on architectures where they are overrided.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-01-15 18:07:35 -08:00
Archana Shinde
64c11a66fd kata-ctl: Have function to get cpu details to run on specific arch
This function relies on get_single_cpu function which has configured
to compile on amd64 and s390x.
Making the function get_generic_cpu_details to compile on these
architectures until we resolve the compilation for functions defined
in check.rs. This is a temporary solution until we cleanup check.rs to
make it build on all architectures.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-01-15 18:07:35 -08:00
Eric Ernst
807eeaafd0
Merge pull request #6047 from egernst/build-kata-monitor-on-darwin
runtime: Use git rev-parse for the kata-monitor tag
2023-01-13 15:29:00 -08:00
Eric Ernst
3d573ba579
Merge pull request #6050 from egernst/goos-the-vc
virtcontainers: split out linux-specific bits for mount, factory
2023-01-13 15:28:42 -08:00
Eric Ernst
458fe865ea
Merge pull request #6052 from egernst/add-darwin-skeletons
Add darwin skeletons
2023-01-13 13:14:16 -08:00
Eric Ernst
923cd3fda1 virtcontainers: split out Linux parts from mount
Mount handling is often unique in Linux. Let's ensure that the common
parts remain in mount.go, while Linux speific parts are within a linux
file.

Fixes: #6049

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2023-01-13 11:14:56 -08:00
Eric Ernst
54f2b296e3
Merge pull request #6048 from egernst/revendor-netlink
vendor: revendor netlink to get latest
2023-01-13 11:08:47 -08:00
Eric Ernst
f82918f872
Merge pull request #6045 from egernst/fix-6044
Address issues with the initial vCPU pinning functionality
2023-01-13 11:06:42 -08:00
GabyCT
9c6e90fd55
Merge pull request #6043 from GabyCT/topic/fixerrormsg
virtcontainers: Fix misspelling in error message
2023-01-13 09:16:34 -06:00
zhaojizhuang
cf1bae3521 runtime: paas enablevhostuserstore annotation to hypervisor config
Fixes: #6073
Signed-off-by: zhaojizhuang <571130360@qq.com>
2023-01-13 17:07:38 +08:00
Bin Liu
1592a385eb dependency: update cgroups-rs
Update cgroups-rs.

Fixes: #6039

Signed-off-by: Bin Liu <bin@hyper.sh>
2023-01-13 14:00:51 +08:00
Eric Ernst
60ff230d80 virtcontainers: Split the factory package into Linux and Darwin bits
- split template
- split factory
- add stubs for darwin

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2023-01-12 16:51:28 -08:00
Samuel Ortiz
76437a9721 runtime: Use git rev-parse for the kata-monitor tag
The .git-commit can be a multiple line file, potentially confusing
the Darwin linker for example.

Fixes: #6046

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2023-01-12 16:01:58 -08:00
Samuel Ortiz
a9626682af virtcontainers: resourcecontrol: Add skeleton for Darwin
Cgroups do not exist on Darwin, so use an empty implementation for
resourcecontrol for the time being. In the process, ensure that the
utilized cgroup handling (ie, isSystemdCgroup) is kept in general file,
since we use this to help assess/constrain the container spec we pass to
the guest.

Fixes: #6051

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2023-01-12 15:53:28 -08:00
Samuel Ortiz
ea06fe3afc virtcontainers: Add a Network API skeleton for Darwin
Empty for now.

Fixes: #6051

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2023-01-12 15:53:28 -08:00
Eric Ernst
6ee550e9a5 runtime: vCPUs pinning is sandbox specific, not hypervisor
While at it, make sure we persist this and fix a misc typo.

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2023-01-12 15:44:25 -08:00
Zhongtao Hu
6199b69178 runtime-rs: change cache mode
use never as the cache mode if none is configured

Fixes:#6020
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2023-01-12 18:13:50 +08:00
Zhongtao Hu
a33a22ccd1 runtime-rs: add missing config section for share-fs
add missing config sections for share-fs

Fixes:#6020
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2023-01-12 18:12:37 +08:00
Peng Tao
2b4b825228
Merge pull request #6032 from liubin/fix/6031-add-test-file-to-gitignore
runtime: add test generated file to .gitignore
2023-01-12 15:38:46 +08:00
Peng Tao
4a4232b851
Merge pull request #6037 from bergwolf/github/no-netns
runtime: fix up disable_netns handling
2023-01-12 09:58:24 +08:00
Eric Ernst
e3d3b72fa2 virtcontainers: use resource control for setting CPU affinity
Let's abstract the CPU affinity, instead of calling linux only code from
sandbox.

Fixes: #6044

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2023-01-11 17:55:53 -08:00
Eric Ernst
f137048be3 resource-control: add helper function for setting CPU affinity
Let's abstract the CPU affinity

Fixes: #6044

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2023-01-11 17:55:53 -08:00
Eric Ernst
73216a8104 vendor: revendor netlink to get latest
This'll address issue where netlink couldn't build on Darwin hosts.

Fixes: #6026

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2023-01-11 17:23:15 -08:00