Commit Graph

9860 Commits

Author SHA1 Message Date
Bin Liu
9f0e4bb775
Merge pull request #4628 from fidencio/topic/rework-tee-kernel-builds
kernel: Deduplicate code used for building TEE kernels
2022-07-12 17:25:04 +08:00
Bin Liu
b424cf3c90
Merge pull request #4544 from openanolis/anolis/virtio_device_aarch64
runtime-rs: Dragonball-sandbox - add virtio device feature support for aarch64
2022-07-12 12:39:31 +08:00
Fabiano Fidêncio
cda1919a0a
Merge pull request #4609 from fidencio/topic/kata-deploy-simplify-config-path-handling
packaging: Simplify config path handling
2022-07-11 23:48:54 +02:00
Fabiano Fidêncio
1a25afcdf5 kernel: Allow passing the URL to download the tarball
Passing the URL to be used to download the kernel tarball is useful in
various scenarios, mainly when doing a downstream build, thus let's add
this new option.

This new option also works around a known issue of the Dockerfile used
to build the kernel not having `yq` installed.

Fixes: #4629

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-07-11 14:23:49 +02:00
snir911
0024b8d10a
Merge pull request #4617 from Yuan-Zhuo/main
build: save lines for repository_owner check
2022-07-11 15:04:35 +03:00
Fabiano Fidêncio
80c68b80a8 kernel: Deduplicate code used for building TEE kernels
There's no need to have the entire function for building SEV / TDX
duplicated.

Let's remove those functions and create a `get_tee_kernel()` which takes
the TEE as the argument.

Fixes: #4627

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-07-11 13:25:17 +02:00
xuejun-xj
d2584991eb dragonball: fix dependency unused warning
Fix the warning "unused import: `dbs_arch::gic::Error as GICError`" and
"unused import: `dbs_arch::gic::GICDevice`" in file src/vm/mod.rs when
compiling.

Fixes: #4544

Signed-off-by: xuejun-xj <jiyunxue@alibaba.linux.com>
Signed-off-by: jingshan <jingshan@linux.alibaba.com>
2022-07-11 17:55:04 +08:00
xuejun-xj
458f6f42f6 dragonball: use const string for legacy device type
As string "com1", "com2" and "rtc" are used in two files
(device_manager/mod.rs and device_manager/legacy.rs), we use public
const variables COM1, COM2 and RTC to replace them respectively.

Fixes: #4544

Signed-off-by: xuejun-xj <jiyunxue@alibaba.linux.com>
Signed-off-by: jingshan <jingshan@linux.alibaba.com>
2022-07-11 17:46:10 +08:00
James O. D. Hunt
58b0fc4794
Merge pull request #4192 from Tim-0731-Hzt/runtime-rs
kata 3.0 Architecture
2022-07-11 09:34:17 +01:00
Zhongtao Hu
0826a2157d Merge remote-tracking branch 'origin/main' into runtime-rs-1
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-07-11 09:47:23 +08:00
Zhongtao Hu
939959e726 docs: add Dragonball to hypervisors
Fixes:#4193
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-07-11 09:38:17 +08:00
xuejun-xj
f6f96b8fee dragonball: add legacy device support for aarch64
Implement RTC device for aarch64.

Fixes: #4544

Signed-off-by: xuejun-xj <jiyunxue@alibaba.linux.com>
Signed-off-by: jingshan <jingshan@linux.alibaba.com>
2022-07-10 17:35:30 +08:00
xuejun-xj
7a4183980e dragonball: add device info support for aarch64
Implement generate_virtio_device_info() and
get_virtio_mmio_device_info() functions su support the mmio_device_info
member, which is used by FDT.

Fixes: #4544

Signed-off-by: xuejun-xj <jiyunxue@linux.alibaba.com>
Signed-off-by: jingshan <jingshan@linux.alibaba.com>
2022-07-10 17:09:59 +08:00
Fabiano Fidêncio
46fd7ce025
Merge pull request #4595 from amshinde/fix-clh-tarball-build
Fix clh tarball build
2022-07-08 20:15:30 +02:00
Peng Tao
30da3fb954
Merge pull request #4515 from openanolis/anolis/dragonball-3
runtime-rs: built-in Dragonball sandbox part III - virtio-blk, virtio-fs, virtio-net and VMM API support
2022-07-08 23:14:01 +08:00
Fabiano Fidêncio
f7ccf92dc8 kata-deploy: Rely on the configured config path
Instead of passing a `KATA_CONF_FILE` environament variable, let's rely
on the configured (in the container engine) config path, as both
containerd and CRI-O support it, and we're using this for both of them.

