Commit Graph

9695 Commits

Author SHA1 Message Date
Ji-Xinyou
fbf294da3f refactor(shim-mgmt): move client side to libs
The client side is moved to libs. This is to solve the problem
that including clients will bring about messy dependencies.

Fixes: #5874
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
2022-12-14 17:42:25 +08:00
Greg Kurz
5ef7ed72ae
Merge pull request #5610 from UiPath/fix-process-wait
runtime: prevent waiting 50 ms minimum for a process exit
2022-12-08 11:02:39 +01:00
Peng Tao
0a1d1ec2fa
Merge pull request #5830 from openanolis/fix-high-cpu
runtime-rs: fix high cpu
2022-12-08 12:16:06 +08:00
Steve Horsman
39394fa2a8
Merge pull request #5844 from jtumber-ibm/patch-1
agent: remove `sysinfo` dependency
2022-12-07 16:35:05 +00:00
Fupan Li
cce316b5e9
Merge pull request #5607 from justxuewei/feat/sandbox-level-volume
runtime-rs: bind mount volumes in sandbox level
2022-12-07 19:23:38 +08:00
Chelsea Mafrica
1ff4185111
Merge pull request #5842 from cyyzero/update_install_guide
docs: Update the rust version in the installation documentation
2022-12-06 23:40:35 -08:00
Alexandru Matei
d04d45ea05 runtime: use pidfd to wait for processes on Linux
Use pidfd_open and poll on newer versions of Linux to wait
for the process to exit. For older versions use existing wait logic

Fixes: #5617

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2022-12-06 16:31:05 +02:00
Alexandru Matei
e9ba0c11d0 runtime: use exponential backoff for process wait
Initial wait period between checks is 1ms, and the
next ones are min(wait_period*5, 50ms)

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2022-12-06 16:30:58 +02:00
James Tumber
748f22e7d0 agent: remove sysinfo dependency
Removes the redundant dependency `sysinfo`.

Fixes: #5843

Signed-off-by: James Tumber <james.tumber@ibm.com>
2022-12-06 10:18:53 +00:00
Quanwei Zhou
0019d653d6 runtime-rs: fix high cpu
Fixed the issue when using nonblocking, the `tokio::io::copy()` needing
to handle EAGAIN, resulting in high CPU usage.

Fixes: #5740
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-12-06 14:25:33 +08:00
Chao Wu
326d589ff5
Merge pull request #5822 from liubin/fix/5820-var-name-and-typo
runtime-rs: fix some variable names and typos
2022-12-06 14:24:11 +08:00
Zhongtao Hu
c12bb5008d
Merge pull request #5769 from jongwu/check_host_arm
kata-ctl: add host check for aarch64
2022-12-06 14:05:52 +08:00
Chen Yiyang
46b38458af
docs: Update the rust version in the installation documentation
Rust version in the installation documentation does not match the
requirements. Just fix it.

Fixes: #5841

Signed-off-by: Chen Yiyang <cyyzero@qq.com>
2022-12-06 12:50:32 +08:00
Chao Wu
538bddf4ee
Merge pull request #5811 from tzY15368/fix-katactl-conflict-dependency
kata-ctl: fix dependency version conflict
2022-12-06 10:44:48 +08:00
Alexandru Matei
71491a69c3 runtime: move process wait logic to another function
extract process wait logic to another function

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2022-12-05 13:32:04 +02:00
Alexandru Matei
92ebe61fea runtime: reap force killed processes
reap child processes after sending SIGKILL

Fixes #5739

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2022-12-05 13:31:58 +02:00
Xuewei Niu
fdf0a7bb14 runtime-rs: fix the issues mentioned in the code review
Removed the `Debug` trait for the `ShareFs` and etc. Renamed
`ShareFsMount::upgrade()` and `ShareFsMount::downgrade()` to
`upgrade_to_rw()` and `downgrade_to_ro()`. Protected `mounted_info_set`
with a mutex to avoid race conditions.

Fixes: #5588

