Commit Graph

8931 Commits

Author SHA1 Message Date
Fabiano Fidêncio
55ed32e924 clh: Take care of the VmAdNetdPut request ourselves
Knowing that VmAddNetPut works as expected, let's switch to manually
building the request and writing it to the appropriate socket.

By doing this it gives us more flexibility to, later on, pass the file
descriptor of the tuntap device to Cloud Hypervisor, as openAPI doesn't
support such operation (it has no notion of SCM Rights).

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-14 10:53:09 +00:00
Fabiano Fidêncio
01fe09a4ee clh: Hotplug the network devices
Instead of creating the VM with the network device already plugged in,
let's actually add the network device *after* the VM is created, but
*before* the Vm is actually booted.

Although it looks like it doesn't make any functional difference between
what's done in the past and what this commit introduces, this will be
used to workaround a limitation on OpenAPI when it comes to passing down
the network device's file descriptor to Cloud Hypervisor, so Cloud
Hypervisor can use it instead of opening the device by its name on the
VMM side.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-14 10:51:02 +00:00
Fabiano Fidêncio
2e07538334 clh: Expose VmAddNetPut
VmAddNetPut is the API provided by the Cloud Hypervisor client (auto
generated) code to hotplug a new network device to the VM.

Let's expose it now as it'll be used as part this series, mostly to
guide the reviewer through the process of what we have to do, as later
on, spoiler alert, it'll end up being removed.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-14 10:27:30 +00:00
Bin Liu
c84a425250
Merge pull request #4442 from openanolis/anolis/fix_safepath_clippy
safe-path: fix clippy warning
2022-06-14 14:02:42 +08:00
Chelsea Mafrica
1d5448fbca
Merge pull request #4180 from Alex-Carter01/build-kernel-efi-secret
kernel building: efi_secret module
2022-06-13 13:34:06 -07:00
Fabiano Fidêncio
a80eb33cd6
Merge pull request #4308 from fidencio/topic/virtiofsd-switch-to-using-the-rust-version-on-all-arches
runtime: Switch to using the rust version of virtiofsd (all arches but powerpc)
2022-06-13 13:45:51 +02:00
Bin Liu
81acfc1286
Merge pull request #4425 from liubin/fix/4376-change-log-level-of-getoomevent
shim: change the log level for GetOOMEvent call failures
2022-06-13 17:53:11 +08:00
James O. D. Hunt
9b93db0220
Merge pull request #4417 from jodh-intel/docs-monitor-considerations
docs: Add more kata monitor details
2022-06-13 10:51:52 +01:00
Fabiano Fidêncio
1ef0b7ded0 runtime: Switch to using the rust version of virtiofsd (all but power)
So far this has been done for x86_64.  Now that the support for building
and testing has been added for all arches, let's do the second part of
the switch.

We're still not done yet for powerpc, as some a virtifosd crash on the
rust version has been found by the maintainer.

Fixes: #4258, #4260

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-13 10:41:26 +02:00
wllenyj
b6cb2c4ae3 dragonball: add metrics system
metrics system is added for collecting Dragonball metrics to analyze the
system.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: jingshan <jingshan@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-06-13 13:51:51 +08:00
wllenyj
e80e0c4645 dragonball: add io manager wrapper
Wrapper over IoManager to support device hotplug.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: jingshan <jingshan@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-06-13 13:51:46 +08:00
Chao Wu
bb26bd73b1 safe-path: fix clippy warning
fix clippy warnings in safe-path lib to make clippy happy.

fixes: #4443

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-13 13:38:37 +08:00
Bin Liu
1a5ba31cb0 agent: refactor reading file timing for debugging
In the original code, reads mountstats file and return
the content in the error, but at this time the file maybe
changed, we should return the file content that parsed
line by line to check why there is not a fstype option.

Fixes: #4246

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-06-13 10:56:51 +08:00
Bin Liu
f23d7092e3
Merge pull request #4265 from openanolis/anolis/dragonball-1
runtime-rs: built-in Dragonball sandbox part I - resource and device managers
2022-06-12 12:17:57 +08:00
Chao Wu
d5ee3fc856 safe-path: fix clippy warning
fix clippy warnings in safe-path lib to make clippy happy.

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-12 10:24:05 +08:00
Alexandru Matei
721ca72a64 runtime: fix error when trying to parse sandbox sizing annotations
Changed bitsize for parsing functions to 64-bit in order to avoid
parsing errors.

