Commit Graph

9695 Commits

Author SHA1 Message Date
Bin Liu
b8dbb35bb7
Merge pull request #5631 from GabyCT/topic/fixvirtiofsdscript
tools: Fix indentation of build static virtiofsd script
2022-11-11 14:31:26 +08:00
Bin Liu
dff78593c0
Merge pull request #5505 from Joffref/patch-1
docs: Fix configuration path
2022-11-11 14:26:40 +08:00
Zhongtao Hu
7d91150185
Merge pull request #5536 from chentt10/fix-name-shim-source-ambiguous
runtime-rs : fix the shim source in the documentation test is ambiguous
2022-11-11 14:07:05 +08:00
Zhongtao Hu
c46814b26a runtime-rs:support nydus v5 and v6
add nydus v5 snd v6 upport for container rootfs

Fixes:#5142
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-11-11 10:15:35 +08:00
Alexandru Matei
a04afab74d qemu: early exit from Check if the process was stopped
Fixes: #5625

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2022-11-10 22:43:32 +02:00
Alexandru Matei
7e481f2179 qemu: set stopped only if StopVM is successful
Fixes: #5624

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2022-11-10 22:43:32 +02:00
Alexandru Matei
0e3ac66e76 clh: return faster with dead clh process from isClhRunning
Through proactively checking if Cloud Hypervisor process is dead,
this patch provides a faster path for isClhRunning

Fixes: #5623

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2022-11-10 22:43:32 +02:00
Alexandru Matei
9ef68e0c7a clh: fast exit from isClhRunning if the process was stopped
Use atomic operations instead of acquiring a mutex in isClhRunning.
This stops isClhRunning from generating a deadlock by trying to
reacquire an already-acquired lock when called via StopVM->terminate.

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2022-11-10 22:43:32 +02:00
Alexandru Matei
2631b08ff1 clh: don't try to stop clh multiple times
Avoid executing StopVM concurrently when virtiofs dies as a result of clh
being stopped in StopVM.

