Commit Graph

10814 Commits

Author SHA1 Message Date
GabyCT
0f24f427d7
Merge pull request #7101 from dborquez/add_initial_metrics_gh_workflow
gha: ci-on-push: Run metrics tests
2023-06-15 10:08:56 -06:00
David Esparza
bc152b1141
gha: ci-on-push: Run metrics tests
This gh-workflow prints a simple msg, but is the base for future
PRs that will gradually add the jobs corresponding to the kata
metrics test.

Fixes: #7100

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2023-06-14 15:15:08 -06:00
GabyCT
a3180d0cb8
Merge pull request #7095 from GabyCT/topic/updatedebugconse
docs: Update Developer Guide
2023-06-14 13:49:37 -06:00
Gabriela Cervantes
dad731d5c1 docs: Update Developer Guide
This PR updates the developer guide at the connect to the debug console
section.

Fixes #7094

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-06-14 15:36:51 +00:00
Zhongtao Hu
11692a76e1
Merge pull request #7092 from Apokleos/virtiofs-enhancement
runtime-rs: Enhance flexibility of virtio-fs config
2023-06-14 20:01:46 +08:00
Zvonko Kaiser
b11246c3aa gpu: Various fixes for virt machine type
The PCI qom path was not deduced correctly added regex for correct
path walking.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-06-14 08:33:57 +00:00
Zvonko Kaiser
40101ea7db vfio: Added annotation for hot(cold) plug
Now it is possible to configure the PCIe topology via annotations
and addded a simple test, checking for Invalid and RootPort

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-06-14 08:20:24 +00:00
Zvonko Kaiser
8f0d4e2612 vfio: Cleanup of Cold and Hot Plug
Removed the configuration of PCIeRootPort and PCIeSwitchPort, those
values can be deduced in createPCIeTopology

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-06-14 08:20:24 +00:00
Zvonko Kaiser
b5c4677e0e vfio: Rearrange the bus assignemnt
Refactor the bus assignment so that the call to GetAllVFIODevicesFromIOMMUGroup
can be used by any module without affecting the topology.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-06-14 08:20:24 +00:00
Zvonko Kaiser
b1aa8c8a24 gpu: Moved the PCIe configs to drivers
The hypervisor_state file was the wrong location for the PCIe Port
settings, moved everything under device umbrella, where it can be
consumed more easily and we do not get into circular deps.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-06-14 08:20:24 +00:00
Zvonko Kaiser
55a66eb7fb gpu: Add config to TOML
Update cold-plug and hot-plug setting to include bridge, root and
switch-port

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-06-14 08:20:24 +00:00
Zvonko Kaiser
da42801c38 gpu: Add config settings tests for hot-plug
Updated all references and config settings for hot-plug to match
cold-plug

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-06-14 08:20:24 +00:00
Zvonko Kaiser
de39fb7d38 runtime: Add support for GPUDirect and GPUDirect RDMA PCIe topology
Fixes: #4491

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-06-14 08:20:24 +00:00
Zvonko Kaiser
9318e022af gpu: Add CC relates configs
For the GPU CC use case we need to set several crypto algorithms.
The driver relies on them in the CC case.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-06-14 07:56:53 +00:00
Zvonko Kaiser
b7932be4b6 gpu: Add Arm64 Kernel Settings
For different archs we need diferent settings use ${ARCH} to choose
the right fragment

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-06-14 07:56:53 +00:00
Zvonko Kaiser
211b0ab268 gpu: Update Kernel Config
Newer drivers need more symbols so lets enable them

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-06-14 07:56:53 +00:00
Zvonko Kaiser
5f103003d6 gpu: Update kernel building to the latest changes
Use now the sev.conf rather then the snp.conf.
Devices can be prestend in two different way in the
container (1) as vfio devices /dev/vfio/<num>
(2) the device is managed by whataever driver in
the VM kernel claims it.

Fixes: #6844

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-06-14 07:56:53 +00:00
Fabiano Fidêncio
95bec479ca
Merge pull request #7090 from GabyCT/topic/ufcversion
versions: Update firecracker version to 1.3.3
2023-06-14 01:24:02 +02:00
Fabiano Fidêncio
8aa4a87fae
Merge pull request #7099 from sprt/fix-new-targets
tools: Fix no-op builds
2023-06-14 01:23:39 +02:00
Aurélien Bombo
35e4938e8c tools: Fix no-op builds
This fixes the builds of `cloud-hypervisor-glibc` and
`rootfs-initrd-mariner` to properly create the `build/` directory.

