Commit Graph

12991 Commits

Author SHA1 Message Date
Pavel Mores
0cfb2d2570 runtime-rs: add simple Persist implementation for Qemu
This is not necessarily meant to work, just to stub out unimplemented
functionality while focusing on more fundamental things.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-01-08 13:12:39 +01:00
Pavel Mores
45862aeec0 runtime-rs: add default rootfs type for qemu
Make sure that rootfs type is known early on even if it's not set in
configuration.toml.

Signed-off-by: Pavel Mores <pmores@redhat.com>
2024-01-08 13:12:39 +01:00
Gabriela Cervantes
7d41c97f60 packaging: Fix indentation of build static stratovirt
This PR fixes the indentation of the build static stratovirt script
for kata containers.

Fixes #8777

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-05 18:06:08 +00:00
Dan Mihai
90c782f928 tests: list the current k8s pods
Log the list of the current pods between tests because these pods
might be related to cluster nodes occasionally running out of memory.

Fixes: #8769

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-05 16:41:43 +00:00
Xuewei Niu
192c6ee9c3
Merge pull request #8773 from justxuewei/dbs-k8s-fragile 2024-01-05 12:54:32 +08:00
Xuewei Niu
0e9d73fe30 agent: Fix an issue reporting OOM events by mistake
The agent registers an event fd in `memory.oom_control`. An OOM event is
forwarded to containerd when the event is emitted, regardless of the
content in that file.

I observed content indicating that events should not be forwarded, as shown
below. When `oom_kill` is set to 0, it means no OOM has occurred. Therefore,
it is important to check the content to avoid mistakenly forwarding OOM
events.

```
oom_kill_disable 0
under_oom 0
oom_kill 0
```

Fixes: #8715

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2024-01-05 11:06:37 +08:00
Dan Mihai
b18f269ccf
Merge pull request #8735 from microsoft/danmihai1/set-policy
agent: hold lock while setting new policy
2024-01-04 13:28:21 -08:00
GabyCT
5ea07c2b3e
Merge pull request #8776 from GabyCT/topic/addextraqemu
tests: Add hypervisor component to kill kata components function
2024-01-04 14:29:52 -06:00
Gabriela Cervantes
4ad1971a0a tests: Add hypervisor component to kill kata components function
This PR adds the qemu-experimental hypervisor in the function to
kill kata components.

Fixes #8775

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-04 17:07:12 +00:00
stevenhorsman
6bac3323be workflows: Update backport-label to use gh-utils.sh
- hub is deprecated, so use the new gh-utils.sh script that wraps the github cli instead

Fixes: #8125
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-01-04 16:48:34 +00:00
stevenhorsman
0d5d1c8c36 ci: Add gh-util.sh script
- The hub tool is now deprecated, so introduce a new alternative to `hub-util.sh`
https://github.com/kata-containers/.github/blob/main/scripts/hub-util.sh
that works with it.
Initially I've only started with the couple of commands that we use regularly, but we can extend it in future.
- Expects jq to be installed and `gh` to be installed an setup (see [1])
- Now we don't have lots of repos, I've moved it into `kata-containers` rather than `.github`,
so it is more visible.

Fixes: #8125

[1] https://docs.github.com/en/github-cli/github-cli/quickstart#prerequisites

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-01-04 16:48:34 +00:00
Dan Mihai
7d5336aca3 agent: hold lock while setting new policy
Don't release the lock between is_allowed and set_policy calls,
because the policy might change in between these calls.

Also, move more policy code into policy.rs.