Fixes: #4608

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-07-08 15:02:26 +02:00
Fabiano Fidêncio
33360f1710
Merge pull request #4600 from ManaSugi/fix/selinux-hypervisor-config
runtime: Fix DisableSelinux config
2022-07-08 13:05:25 +02:00
Fabiano Fidêncio
386a523a05 kata-deploy: Pass the config path to CRI-O
As we're already doing for containerd, let's also pass the configuration
path to CRI-O, as all the supported CRI-O versions do support this
configuration option.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-07-08 12:36:47 +02:00
Yuan-Zhuo
13df57c393 build: save lines for repository_owner check
repository_owner check in docs-url-alive-check.yaml now is specified for each step, it can be in job level to save lines.

Fixes: #4611

Signed-off-by: Yuan-Zhuo <yuanzhuo0118@outlook.com>
2022-07-08 10:40:30 +08:00
Bin Liu
f36bc8bc52
Merge pull request #4616 from GabyCT/topic/updatecontainerddoc
docs: Update URL links for containerd documentation
2022-07-08 08:49:06 +08:00
Gabriela Cervantes
57c2d8b749 docs: Update URL links for containerd documentation
This PR updates some url links related with containerd documentation.

Fixes #4615

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-07-07 21:48:18 +00:00
Archana Shinde
e57a1c831e build: Mark git repos as safe for build
This is not an issue when the build is run as non-privilged user.
Marking these as safe in case where the build may be run as root
or some other user.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2022-07-07 12:11:00 -07:00
GabyCT
ee3f5558ae
Merge pull request #4606 from liubin/fix/4605-delete-cri-containerd-plugin
docs: delete CRI containerd plugin statement
2022-07-07 09:35:36 -05:00
Fabiano Fidêncio
c09634dbc7
Merge pull request #4592 from fidencio/revert-kata-deploy-changes-after-2.5.0-rc0-release
release: Revert kata-deploy changes after 2.5.0-rc0 release
2022-07-07 08:59:43 +02:00
liubin
2551924bda docs: delete CRI containerd plugin statement
There is no independent CRI containerd plugin for new containerd,
the related documentation should be updated too.

Fixes: #4605

Signed-off-by: liubin <liubin0329@gmail.com>
2022-07-07 12:06:25 +08:00
Bin Liu
bee7915932
Merge pull request #4533 from bookinabox/simplify-nproc
tools/snap: simplify nproc
2022-07-07 11:38:29 +08:00
Chao Wu
9cee52153b fmt: do cargo fmt and add a dependency for blk_dev
fmt: do cargo fmt and add a dependency for blk_dev

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
Chao Wu
47a4142e0d fs: change vhostuser and virtio into const
change fs mode vhostuser and virtio into const.

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
Chao Wu
e14e98bbeb cpu_topo: add handle_cpu_topology function
add handle_cpu_topology funciton to make it easier to understand the
set_vm_configuration function.

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
Chao Wu
5d3b53ee7b downtime: add downtime support
add downtime support in `resume_all_vcpus_with_downtime`

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
Chao Wu
6a1fe85f10 vfio: add vfio as TODO
We add vfio as TODO in this commit and create a github issue for this.

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
Chao Wu
5ea35ddcdc refractor: remove redundant by_id
remove redundant by_id in get_vm_by_id_mut and get_vm_by_id. They are
optimized to get_vm_mut and get_vm.

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
Chao Wu
b646d7cb37 config: remove ht_enabled
Since cpu topology could tell whether hyper thread is enabled or not, we
removed ht_enabled config from VmConfigInfo

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
Chao Wu
cb54ac6c6e memory: remove reserve_memory_bytes
This is currently an unsupported feature and we will remove it from the
current code.

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
Chao Wu
bde6609b93 hotplug: add room for other hotplug solution
Add room in the code for other hotplug solution without upcall

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
wllenyj
d88b1bf01c dragonball: update vsock dependency
1. fix vsock device init failed
2. fix VsockDeviceConfigInfo not found

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
Chao Wu
dd003ebe0e Dragonball: change error name and fix compile error
Change error name from `StartMicrovm` to `StartMicroVm`,
`StartMicrovmError` to `StartMicroVmError`.