Fixes: #7098

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2023-06-13 10:56:49 -07:00
Zhongtao Hu
da8dde0c24
Merge pull request #7079 from HerlinCoder/herlincoder/vpa
runtime-rs: update Cargo.lock
2023-06-13 21:44:45 +08:00
Fabiano Fidêncio
ff38937246
Merge pull request #7087 from sprt/fix-gha-stage
gha: Fix `stage` definition in matrix
2023-06-13 12:17:25 +02:00
alex.lyn
347385b4ee runtime-rs: Enhance flexibility of virtio-fs config
support more and flexible options for inline virtiofs.

Fixes: #7091

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-06-13 15:12:47 +08:00
Zhongtao Hu
355a24e0e1
Merge pull request #6289 from openanolis/runtime_vcpu_resize
feat(runtime): vcpu resize capability
2023-06-13 10:54:11 +08:00
Chelsea Mafrica
1763b1f69f
Merge pull request #7082 from jodh-intel/remove-snap
packaging: Remove snap package
2023-06-12 17:05:00 -07:00
Gabriela Cervantes
21d2278539 versions: Update firecracker version to 1.3.3
This PR updates the firecracker version to 1.3.3 which includes the following
changes
Fixed passing through cache information from host in CPUID leaf 0x80000006.
A race condition that has been identified between the API thread and the VMM
thread due to a misconfiguration of the api_event_fd.

Fixes #7089

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-06-12 20:32:02 +00:00
Aurélien Bombo
0e2379909b gha: Fix stage definition in matrix
This defines `stage` as a list instead of a literal to fix the GHA CI.

Fixes: #7086

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2023-06-12 11:24:45 -07:00
Fabiano Fidêncio
977309a281
Merge pull request #7027 from sprt/sprt/mariner-build-targets
gha: Add new build targets for Mariner
2023-06-12 19:19:22 +02:00
Yushuo
ae2cfa8263 doc: add vcpu handlint doc for runtime-rs
Kubernetes and Containerd will help calculate the Sandbox Size and pass it to
Kata Containers through annotations.

In order to accommodate this favorable change and be compatible with the past,
we have implemented the handling of the number of vCPUs in runtime-rs. This is
This is slightly different from the original runtime-go design.

This doc introduce how we handle vCPU size in runtime-rs.

Fixes: #5030

Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2023-06-12 19:23:11 +08:00
Yushuo
7b1e67819c fix(clippy): fix clippy error
Fixes: #5030

Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2023-06-12 17:53:16 +08:00
Yushuo
67972ec48a feat(runtime-rs): calculate initial size
In this commit, we refactored the logic of static resource management.

We defined the sandbox size calculated from PodSandbox's annotation and
SingleContainer's spec as initial size, which will always be the sandbox
size when booting the VM.

The configuration static_sandbox_resource_mgmt controls whether we will
modify the sandbox size in  the following container operation.

Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2023-06-12 17:53:16 +08:00
Yushuo
aaa96c749b feat(runtime-rs): modify onlineCpuMemRequest
Some vmms, such as dragonball, will actively help us
perform online cpu operations when doing cpu hotplug.
Under the old onlineCpuMem interface, it is difficult
to adapt to this situation.

So we modify the semantics of nb_cpus in onlineCpuMemRequest.
In the original semantics, nb_cpus represents the number of
newly added CPUs that need to be online. The modified
semantics become that the number of online CPUs in the guest
needs to be guaranteed.

Fixes: #5030

Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2023-06-12 17:53:16 +08:00
Yushuo
d66f7572dd feat(runtime-rs): clear cpuset in runtime side
The declaration of the cpu number in the cpuset is greater
than the actual number of vcpus, which will cause an error when
updating the cgroup in the guest.

This problem is difficult to solve, so we temporarily clean up
the cpuset in the container spec before passing in the agent.

Fixes: #5030

Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2023-06-12 17:53:16 +08:00
Yushuo
a0385e1383 feat(runtime-rs): update linux resource when stop_process
Update the resource when delete container, which is in
stop_process in runtime-rs.

Fixes: #5030

Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2023-06-12 17:53:16 +08:00
Yushuo
a39e1e6cd1 feat(runtime-rs): merge the update_cgroups in update_linux_resources
Updating vCPU resources and memory resources of the sandbox and
updating cgroups on the host will always happening together, and
they are all updated based on the linux resources declarations of
all the containers.

So we merge update_cgroups into the update_linux_resources, so we
can better manage the resources allocated to one pod in the host.

Fixes: #5030

Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2023-06-12 17:53:16 +08:00
Ji-Xinyou
fa6dff9f70 feat(runtime-rs): support vcpu resizing on runtime side
Support vcpu resizing on runtime side:
1. Calculate vcpu numbers in resource_manager using all the containers'
   linux_resources in the spec.
2. Call the hypervisor(vmm) to do the vcpu resize.
3. Call the agent to online vcpus.