Fixes: #8734

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-04 16:45:30 +00:00
GabyCT
f056ffe5ef
Merge pull request #8759 from fadecoder/update_docs_for_stratoVirt_VMM
docs: Update docs for new StratoVirt VMM introduction
2024-01-04 10:39:37 -06:00
GabyCT
4f9ee7b31c
Merge pull request #8766 from GabyCT/topic/improvedeleteion
metrics: Improve iperf3 cleanup
2024-01-04 10:38:33 -06:00
Xuewei Niu
b5a6e74cdf
Merge pull request #8744 from justxuewei/vhu-net-compile
dragonball: Fix compilation issue without all net features
2024-01-04 19:02:55 +08:00
Xuewei Niu
db948f685d
Merge pull request #8757 from justxuewei/upgrade-containerd-shim-protos
runtime-rs|agent|protocols|agent-ctl: Bump ttrpc and containerd-shim-protos versions
2024-01-04 19:02:42 +08:00
soup
7c176a62fe agent: use method params instead of const params in functions
Fixes: #8325

Signed-off-by: soup <lqh348659137@outlook.com>
2024-01-04 09:29:29 +01:00
Xuewei Niu
f97f16a44a agent-ctl: Bump ttrpc version
- `ttrpc` from `0.7.1` to `0.8`.

Fixes: #8757

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2024-01-04 15:58:34 +08:00
Xuewei Niu
bf59c7b3d4 runtime-rs: Bump ttrpc and containerd-shim-protos versions
- `ttrpc` from `0.7.1` to `0.8`.
- `containerd-shim-protos` from `0.3.0` to `0.6.0`.

Fixes: #8756

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2024-01-04 15:58:34 +08:00
Xuewei Niu
cf9a0e21a1 protocols: Bump ttrpc version
- `ttrpc` from `0.7.1` to `0.8`.

Fixes: #8756

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2024-01-04 15:58:34 +08:00
Xuewei Niu
91360e7ddb agent: Bump ttrpc version
- `ttrpc` from `0.7.1` to `0.8`.

Fixes: #8756

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2024-01-04 15:58:34 +08:00
Chao Wu
0f532175fe
Merge pull request #8771 from openanolis/chao/fix_ut
dbs-pci: introduce Cargo.lock to prevent the influence from upstream
2024-01-04 15:14:22 +08:00
Zhigang Wang
44b5b88f4c docs: Update docs for new StratoVirt VMM introduction
As the StratoVirt VMM has been added, we can update the docs
and make some intoduction to StratoVirt, thus users can know more
about the hypervisor choices.

Fixes: #8645

Signed-off-by: Zhigang Wang <wangzhigang17@huawei.com>
Signed-off-by: Liu Wenyuan <liuwenyuan9@huawei.com>
2024-01-04 14:26:48 +08:00
Chao Wu
f1235ddba3 dbs_virtio_devices: add Cargo.lock
In order to avoid rust-vmm upstream change breaks Dragonball
compilation, we introduce Cargo.lock to dbs crates.

fixes: #8770

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2024-01-04 11:23:30 +08:00
Chao Wu
02cd726bfc dbs-utils: add Cargo.lock
In order to avoid rust-vmm upstream change breaks Dragonball
compilation, we introduce Cargo.lock to dbs crates.

fixes: #8770

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2024-01-04 11:17:45 +08:00
Chao Wu
97bdc1529b dbs-pci: introduce Cargo.lock
As reported in #8767, we have found that the root cause is that rust-vmm's vmm-sys-utils
introduce a new release 0.12.1 and dbs-pci rely on rust-vmm's vfio-ioctls which uses >=
to declare vmm-sys-utils so it automatically upgrade vmm-sys-utils to 0.12.1.
That's how two different versions of vmm-sys-utils is introduced and this breaks the compilation.

In order to fix this and also avoid future problems, we introduce Cargo.lock file to dbs crates.

fixes: #8770

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2024-01-04 11:11:56 +08:00
Gabriela Cervantes
4bc67dba08 metrics: Improve iperf3 cleanup
This PR improves the iperf3 cleanup to ensure all the components are
being deleted properly to avoid the random failures of leaving
the iperf3 clients on the kata metrics CI.

