Commit Graph

8923 Commits

Author SHA1 Message Date
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
Fupan Li
69ba1ae9e4 trans: fix the issue of wrong swapness type
Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2022-06-10 19:46:25 +08:00
Quanwei Zhou
d2a9bc6674 agent: agent-protocol support async
1. support async.
2. update ttrpc and protobuf
update ttrpc to 0.6.0
update protobuf to 2.23.0
3. support trans from oci

Fixes: #3746
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-06-10 19:36:55 +08:00
Fabiano Fidêncio
9773838c01 virtiofsd: export env vars needed for building it
@jongwu, mentioned on an PR[0] that env vars should be exported to
ensure that virtiofsd is statically built for non-x86_64 architectures.

[0]: https://github.com/kata-containers/kata-containers/pull/4308#issuecomment-1137125592

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-06-10 13:27:02 +02:00
Liu Jiang
aee9633ced libs/sys-util: provide functions to execute hooks
Provide functions to execute OCI hooks.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: Bin Liu <bin@hyper.sh>
Signed-off-by: Huamin Tang <huamin.thm@alibaba-inc.com>
Signed-off-by: Lei Wang <wllenyj@linux.alibaba.com>
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-06-10 19:24:30 +08:00
Liu Jiang
8509de0aea libs/sys-util: add function to detect and update K8s emptyDir volume
Add function to detect and update K8s emptyDir volume.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: Qingyuan Hou <qingyuan.hou@linux.alibaba.com>
2022-06-10 19:15:59 +08:00
Liu Jiang
6d59e8e197 libs/sys-util: introduce function to get device id
Introduce get_devid() to get major/minor number of a block device.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>
2022-06-10 19:15:28 +08:00
Liu Jiang
5300ea23ad libs/sys-util: implement reflink_copy()
Implement reflink_copy() to copy file by reflink, and fallback to normal
file copy.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>
2022-06-10 19:15:20 +08:00
Liu Jiang
1d5c898d7f libs/sys-util: add utilities to parse NUMA information
Add utilities to parse NUMA information.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: Qingyuan Hou <qingyuan.hou@linux.alibaba.com>
Signed-off-by: Simon Guo <wei.guo.simon@linux.alibaba.com>
2022-06-10 19:15:12 +08:00