Fixes: #5622

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2022-11-10 22:43:32 +02:00
James O. D. Hunt
56641bc230
Merge pull request #5637 from openanolis/chao/update_cargo_lock
versions: update vmm-sys-util and related crates to v0.11.0
2022-11-10 13:49:24 +00:00
Chao Wu
f45fe4f90d versions: update vmm-sys-util and related crates to v0.11.0
Since the upstream of vmm-sys-utils upgraded to 0.11.0, some crates
automatically upgrade to v0.11.0, and some stay at v0.10.0 ( depending
on how they write version dependency in Cargo toml` which causes the
compile error in runtime-rs.

In order to fix this problem, we need to upgrade all vmm-sys-util
dependencies in runtime-rs to v0.11.0.

fixes: #5636

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-11-10 19:13:23 +08:00
quanweiZhou
bbc93260c9
Merge pull request #5615 from openanolis/chao/delete_cargo_patch
runtime-rs: delete all cargo patches
2022-11-10 10:18:19 +08:00
Gabriela Cervantes
8be0817305 tools: Fix indentation of build static virtiofsd script
This Pr removes single spaces and fix the indentation of the script.

Fixes #5630

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-11-09 17:09:13 +00:00
Zhongtao Hu
071ac4693a
Merge pull request #5613 from openanolis/iptables
feat(shim-mgmt): iptables handler
2022-11-09 17:21:45 +08:00
Bin Liu
1d59137c6f
Merge pull request #5620 from GabyCT/topic/removeemptysspaces
tools: Remove empty spaces from build kernel script
2022-11-09 17:02:29 +08:00
Ji-Xinyou
f8f97c1e22 feat(shim-mgmt): iptables handler
Support the handlers in runtime, which are used by kata-ctl iptables series of commands in runtime.

Fixes: #5370
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-11-09 10:39:50 +08:00
Chao Wu
29c75cf12b runtime-rs: delete all cargo patches
The cargo patch in the cargo.toml seems to cause the whole runtime-rs
building time longer and also makes it harder to build runtime-rs in an
environment without the network

We should delete all patches from the cargo.toml file and publish all
the crates that was once patched.

fixes: #5614 #5527 #5526 #5449

Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-11-09 10:02:58 +08:00
Gabriela Cervantes
9f70a6949b tools: Remove empty spaces from build kernel script
This PR removes some extra empty spaces at the build kernel script.

Fixes #5619

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-11-08 17:49:57 +00:00
Chao Wu
f5f25d9379
Merge pull request #5431 from wllenyj/dragonball-ut-3
Built-in Sandbox: add more unit tests for dragonball. Part 3
2022-11-08 15:48:16 +08:00
Zhongtao Hu
351bdbfacd
Merge pull request #5567 from openanolis/chao/fix_mem_file_path_error
Dragonball: enable mem_file_path config into hugetlbfs process
2022-11-08 09:00:13 +08:00
wllenyj
57336835da dragonball: add more unit test for device manager
Added more unit tests for device manager.

Fixes: #4899

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-11-08 00:45:17 +08:00
wllenyj
2333700237 dragonball: add test utils.
Added some tools for dragonball unit testing.

Signed-off-by: wllenyj <wllenyj@linux.alibaba.com>
2022-11-08 00:45:17 +08:00
Bin Liu
bfe9157abc
Merge pull request #5570 from openanolis/capability
runtime-rs:add hypervisor interface capabilities
2022-11-07 23:04:55 +08:00
Mathis Joffre
3e9c3f12ce docs: Fix configuration path
On install you generate a configuration-fc.toml
file when building the kata-runtime and
copy it to either /etc/kata-containers/configuration-fc.toml
or /usr/share/defaults/kata-containers/configuration-fc.toml.
To reflect that the path must be one of the above,
we can fix the path in doc.

Fixes: #5589

Signed-off-by: Mathis Joffre <mariusjoffre@gmail.com>
2022-11-07 10:19:47 +01:00
Chao Wu
2adb1c1823 Dragonball: enable mem_file_path config into hugetlbfs process
In the current Dragonball code, mem_file_path config is not used when
hugetlbfs is enabled.
In this commit we add mem_file_path into hugetlbfs enable process.

fixes: #5566
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2022-11-07 16:07:57 +08:00
Fabiano Fidêncio
7250be3601
Merge pull request #5584 from fengyehong/clh-thread
cloud-hypervisor: Fix GetThreadIDs function
2022-11-07 08:22:40 +01:00
Fabiano Fidêncio
3b1750e8e8
Merge pull request #5586 from fidencio/topic/paralelise-static-checks
github: Parallelise static checks
2022-11-07 07:54:48 +01:00
Bin Liu
824ea83c3c
Merge pull request #5573 from pmores/fill-in-virtiofsd-standalone-impl
runtime-rs: blanks filled & fixes made to virtiofsd launch
2022-11-07 14:19:45 +08:00
Bin Liu
83d052f82b
Merge pull request #4476 from LitFlwr0/vcpu-pinning-frq
vCPUs pinning support for Kata Containers
2022-11-07 10:37:22 +08:00
Guanglu Guo
daeee26a1e cloud-hypervisor: Fix GetThreadIDs function
Get vcpu thread-ids by reading cloud-hypervisor process tasks information.

Fixes: #5568

Signed-off-by: Guanglu Guo <guoguanglu@qiyi.com>
2022-11-05 17:23:19 +08:00
Bin Liu
427b01e298
Merge pull request #5548 from justxuewei/fix/share-fs-permission
runtime-rs: fix shared volume permission issue
2022-11-04 21:21:50 +08:00
Fabiano Fidêncio
40d514aa2c github: Parallelise static checks
Although introducing an awful amount of code duplication, let's
parallelise the static checks in order to reduce its time and the space
used in the VMs running those.

While I understand there may be ways to make the whole setup less
repetitive and error prone, I'm taking the approach of:
* Make it work
* Make it right
* Make it fast

So, it's clear that I'm only attempting to make it work, and I'd
appreciate community help in order to improve the situation here.  But,
for now, this is a stopgap solution.

JFYI, the time needed for run the tests on the `main` branch went down
from ~110 minutes to ~60 minutes.  Plus, we're not running those on a
single VM anymore, which decreases the change to hit the space limit.

Reference: https://github.com/kata-containers/kata-containers/actions/runs/3393468605/jobs/5640842041

Ideally, each one of the following tests should be also split into
smaller tests, each test for one component, for instance.
* static-checks
* compiler-checks
* unit-tests
* unit-tests-as-root

Fixes: #5585

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2022-11-04 13:41:16 +01:00
LitFlwr0
2508d39b7c runtime: added vcpus pinning logics
Core VCPU threads pinning logics for issue 4476. Also provided docs.

Fixes:#4476
Signed-off-by: LitFlwr0 <861690705@qq.com>
2022-11-04 17:52:42 +08:00
Zhongtao Hu
fef8e92af1 runtime-rs:add hypervisor interface capabilities
1. be able to check does hypervisor support use block device, block
device hotplug, multi-queue, and share file

2. be able to set the hypervisor capability of using block device, block
device hotplug, multi-queue, and share file

Fixes: #5569
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-11-04 09:24:36 +08:00
Bin Liu
b0c7bcce7c
Merge pull request #5556 from ManaSugi/runk/fix-kill-behavior
runk: Ignore an error when calling kill cmd with --all option
2022-11-04 08:42:27 +08:00
Bin Liu
02fa6b8dad
Merge pull request #5557 from ManaSugi/runk/update-cargolock-libseccomp
runk: Upgrade libseccomp crate to v0.3.0 in Cargo.lock
2022-11-04 08:41:45 +08:00
Fabiano Fidêncio
bb38901550
Merge pull request #5571 from jodh-intel/snap-unbreak-docker
snap: Unbreak docker install
2022-11-03 23:47:07 +01:00
Pavel Mores
27b1913584 runtime-rs: blanks filled & fixes made to virtiofsd launch
The 'config' argument to ShareVirtioFsStandalone::new() is now actually
used, taking care of an explicit TODO.

If a shared path doesn't exist in ShareVirtioFsStandalone::virtiofsd_args()
it is now created instead of returning an error, thus following
ShareVirtioFsInline's suit.

The '-o vhost_user_socket=...' command line argument doesn't seem to be
supported by newer versions of virtiofsd so we replace it with
'--socket-path' which should be functionally equivalent according to docs.

Fixes #5572

Signed-off-by: Pavel Mores <pmores@redhat.com>
2022-11-03 08:38:59 +01:00
James O. D. Hunt
990e6359b7 snap: Unbreak docker install
It appears that _either_ the GitHub workflow runners have changed their
environment, or the Ubuntu archive has changed package dependencies,
resulting in the following error when building the snap:

```
Installing build dependencies: bc bison build-essential cpio curl docker.io ...

    :

The following packages have unmet dependencies:
docker.io : Depends: containerd (>= 1.2.6-0ubuntu1~)
E: Unable to correct problems, you have held broken packages.
```

This PR uses the simplest solution: install the `containerd` and `runc`
packages. However, we might want to investigate alternative solutions in
the future given that the docker and containerd packages seem to have
gone wild in the Ubuntu GitHub workflow runner environment. If you
include the official docker repo (which the snap uses), a _subset_ of
the related packages is now:

- `containerd`
- `containerd.io`
- `docker-ce`
- `docker.io`
- `moby-containerd`
- `moby-engine`
- `moby-runc`
- `runc`

Fixes: #5545.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-11-02 10:09:03 +00:00
James O. D. Hunt
ca69a9ad6d snap: Use metadata for dependencies
Rather than hard-coding the package manager into the docker part,
use the `build-packages` section to specify the parts package
dependencies in a distro agnostic manner.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-11-02 09:50:29 +00:00
Manabu Sugimoto
df092185ee runk: Upgrade libseccomp crate to v0.3.0 in Cargo.lock
The libseccomp crate was upgraded to v0.3.0 by 4696ead,
but `Cargo.lock` of runk wasn't updated by mistake.
So, this commit updates `Cargo.lock` of runk to the latest dependencies.

Fixes: #5487

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-11-01 20:26:33 +09:00
Manabu Sugimoto
16dca4ecd4 runk: Ignore an error when calling kill cmd with --all option
Ignore an error handling that is triggered when the kill command is called
with `--all option` to the stopped container.

High-level container runtimes such as containerd call the kill command with
`--all` option in order to terminate all processes inside the container
even if the container already is stopped. Hence, a low-level runtime
should allow `kill --all` regardless of the container state like runc.

This commit reverts to the previous behavior.

Fixes: #5555

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-11-01 20:24:29 +09:00
Xuewei Niu
b74c18024a runtime-rs: fix shared volume permission issue
Fix the issue where share volumes always have readwrite permission even if
readonly permission is enough.

Fixes: #5549

Signed-off-by: Xuewei Niu <justxuewei@apache.org>
2022-11-01 18:42:19 +08:00
Chen TaoTao
936fe35acb runtime-rs : fix shim source is ambiguous
In the documentation test, the name shim has multiple potential
sources of import, now give it a clear source.

Fixes: #5535

Signed-off-by: Chen TaoTao <chentt10@chinatelecom.cn>
2022-10-31 19:54:22 -07:00
snir911
288e337a6f
Merge pull request #5434 from Rouzip/remove-doNetNS
add EnterNetNS in virtcontainers
2022-10-30 11:19:07 +02:00
GabyCT
e04ad49c1b
Merge pull request #5530 from GabyCT/topic/fixclhscript
tools: Fix indentation of build static clh script
2022-10-28 11:52:56 -05:00
Gabriela Cervantes
0ed7da30d7 tools: Fix indentation of build static clh script
This Pr removes single spaces and fix the indentation of the script.

Fixes #5528

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-10-27 21:09:34 +00:00
Bin Liu
0bb005093e
Merge pull request #5523 from BbolroC/s390x-virtiofsd
virtiofsd: Not use "link-self-contained=yes" on s390x
2022-10-27 20:42:57 +08:00
Hyounggyu Choi
43fcb8fd09 virtiofsd: Not use "link-self-contained=yes" on s390x
The compile option link-self-contained=yes asks rustc to use
C library startup object files that come with the compiler,
which are not available on the target s390x-unknown-linux-gnu.
A build does not contain any startup files leading to a
broken executable entry point (causing segmentation fault).

Fixes: #5522

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2022-10-26 23:43:22 +02:00
David Esparza
37f0cd1c8f
Merge pull request #5436 from amshinde/kata-ctl-drop-privs
Kata ctl drop privs
2022-10-26 11:37:27 -05:00