Fixes #8765

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-03 17:14:38 +00:00
alex.lyn
d2080fd221 runtime-rs: refactor getting the vfio device guest pci path
Fixes: #8748

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2024-01-02 14:28:34 +08:00
alex.lyn
d795fcfc2f runtime-rs: bridge the vfio device between runtime-rs and dragonball
Previously, Dragonball did not support PCI device hot-plugging or
VFIO device passthrough. Therefore, the runtime-rs support for
Dragonball was incomplete. it is time to complete it so that users
can use Dragonball's PCI hot-plugging and VFIO passthrough capabilities.

Fixes: #8748

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2024-01-02 14:28:10 +08:00
Chao Wu
67b91c1eb3
Merge pull request #8740 from openanolis/upstream/pci-6-final
Dragonball: add pci vfio passthrough, hot(un)plug support
2023-12-29 01:58:32 +08:00
Chao Wu
71c322c293 runtime-rs: fix ci complains
vfio commits introduce quite a lot change in runtime-rs, this commit is
for all the changes related to ci, including compilation errors and so on.

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2023-12-28 23:34:41 +08:00
Chao Wu
f9e0a4bd7e upcall: introduce pci device add & del kernel patch
add pci add and del guest kernel patch as the extension
in the upcall device manager server side.

also, dump config version to 120 since we need to add config
for dragonball pci in upcall

fixes: #8741

Signed-off-by: Gerry Liu <gerry@linux.alibaba.com>
Signed-off-by: Helin Guo <helinguo@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2023-12-28 16:21:30 +08:00
Chao Wu
a3f7601f5a dragonball: add pci hotplug / hot-unplug support
Introduce two new vmm action to implement pci hotplug
and pci hot-unplug: PrepareRemoveHostDevice and RemoveHostDevice.

PrepareRemoveHostDevice is to call upcall to unregister the pci device
in the guest kernel.
RemoveHostDevice should be called after PrepareRemoveHostDevice, it is used
to clean the PCI resource in the Dragonball side.

fixes: #8741

Signed-off-by: Gerry Liu <gerry@linux.alibaba.com>
Signed-off-by: Zizheng Bian <zizheng.bian@linux.alibaba.com>
Signed-off-by: Zha Bin <zhabin@linux.alibaba.com>
Signed-off-by: Helin Guo <helinguo@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2023-12-28 16:08:31 +08:00
Chao Wu
0f402a14f9 dragonball: add InsertHostDevice vmm action
Introduce a new vmm action InsertHostDevice to passthrough
host pci devices like NIC or GPU devices into guest so that
users could have high performance usage of those devices.

fixes: #8741

Signed-off-by: Gerry Liu <gerry@linux.alibaba.com>
Signed-off-by: Zizheng Bian <zizheng.bian@linux.alibaba.com>
Signed-off-by: Zha Bin <zhabin@linux.alibaba.com>
Signed-off-by: Helin Guo <helinguo@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2023-12-28 16:04:22 +08:00
Xuewei Niu
4c023e341c dragonball: Fix compilation issue without all net features
Combinations of network features were tested:

- None
- virtio-net
- vhost-net
- vhost-user-net
- virtio-net,vhost-net
- vhost-net,vhost-user-net
- virtio-net,vhost-user-net
- virtio-net,vhost-net,vhost-user-net

Fixes: #8742

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2023-12-28 11:37:26 +08:00
Alex.Lyn
990a3adf39
Merge pull request #8618 from Apokleos/csi-for-directvol
runtime-rs: Add dedicated CSI driver for DirectVolume support in Kata
2023-12-27 21:27:29 +08:00
Chao Wu
cbd4481bc1
Merge pull request #7489 from Apokleos/pci_path
runtime-rs: add pci topology for pci devices
2023-12-27 18:52:06 +08:00
alex.lyn
ea69c17008 runtime-rs: initialize pcie topology in Device Manager
Add a pcie_topology field to DeviceManager and initialize
pcie_topology when ResourceManager calls DeviceManager's new()
with TopologyConfigInfo.