Signed-off-by: Xuewei Niu <justxuewei@apache.org>
2022-12-05 11:18:26 +08:00
Xuewei Niu
1d823c4f65 runtime-rs: umount and permission controls in sandbox level
This commit implemented umonut controls and permission controls. When a volume
is no longer referenced, it will be umounted immediately. When a volume mounted
with readonly permission and a new coming container needs readwrite permission,
the volume should be upgraded to readwrite permission. On the contrary, if a
volume with readwrite permission and no container needs readwrite, then the
volume should be downgraded.

Fixes: #5588

Signed-off-by: Xuewei Niu <justxuewei@apache.org>
2022-12-05 10:58:13 +08:00
Xuewei Niu
527b871414 runtime-rs: bind mount volumes in sandbox level
Implemented bind mount related managment on the sandbox side, involving bind
mount a volume if it's not mounted before, upgrade permission to readwrite if
there is a new container needs.

Fixes: #5588

Signed-off-by: Xuewei Niu <justxuewei@apache.org>
2022-12-05 10:58:13 +08:00
Bin Liu
9ccf2ebe8a agent: add signal value to log
For signal_process call, log the signal value in logs.

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-12-02 14:53:58 +08:00
Bin Liu
fb2c142f18 runtime-rs: fix some variable names and typos
Fix some not perfect variable names, and some typos in logs.

Fixes: #5820

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-12-02 14:52:34 +08:00
Bin Liu
8246de821f
Merge pull request #5809 from liubin/fix/cargo-deny-workflow-error
workflow: fix cargo-deny-runner.yaml syntax error
2022-12-02 12:19:44 +08:00
Bin Liu
514b7778a2
Merge pull request #5807 from liubin/fix/5806-add-shim-lanuage
runtime: Add identification in version for runtime-rs
2022-12-02 11:36:55 +08:00
Bin Liu
c1f5a93b66
Merge pull request #5814 from liubin/fix/5813-test-dragonball-error
workflow: call cargo in user's $PATH
2022-12-02 11:36:19 +08:00
Tingzhou Yuan
737420469a kata-ctl: fix dependency version conflict
Also added crate `runtime-rs/crates/runtimes` as dependency as it's
immediately depended upon by the `direct-volume` feature, see issue
5341 and PR 5467.

Fixes #5810

Signed-off-by: Tingzhou Yuan <tzyuan15@bu.edu>
2022-12-01 17:53:21 +00:00
Bin Liu
89574f03f8 workflow: call cargo in user's $PATH
Call cargo in root's HOME may lead to permission error, should
call cargo installed in user's HOME/PATH.

Fixes: #5813

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-12-01 15:37:16 +08:00
Bin Liu
d4321ab489 runtime: Add identification in version for runtime-rs
Now we are supporting two runtime/shim, the go version,
and the rust version, for debug purposes, we can
add an identification in the version info
to tell us which runtime/shim is used.

Fixes: #5806

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-12-01 15:14:08 +08:00
Bin Liu
7fabfb2cf0
Merge pull request #5756 from chentt10/remove-version-number-from-commit-message
runtime-rs: remove the version number from the commit display message
2022-12-01 13:11:47 +08:00
Bin Liu
f7fc436bed workflow: fix cargo-deny-runner.yaml syntax error
There is a syntax error in .github/workflows/cargo-deny-runner.yaml

