Commit Graph

288 Commits

Author SHA1 Message Date
gaohuatao
2edbe389d8 runtime-rs: moving only vCPU threads into sandbox controller
when overhead controller exists, just contrain vCPU threads
in sandbox controller

Fixes:#5760

Signed-off-by: gaohuatao <gaohuatao@bytedance.com>
2022-11-25 17:53:21 +08:00
Chen Taotao
67fe703ff5 runtime-rs: remove the version number from the commit display message
The displayed commit message and version message are partially duplicated.
Remove the version number from the commit display message.

Fixes:#5735

Signed-off-by: Chen Taotao <chentt10@chinatelecom.cn>
2022-11-25 13:00:01 +08:00
Zhongtao Hu
f02bb1a9cb Merge pull request #5729 from openanolis/netnsref
runtime-rs: block on the current thread when setup the network to avoid be take over by other task
2022-11-25 08:09:10 +08:00
Chao Wu
9bde32daa1 Merge pull request #5707 from openanolis/ref
Refactor(runtime-rs): add conditional compile for virt-sandbox persist
2022-11-24 15:24:06 +08:00
Zhongtao Hu
b987bbc576 runtime-rs: block on the current thread when setup the network
As the increase of the I/O intensive tasks, two issues could be caused:

 1. When the future is blocked, the current thread (which is in the network namespace)
    might be take over by other tasks. After the future is finished, the thread take over
    the current task might not be in the pod network namespace
 2. When finish setting up the network, the current thread will be set back to the host namsapce.
    But the task which be taken over would still stay in the pod network namespace

 To avoid that, we need to block the future on the current thread.

Fixes:#5728
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-11-24 13:48:05 +08:00
Yipeng Yin
d808adef95 runtime-rs: support vhost-vsock
Rename old VsockConfig to HybridVsockConfig. And add VsockConfig to
support vhost-vsock. We follow kata's old way to try random vhost fd
for 50 times to generate uniqe fd.

Fixes: #5654

Signed-off-by: Yipeng Yin <yinyipeng@bytedance.com>
2022-11-22 10:03:52 +08:00
Zhongtao Hu
6b2ef66f0f runtime-rs: add conditional compile for virt-sandbox persist
code refactoring, add conditional compile for virt-sandbox persist

Fixes: #5706
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-11-21 19:51:43 +08:00
Bin Liu
7506237420 Merge pull request #5144 from openanolis/nydus-dev
runtime-rs: support nydus v5 and v6 rootfs
2022-11-18 14:05:04 +08:00
Ji-Xinyou
c3f1922df6 fix(fmt): fix cargo fmt to pass static check
Fix cargo fmt

Fixes: #5639
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-11-16 12:44:38 +01: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
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
Zhongtao Hu
071ac4693a Merge pull request #5613 from openanolis/iptables
feat(shim-mgmt): iptables handler
2022-11-09 17:21:45 +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
Bin Liu
bfe9157abc Merge pull request #5570 from openanolis/capability
runtime-rs:add hypervisor interface capabilities
2022-11-07 23:04:55 +08: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
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
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
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
Bin Liu
cd27ad144e Merge pull request #5219 from openanolis/krt-modify
Modify agent-url return value in runtime-rs
2022-10-20 11:17:29 +08:00
Bin Liu
4d9dd8790d runtime-rs: fix typo get_contaier_type to get_container_type
Change get_contaier_type to get_container_type

Fixes: #5415

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-10-13 17:12:43 +08:00
Bin Liu
2de29b6f69 Merge pull request #5088 from liubin/fix/5087-force-shutdown-shim
runtime-rs: force shutdown shim process in it can't exit
2022-10-13 16:55:05 +08:00
Bin Liu
7aacba0abc Merge pull request #5282 from liubin/fix/4730-rs-emptydir
runtime-rs: support ephemeral storage for emptydir
2022-10-12 09:53:59 +08:00
Ji-Xinyou
9c1ac3d457 runtime-rs: return port on agent-url req
Add the server vport (1024) when requesting agent-url

Fixes: #5213
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-10-08 16:14:21 +08:00
Bin Liu
3aeaa6459d runtime-rs: delete duplicated PASSTHROUGH_FS_DIR const
The const PASSTHROUGH_FS_DIR defined twice, delte one.

Fixes: #5301

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-30 15:53:08 +08:00
Bin Liu
8d4ced3c86 runtime-rs: support ephemeral storage for emptydir
Add support for ephemeral storage and k8s emptydir.