Fixes: #7218

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-27 15:57:23 +08:00
alex.lyn
b42548b8e1 runtime-rs: do unregister device in Trait Device/detach
Fixes: #7218

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-27 15:53:18 +08:00
alex.lyn
0f0b6d13c9 runtime-rs: do register/update device in Trait Device/attach
Before calling the device driver to attach a device, register
the device to PCIe topology and allocate a PciPath for it.

However, for some hypervisor such as CLH, the allocation is invalid
when plugging devices to VM, they have the ability to return
DeviceInfo containing PciPath. It'll update the PciPath with the
returned pci path in the PCIe topology for them to prevent the
inferred pcipath from being different from the actual value returned.

But the update will not be executed if the pcipath value doesn't change.

Fixes: #7218

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-27 15:49:18 +08:00
alex.lyn
ce7d363695 runtime-rs: Introduce helper macros to simplify PCIe device ops
Introduce helper macros to simplify PCIe device register/unregister
and update, which provides a convenient way to handle devices in
topology.

Fixes: #7218

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-27 15:43:58 +08:00
alex.lyn
0d4992b24d runtime-rs: add one more argument in Device attach/detach
Add one more argument with type &mut Option<&mut PCIeTopology>
in attach and detach to inroduce methods within PCIe Topology.

Fixes: #7218

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-27 15:40:01 +08:00
alex.lyn
b425de6105 runtime-rs: implement Trait PCIeDevice for pcie/pci device
Implement Trait PCIeDevice register/unregister for pcie/pci
device, such as vfio device which needs set/get device's pci
path for kata agent's device handler.

Fixes: #7218

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-27 15:33:08 +08:00
alex.lyn
87e39cd1f6 runtime-rs: introduce Trait PCIeDevice to do [un]register device
Introduce Trait PCIeDevice with register/unregister, which are
used to register or unregister pcie device within the PCIe topology.

Fixes: #7218

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-27 15:29:35 +08:00
alex.lyn
6ebc4884fa runtime-rs: introduce PCIe Topology framework for pcie/pci devices
Due to different ways that different VMMs handle PCI devices,
we expect to provide a general PCIe topology processing framework
that is as compatible as possible with VMMs such as dragonball,
qemu, clh(Though it has its own management method, no conflict).

Currently,it's mainly developed for kinds of PCIe/PCI devices in
dragonball/clh which are attached on the pci/pcie root bus directly.

More will be added when Qemu is ready in runtime-rs.

Fixes: #7218

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-27 15:29:25 +08:00
alex.lyn
88839026b9 runtime-rs: introduce TopologyConfigInfo to initialize pcie topology
A TopologyConfigInfo added to store device config info for PCIe/PCI
devices in the VM from Hypervisor DeviceInfo.

And TopologyConfigInfo::new will be the entry to initialize PCIe
Topology for each VM.

Fixes: #7218

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-12-27 15:21:53 +08:00
Fabiano Fidêncio
35f88dfc93
Merge pull request #8733 from fidencio/topic/fix-shim-check-for-snapshotter-configration
kata-deploy: Fix shim check for snapshotter configuration
2023-12-27 03:30:53 -03:00
Chao Wu
8895cb82df
Merge pull request #8724 from openanolis/chao/add_vfio
dragonball: introduce vfio support
2023-12-27 11:40:53 +08:00
Xuewei Niu
43a627c96f
Merge pull request #8632 from adamqqqplay/support-vhost-user-blk
dragonball: introduce vhost-user-blk device
2023-12-27 09:54:21 +08:00
Chao Wu
2f797a6eb7 pci: rename 2 parameters to follow rust naming convention
PciCapabilityID -> PciCapabilityId
PciBarRegionType::IORegion -> PciBarRegionType::IoRegion

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2023-12-26 23:28:47 +08:00