Fixes #4435

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2022-06-11 18:51:10 +03:00
Chao Wu
93c10dfd86 runtime-rs: add crosvm license in Dragonball
add THIRD-PARTY file to add license for crosvm.

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-11 17:24:58 +08:00
Chao Wu
dfe6de7714 dragonball: add dragonball into kata README
add dragonball description into kata README to help introduce dragonball
sandbox.

Fixes: #4257

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-11 17:24:56 +08:00
wllenyj
39ff85d610 dragonball: green ci
Revert this patch, after dragonball-sandbox is ready. And all
subsequent implementations are submitted.

Fixes: #4257

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-06-11 17:24:17 +08:00
wllenyj
71f24d8271 dragonball: add Makefile.
Currently supported: build, clippy, check, format, test, clean

Fixes: #4257

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-06-11 17:24:17 +08:00
Chao Wu
a1df6d0969 Doc: Update Dragonball Readme and add document for device
Update Dragonball Readme to fix style problem and add github issue for
TODOs.

Add document for devices in dragonball. This is the document for the
current dragonball device status and we'll keep updating it when we
introduce more devices in later pull requets.

Fixes: #4257

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-11 17:24:17 +08:00
wllenyj
8619f2b3d6 dragonball: add virtio vsock device manager.
Added VsockDeviceMgr struct to manage all vsock devices.

Fixes: #4257

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-11 17:23:56 +08:00
wllenyj
52d42af636 dragonball: add device manager.
Device manager to manage IO devices for a virtual machine. And added
DeviceManagerTx to provide operation transaction for device management,
added DeviceManagerContext to operation context for device management.

Fixes: #4257

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-11 17:23:56 +08:00
wllenyj
c1c1e5152a dragonball: add kernel config.
It is used for holding guest kernel configuration information.

Fixes: #4257

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-11 17:23:46 +08:00
wllenyj
6850ef99ae dragonball: add configuration manager.
It is used for managing a group of configuration information.

Fixes: #4257

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-11 17:23:39 +08:00
wllenyj
0bcb422fcb dragonball: add legacy devices manager
The legacy devices manager is used for managing legacy devices.

Fixes: #4257

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-11 17:23:33 +08:00
wllenyj
3c45c0715f dragonball: add console manager.
Console manager to manage frontend and backend console devcies.

A virtual console are composed up of two parts: frontend in virtual
machine and backend in host OS. A frontend may be serial port,
virtio-console etc, a backend may be stdio or Unix domain socket. The
manager connects the frontend with the backend.

Fixes: #4257

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-11 17:23:27 +08:00
wllenyj
3d38bb3005 dragonball: add address space manager.
Address space abstraction to manage virtual machine's physical address space.
The AddressSpaceMgr Struct to manage address space.

Fixes: #4257

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-11 17:21:41 +08:00
wllenyj
aff6040555 dragonball: add resource manager support.
Resource manager manages all resources of a virtual machine instance.

Fixes: #4257

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-11 17:21:41 +08:00
wllenyj
8835db6b0f dragonball: initial commit
The dragonball crate initial commit that includes dragonball README and
basic code structure.

Fixes: #4257

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-06-11 17:21:41 +08:00
Fupan Li
9cb15ab4c5 agent: add the FSGroup support
Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2022-06-11 11:30:51 +08:00
Fupan Li
ff7874bc23 protobuf: upgrade the protobuf version to 2.27.0
Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2022-06-11 10:05:52 +08:00
Archana Shinde
aefe11b9ba
Merge pull request #4331 from dgibson/config-enable-iommu-annotation
Allow io.katacontainers.config.hypervisor.enable_iommu annotation by …
2022-06-10 17:43:27 -07:00
Chelsea Mafrica
7deb87dcbc
Merge pull request #4434 from fidencio/topic/bump-virtiofsd-release
versions: Bump virtiofsd to v1.3.0
2022-06-10 12:08:33 -07:00
GabyCT
f811c8b60e
Merge pull request #4431 from jodh-intel/docs-arch-storage-limits
docs: Add storage limits to arch doc
2022-06-10 11:52:45 -05:00
Zhongtao Hu
06f398a34f runtime-rs: use withContext to evaluate lazily
Fixes: #4129
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-06-10 22:03:13 +08:00
Quanwei Zhou
fd4c26f9c1 runtime-rs: support network resource
Fixes: #3785
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-06-10 22:02:58 +08:00
Tim Zhang
4be7185aa4 runtime-rs: runtime part implement
Fixes: #3785
Signed-off-by: Tim Zhang <tim@hyper.sh>
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-06-10 22:01:12 +08:00
Zhongtao Hu
10343b1f3d runtime-rs: enhance runtimes
1. support oom event
2. use ContainerProcess to store container_id and exec_id
3. support stats