Fixes: #5808

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-12-01 12:32:00 +08:00
Fabiano Fidêncio
212325a9db
Merge pull request #5649 from ManaSugi/runk/refactor-start-using-agent-code
runk: Re-implement start operation using the agent codes
2022-11-29 20:45:16 +01:00
Fabiano Fidêncio
ac1b2d2a18
Merge pull request #5774 from UiPath/fix-go-panic
build: update golang version to 1.19.3
2022-11-29 13:17:53 +01:00
Fabiano Fidêncio
d8d9aae123
Merge pull request #5781 from jodh-intel/snap-fix-release
snap: Fix snapcraft setup (unbreak snap releases)
2022-11-29 13:11:34 +01:00
Bin Liu
588f81a23c
Merge pull request #5612 from openanolis/fix-iptables
fix(agent): fix iptables binary path in guest
2022-11-29 16:57:06 +08:00
Bin Liu
1da2d0603c
Merge pull request #5761 from gaohuatao-1/ght_overhead
runtime-rs: moving only vCPU threads into sandbox controller
2022-11-29 13:53:01 +08:00
GabyCT
681d946644
Merge pull request #5748 from GabyCT/topic/removeextratabspacesdocker
tools: Remove extra tab spaces from kata deploy binaries script
2022-11-28 15:34:12 -06:00
James O. D. Hunt
86cb058833 snap: Fix snapcraft setup (unbreak snap releases)
Setup the snapcraft environment manually as the action we had been using
for this does not appear to be actively maintained currently.

Related to this, switch to specifying the snapcraft store credentials
using the `SNAPCRAFT_STORE_CREDENTIALS` secret. This unbreaks
`snapcraft upload`, which Canonical appear to have broken by removing
the previous facility.

Fixes: #5772.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2022-11-28 15:51:47 +00:00
Alexandru Matei
f443b78537 build: update golang version to 1.19.3
This Go release fixes golang/go#56309

Fixes #5773
Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2022-11-28 17:03:29 +02:00
GabyCT
013752667b
Merge pull request #5776 from liubin/tmp/debug-static-check
ci: let static checks don't depend on build
2022-11-28 07:51:42 -06:00
Fabiano Fidêncio
527e6c99e9
Merge pull request #5766 from liubin/fix/5763-use-composite-action-refactor-static-checks
actions: use matrix to refactor static checks
2022-11-28 14:12:27 +01:00
Bin Liu
6af037d379
Merge pull request #5154 from Yuan-Zhuo/main
agent: support systemd cgroup for kata agent.
2022-11-28 18:40:10 +08:00
Manabu Sugimoto
e12db92e4d runk: Re-implement start operation using the agent codes
This commit re-implements `start` operation by leveraging the agent codes.
Currently, `runk` has own `start` mechanism even if the agent already
has the feature to handle starting a container. This worsen the maintainability
and `runk` cannot keep up with the changes on the agent side easily.
Hence, `runk` replaces own implementations with agent's ones.

Fixes: #5648

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-11-28 19:11:21 +09:00
Fabiano Fidêncio
74531114c3
Merge pull request #5762 from liubin/fix/5759-skip-action-by-path
actions: skip some jobs using "paths-ignore" filter
2022-11-28 11:04:34 +01:00
Bin Liu
e723bad0af ci: let static checks don't depend on build
Build is a time consumable operation, skip build while let
ci run faster.

Fixes: #5777

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-11-28 15:26:04 +08:00
Bin Liu
a55eb78c32
Merge pull request #5752 from liubin/fix/5750-go-fix-1.19
runtime: go fix code for 1.19
2022-11-26 02:09:02 +08:00
Bin Liu
57c80ad65c
Merge pull request #5758 from chentt10/update-runtime-rs-build-and-install
doc: update runtime-rs "Build and Install"
2022-11-26 02:08:48 +08:00
Bin Liu
69aae02276 actions: use matrix to refactor static checks
Using matrix to reduce the duplication that of similar code.

Fixes: #5763

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-11-26 00:32:15 +08:00
Jianyong Wu
a5e4cad4b6 kata-ctl: add host check for aarch64
For now, we can check if host support running kata by check if "/dev/kvm"
exist on aarch64.

Fixes: #5768
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2022-11-25 18:55:32 +08:00
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
Peng Tao
e32c023d96
Merge pull request #5714 from UiPath/fix-mkdir
runtime: don't fail mkdir if the folder is already created by another process
2022-11-25 17:52:56 +08:00
Bin Liu
ae1001a9d1
Merge pull request #5742 from openanolis/chao/SGX_whitelist
kernel: add CONFIG_X86_SGX into whitelist
2022-11-25 17:36:26 +08:00