Besides, we fix a compile error in config_manager.

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
Chao Wu
38957fe00b UT: fix compile error in unit tests
fix compile error in unit tests for DummyConfigInfo.

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
wllenyj
11b3f95140 dragonball: add virtio-fs device support
Virtio-fs devices are supported.

Fixes: #4257

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
wllenyj
948381bdbe dragonball: add virtio-net device support
Virtio-net devices are supported.

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
wllenyj
3d20387a25 dragonball: add virtio-blk device support
Virtio-blk devices are supported.

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-07-07 10:32:35 +08:00
Chao Wu
87d38ae49f Doc: add document for Dragonball API
add detailed explanation for Dragonball API

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-07 10:32:26 +08:00
Zhongtao Hu
2bb1eeaecc docs: further questions related to upcall
add questions and answers for upcall

Fixes:#4193
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-07-07 09:52:50 +08:00
Zhongtao Hu
026aaeeccc docs: add FAQ to the report
1.provide answers for the qeustions will be frequently asked

2.format the document

Fixes:#4193
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-07-07 09:52:50 +08:00
Christophe de Dinechin
fffcb81652 docs: update the content of the report
1. Explain why the current situation is a problem.

2. We are beyond a simple introduction now, it's a real proposal.

3. Explain why you think it is solid, and fix a grammatical error.

4. The Rust rationale does not really belong to the initial paragraph.
   Also, I rephrased it to highlight the contrast with Go and the Kata community's
   past experience switching to Rust for the agent.

Fixes:#4193
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2022-07-07 09:52:46 +08:00
Zhongtao Hu
42ea854eb6 docs: kata 3.0 Architecture
An introduction for kata 3.0 architecture design

Fixes:#4193
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
2022-07-07 09:47:07 +08:00
Archana Shinde
efdb92366b build: Fix clh source build as normal user
While running make as non-privileged user, the make errors out with
the following message:
"INFO: Build cloud-hypervisor enabling the following features: tdx
Got permission denied while trying to connect to the Docker daemon
socket at unix:///var/run/docker.sock: Post
"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/create?fromImage=cloudhypervisor%2Fdev&tag=20220524-0":
dial unix /var/run/docker.sock: connect: permission denied"

Even though the user may be part of docker group, the clh build from
source does a docker in docker build. It is necessary for the user of
the nested container to be part of docker build for the build to
succeed.

Fixes #4594

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2022-07-06 18:28:00 -07:00
Derek Lee
0e40ecf383 tools/snap: simplify nproc
Replaces calls of nproc	with nproc with

nproc ${CI:+--ignore 1}

to run nproc with one less processing unit than the maximum to prevent
DOS-ing the local machine.

If process is being run in a container (determined via whether $CI is
null), all processing units avaliable will be used.

Fixes #3967

Signed-off-by: Derek Lee <derlee@redhat.com>
2022-07-06 15:04:08 -07:00
Chen Yiyang
f59939a31f
runk: Support exec sub-command
`exec` will execute a command inside a container which exists and is not
frozon or stopped. *Inside* means that the new process share namespaces
and cgroup with the container init process. Command can be specified by
`--process` parameter to read from a file, or from other parameters such
as arg, env, etc. In order to be compatible with `create`/`run`
commands, I refactor libcontainer. `Container` in builder.rs is divided
into `InitContainer` and `ActivatedContainer`. `InitContainer` is used
for `create`/`run` command. It will load spec from given bundle path.
`ActivatedContainer` is used by `exec` command, and will read the
container's status file, which stores the spec and `CreateOpt` for
creating the rustjail::LinuxContainer. Adapt the spec by replacing the
process with given options and updating the namesapces with some paths
to join the container. I also rename the `ContainerContext` as
`ContainerLauncher`, which is only used to spawn process now. It uses
the `LinuxContaier` in rustjail as the runner. For `create`/`run`, the
`launch` method will create a new container and run the first process.
For `exec`, the `launch` method will spawn a process which joins a
container.

Fixes #4363

Signed-off-by: Chen Yiyang <cyyzero@qq.com>
2022-07-06 21:11:30 +08:00
Bin Liu
be68cf0712
Merge pull request #4597 from bergwolf/github/action
action: revert commit message limit to 150 bytes
2022-07-06 17:13:15 +08:00