Fixes: #3785
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-06-10 22:01:05 +08:00
Quanwei Zhou
9887272db9 libs: enhance kata-sys-util and kata-types
Fixes: #3785
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-06-10 21:59:47 +08:00
Quanwei Zhou
3ff0db05a7 runtime-rs: support rootfs volume for resource
Fixes: #3785
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-06-10 19:58:01 +08:00
Tim Zhang
234d7bca04 runtime-rs: support cgroup resource
Fixes: #3785
Signed-off-by: Tim Zhang <tim@hyper.sh>
2022-06-10 19:57:53 +08:00
Quanwei Zhou
75e282b4c1 runtime-rs: hypervisor base define
Responsible for VM manager, such as Qemu, Dragonball

Fixes: #3785
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-06-10 19:57:45 +08:00
Quanwei Zhou
bdfee005fa runtime-rs: service and runtime framework
1. service: Responsible for processing services, such as task service, image service
2. Responsible for implementing different runtimes, such as Virt-container,
Linux-container, Wasm-container

Fixes: #3785
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-06-10 19:57:36 +08:00
Quanwei Zhou
4296e3069f runtime-rs: agent implements
Responsible for communicating with the agent, such as kata-agent in the VM

Fixes: #3785
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-06-10 19:57:29 +08:00
Jakob Naucke
d3da156eea runtime-rs: uint FsType for s390x
statfs type on s390x should be c_uint, not __fsword_t

Fixes: #3888
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
2022-06-10 19:57:23 +08:00
quanwei.zqw
e705ee07c5 runtime-rs: update containerd-shim-protos to 0.2.0
Fixes: #3866
Signed-off-by: quanwei.zqw <quanwei.zqw@alibaba-inc.com>
2022-06-10 19:57:14 +08:00
quanwei.zqw
8c0a60e191 runtime-rs: modify the review suggestion
Fixes: #3876
Signed-off-by: quanwei.zqw <quanwei.zqw@alibaba-inc.com>
2022-06-10 19:57:07 +08:00
Zack
278f843f92 runtime-rs: shim implements for runtime-rs
Responsible for processing shim related commands: start, delete.

This patch is extracted from Alibaba Cloud's internal repository *runD*
Thanks to all contributors!

Fixes: #3785
Signed-off-by: acetang <aceapril@126.com>
Signed-off-by: Bin Liu <bin@hyper.sh>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>
Signed-off-by: Fupan Li <lifupan@gmail.com>
Signed-off-by: gexuyang <gexuyang@linux.alibaba.com>
Signed-off-by: Helin Guo <helinguo@linux.alibaba.com>
Signed-off-by: He Rongguang <herongguang@linux.alibaba.com>
Signed-off-by: Hui Zhu <teawater@gmail.com>
Signed-off-by: Issac Hai <hjwissac@linux.alibaba.com>
Signed-off-by: Jiahuan Chao <jhchao@linux.alibaba.com>
Signed-off-by: lichenglong9 <lichenglong9@163.com>
Signed-off-by: mengze <mengze@linux.alibaba.com>
Signed-off-by: Qingyuan Hou <qingyuan.hou@linux.alibaba.com>
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
Signed-off-by: shiqiangzhang <shiyu.zsq@linux.alibaba.com>
Signed-off-by: Simon Guo <wei.guo.simon@linux.alibaba.com>
Signed-off-by: Tim Zhang <tim@hyper.sh>
Signed-off-by: wanglei01 <wllenyj@linux.alibaba.com>
Signed-off-by: Wei Yang <wei.yang1@linux.alibaba.com>
Signed-off-by: yanlei <yl.on.the.way@gmail.com>
Signed-off-by: Yiqun Leng <yqleng@linux.alibaba.com>
Signed-off-by: yuchang.xu <yuchang.xu@linux.alibaba.com>
Signed-off-by: Yves Chan <lingfu@linux.alibaba.com>
Signed-off-by: Zack <zmlcc@linux.alibaba.com>
Signed-off-by: Zhiheng Tao <zhihengtao@linux.alibaba.com>
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
Signed-off-by: Zizheng Bian <zizheng.bian@linux.alibaba.com>
2022-06-10 19:56:59 +08:00
Quanwei Zhou
641b736106 libs: enhance kata-sys-util
1. move verify_cid from agent to libs/kata-sys-util
2. enhance kata-sys-util/k8s

Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-06-10 19:55:39 +08:00