Depends-on:github.com/kata-containers/tests#5161

Fixes: #4730

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-30 09:10:20 +08:00
Bin Liu
1352e31180 Merge pull request #5200 from openanolis/agent_rwlock
refactor(runtime-rs): Use RwLock in runtime-agent
2022-09-29 13:15:41 +08:00
Bin Liu
abbdf89a06 Merge pull request #5271 from liubin/fix/4729-add-close-io-for-kubectl-cp
runtime-rs: fix shim close_io call to support kubectl cp
2022-09-29 13:10:49 +08:00
Bin Liu
0e899669ee runtime-rs: fix shim close_io call to support kubectl cp
Add close_io to shim and call agent's close_stdin in close_io.

Depends-on:github.com/kata-containers/tests#5155

Fixes: #4729

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-29 09:35:17 +08:00
Zhongtao Hu
96cf21fad0 runtime-rs: add comments for runtime-rs shared directory
add comments for runtime-rs shared directory

Fixes:#5197
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-09-28 15:46:34 +08:00
Zhongtao Hu
ff053b0808 Merge pull request #5220 from liubin/fix/5184-rs-inotify
runtime-rs: support watchable mount
2022-09-28 11:19:53 +08:00
Zhongtao Hu
319caa8e74 Merge pull request #5097 from openanolis/dbg-console
runtime-rs: debug console support in runtime
2022-09-28 10:30:22 +08:00
Peng Tao
33b0720119 Merge pull request #5193 from openanolis/origin/kata-deploy
kata-deploy: ship the rustified runtime binary
2022-09-28 10:19:16 +08:00
Bin Liu
c64e56327f Merge pull request #5190 from liubin/fix/5189-unbind-as-a-const
runtime-rs: define VFIO unbind path as a const
2022-09-27 21:04:18 +08:00
Bin Liu
4a763925e5 runtime-rs: support watchable mount
Use watchable mount to support inotify for virtio-fs.

Fixes: #5184

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-27 19:08:25 +08:00
Bin Liu
c95cf6dce7 Merge pull request #5250 from liubin/fix/5249-set-timeout-to-zero-for-stream-rpc
runtime-rs: set agent timeout to 0 for stream RPCs
2022-09-27 17:39:35 +08:00
Bin Liu
20bcaf0e36 runtime-rs: set agent timeout to 0 for stream RPCs
For stream RPCs:
- write_stdin
- read_stdout
- read_stderr

there should be no timeout (by setting it to 0).

Fixes: #5249

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-09-27 11:47:37 +08:00
Bin Liu
407e46b1b7 Merge pull request #5218 from bergwolf/github/deps
runtime/runtime-rs: update dependency
2022-09-27 11:02:46 +08:00
Bin Liu
a2f207b923 Merge pull request #5163 from liubin/fix/5162-add-test-for-StaticResource
runtime-rs: add test for StaticResource
2022-09-26 17:44:20 +08:00
Zhongtao Hu
9d67f5a7e2 Merge pull request #5230 from openanolis/nohc
runtime-rs: remove hardcoded string
2022-09-26 16:01:41 +08:00
quanweiZhou
ad87c7ac56 Merge pull request #5206 from openanolis/hypervisor/readme
docs: add README for runtime-rs hypervisor crate
2022-09-26 16:01:12 +08:00
Bin Liu
5a98fb8d2b Merge pull request #5186 from liubin/fix/5185
runtime-rs: use Path.is_file to check regular files
2022-09-26 12:33:47 +08:00
Zhongtao Hu
4a36bb9e21 Merge pull request #4924 from openanolis/runtime-rs-netUT
runtime-rs: add unit tests for network resource
2022-09-23 17:45:24 +08:00
Zhongtao Hu
274de024c5 docs: add README for runtime-rs hypervisor crate
add README for runtime-rs hypervisor crate

Fixes:#4634
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-09-23 15:20:02 +08:00
Chao Wu
9cf5de0b4e Merge pull request #5171 from liubin/fix/5170-use-macro
runtime-rs/resource: use macro to reduce duplicated code
2022-09-23 10:59:53 +08:00
Zhongtao Hu
d663f110d7 kata-deploy: get the config path from cri options
get the config path for runtime-rs from cri options

Fixes: #5000
Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
2022-09-22 17:39:25 +08:00
Ji-Xinyou
46965739a4 runtime-rs: remove hardcoded string
Use KATA_PATH instead of "run/kata"

Fixes: #5229
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-09-22 16:06:51 +08:00