Fixes: #5030
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
2023-06-12 17:53:16 +08:00
James O. D. Hunt
8cb4238b46 packaging: Remove snap package
Nobody has volunteered to maintain the (currently broken) snap build, so
remove it.

Fixes: #6769.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2023-06-12 09:24:09 +01:00
Helin Guo
2137739987 runtime-rs: update Cargo.lock
After we support memory resize in Dragonball, we need to update
Cargo.lock in runtime-rs.

Fixes: #6719

Signed-off-by: Helin Guo <helinguo@linux.alibaba.com>
2023-06-12 11:25:59 +08:00
Chao Wu
2988553305
Merge pull request #6998 from HerlinCoder/herlincoder/vpa
Dragonball: support resize memory
2023-06-11 17:21:12 +08:00
Archana Shinde
56d2ea9b78 kata-ctl: Refactor kernel module check
Adding vhost and vhost-net to the kernel modules. These do not require
any kernel module parameters to be checked. Currently, kernel params is
a required field. Make this as optional. Could make this as <Option>,
but making this a slice instead, as a module could have multiple kernel
params. Refactor the function that checks are for kernel modules into
two with one specifically checking if the module is loaded and other
checking for module parameters.

Refactor some of the tests to take into account these changes.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-06-09 14:10:31 -07:00
Aurélien Bombo
9f7a45996c gha: Add rootfs-initrd-mariner build target
This adds the Mariner guest image build target to the list of assets
as preparation for #6839.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2023-06-09 11:36:42 -07:00
Aurélien Bombo
f28a62164a gha: Add cloud-hypervisor-glibc build target
This adds the glibc flavor of CLH to the list of assets as preparation
for #6839. Mariner Kata is only tested with glibc.

Fixes: #7026

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2023-06-09 11:35:50 -07:00
Fabiano Fidêncio
b50f62ce48
Merge pull request #6756 from arronwy/measured_rootfs
Port Measured rootfs feature from CCv0 branch to main
2023-06-09 12:35:05 +02:00
Helin Guo
8fb7ab7518 dragonball: introduce virtio-balloon device
We introduce virtio-balloon device to support memory resize.
virtio-balloon device could reclaim memory from guest to host.

Fixes: #6719

Signed-off-by: Helin Guo <helinguo@linux.alibaba.com>
2023-06-09 17:47:27 +08:00
Helin Guo
7ed9494973 dragonball: introduce virtio-mem device
We introduce virtio-mem device to support memory resize. virtio-mem
device could hot-plug more memory blocks to guest and could also
hot-unplug them from guest.

Fixes: #6719

Signed-off-by: Helin Guo <helinguo@linux.alibaba.com>
2023-06-09 17:47:21 +08:00
Chao Wu
c7c45626c9
Merge pull request #6973 from Apokleos/direct-vol
add support direct volume and refactor device manager
2023-06-09 11:29:00 +08:00
alex.lyn
776a15e092 runtime-rs: add support direct volume.
As block/direct volume use similar steps of device adding,
so making full use of block volume code is a better way to
handle direct volume.

the only different point is that direct volume will use
DirectVolume and get_volume_mount_info to parse mountinfo.json
from the direct volume path. That's to say, direct volume needs
the help of `kata-ctl direct-volume ...`.

Details seen at Advanced Topics:
[How to run Kata Containers with kinds of Block Volumes]
docs/how-to/how-to-run-kata-containers-with-kinds-of-Block-Volumes.md

Fixes: #5656

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-06-09 08:16:26 +08:00
Helin Guo
a8e0f51c52 dragonball: extend DeviceOpContext
In order to support virtio-mem and virtio-balloon devices, we need to
extend DeviceOpContext with VmConfigInfo and InstanceInfo.

Fixes: #6719

Signed-off-by: Helin Guo <helinguo@linux.alibaba.com>
2023-06-08 22:04:31 +08:00
alex.lyn
abae114046 runtime-rs: refactor device manager implementation
The key aspects of the DM implementation refactoring as below:

1. reduce duplicated code
 Many scenarios have similar steps when adding devices. so to reduce
 duplicated code, we should create a common method abstracted and use
 it in various scenarios.
do_handle_device:
(1) new_device with DeviceConfig and return device_id;
(2) try_add_device with device_id and do really add device;
(3) return device info of device's info;

2. return full info of Device Trait get_device_info
 replace the original type DeviceConfig with full info DeviceType.

3. refactor find_device method.

Fixes: #5656

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-06-08 08:47:08 +08:00
Fabiano Fidêncio
08d10d38be
Merge pull request #7048 from sprt/sprt/fix-gha
gha: Fix gha-run.sh and unbreak CI
2023-06-07 23:40:02 +02:00