1
0
mirror of https://github.com/kata-containers/kata-containers.git synced 2025-05-10 09:27:03 +00:00
Commit Graph

71 Commits

Author SHA1 Message Date
dependabot[bot]
2992a279ab
build(deps): bump tokio from 1.38.0 to 1.44.2 in /src/tools/runk
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.38.0 to 1.44.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.38.0...tokio-1.44.2)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.44.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-29 12:14:41 +00:00
Ruoqing He
265a751837 build: Drop redundant ARCH override
There are many `override ARCH = powerpc64le` after where `utils.mk` is
included, which are redundant.

Drop those redundant `override`s.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-02-24 22:04:28 +08:00
stevenhorsman
099b241702 powerpc64: Add target_endian = "little"
Based on comments from @Amulyam24 we need to use
the `target_endian = "little"` as well as target_arch = "powerpc64"
to ensure we are working on powerpc64le.

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-02-05 14:45:01 +00:00
Markus Rudy
091a410b96 kata-sys-util: move json parsing to protocols crate
The parse_json_string function is specific to parsing capability strings
out of ttRPC proto definitions and does not benefit from being available
to other crates. Moving it into the protocols crate allows removing
kata-sys-util as a dependency, which in turn enables compiling the
library on darwin.

Fixes: 

Signed-off-by: Markus Rudy <mr@edgeless.systems>
2024-10-31 09:41:07 +01:00
Markus Rudy
8ab4bd2bfc kata-sys-util: remove obsolete cgroups dependency
The cgroups.rs source file was removed in
234d7bca04. With cgroups support handled
in runtime-rs, the cgroups dependency on kata-sys-util can be removed.

Signed-off-by: Markus Rudy <mr@edgeless.systems>
2024-10-31 09:41:07 +01:00
Alex Lyn
bf813f85f2 runk: Align oci spec with oci-spec-rs
Utilized oci-spec-rs to align OCI Spec structures
and data representations in runk with the OCI Spec.

Fixes 

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-07-25 17:47:01 +08:00
stevenhorsman
d2d35d2dcc runk: Update tokio dependencies
- Bump tokio to 1.38.0 to fix the security vulnerability
https://rustsec.org/advisories/RUSTSEC-2024-0019

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-06-17 13:03:01 +01:00
Zixuan Tan
f6710610d1 agent,runtime-rs,runk: fix fmt and clippy warnings
Fix rustfmt and clippy warnings detected by CI.

Fixes: 
Signed-off-by: Zixuan Tan <tanzixuan.me@gmail.com>
2024-01-31 21:07:48 +08:00
Amulyam24
4ecd82a5df runk: skip the test_init_container_create_launcher if not root on ppc64le
This is to skip the test_init_container_create_launcher if not root on ppc64le.

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2024-01-18 16:31:13 +01:00
Amulyam24
a4b5447924 tools: fix makefile spacing
This minor PR removes the extra space in the makefiles.

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2024-01-18 16:31:13 +01:00
Xuewei Niu
cec8044744 agent: Make devcg_info optional for LinuxContainer::new()
The runk is a standard OCI runtime that isnt' aware of concept of sandbox.
Therefore, the `devcg_info` argument of `LinuxContainer::new()` is
unneccessary to be provided.

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2023-11-08 09:39:07 +08:00
Beraldo Leal
c5d845b30a agent: updating Cargo.lock files
Probably previous changes missed updating Cargo.lock.

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2023-11-06 16:49:58 +00:00
HanZiyao
a3b003c345 agent: support bind mounts between containers
This feature supports creating bind mounts directly between containers through annotations.

Fixes: 

Signed-off-by: HanZiyao <h56983577@126.com>
2023-10-26 16:34:50 +08:00
Beraldo Leal
730ef51693 deps: updating dependencies
Updating dependencies after make check, make test.

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2023-09-19 16:54:35 -04:00
stevenhorsman
a75fd5eb81 runk: Fix rust unecessary mut error
- Fix `error: variable does not need to be mutable`
in rust 1.72

Fixes: 
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2023-09-12 11:31:49 +01:00
Manabu Sugimoto
25d151bd1b runk: Modify kill command's error message for containerd tests
The error message when the kill command is executed with the container's
state == Stopped should be "container not running" because the containerd
tests expect that OCI runtimes return the error message and compare it.
If the error message is different from the expected one, the tests fail.

Fixes: 

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2023-08-16 00:39:50 +09:00
Manabu Sugimoto
ff4cfcd8a2 runk: Add Docker guide to README
`runk` can launch containers using Docker, so add the guide
to it's README.

```sh
$ sudo dockerd --experimental --add-runtime="runk=/usr/local/bin/runk"
$ sudo docker run -it --rm --runtime runk busybox echo hello runk
hello runk
```

Fixes: 

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2023-07-25 20:10:49 +09:00
Yushuo
410bc18143 agent-ctl: fix the compile error
When the version of libc is upgraded to 0.2.145, older getrandom could not adapt
to new API, and this will make agent-ctl fail to compile.

We upgrade the version of `rand`, so the low version of getrandom will no longer
need.

Fixes: 

Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
2023-06-05 21:48:36 +08:00
Peng Tao
df615ff252 runk: update tokio dependency
Update to 1.28.1 to pick up latest fixes.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2023-05-18 08:24:41 +00:00
Amulya Meka
76f975e5e6
Merge pull request from Amulyam24/agent-build
runtime: remove overriding ARCH value by default for ppc64le
2023-05-12 12:34:50 +05:30
Amulyam24
defb643346 runtime: remove overriding ARCH value by default for ppc64le
Currently, ARCH value is being set to powerpc64le by default.
powerpc64le is only right in context of rust and any operation
which might use this variable for a different purpose would fail on ppc64le.

Fixes: 

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2023-04-27 16:17:48 +05:30
alex.lyn
17daeb9dd7 warning_fix: fix warnings when build with cargo-1.68.0
Fixes: 

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2023-04-27 10:29:50 +08:00
Eduardo Lima (Etrunko)
a8b55bf874 dependency: update cgroups-rs
Huge pages failure with cgroups v2.
https://github.com/kata-containers/cgroups-rs/issues/112

Fixes: 

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2023-03-15 12:21:12 -03:00
Jianyong Wu
5d37d31ac7 cgroups: upgrade cgroupfs to 0.3.1
Trait method cause for std::error::Error is deprecated thus need replace
it with source method for cgroups-fs::error::ErrorKind.

Fixes: 
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2023-02-07 18:09:31 +08:00
Bin Liu
42efe013c1
Merge pull request from utam0k/libcli-0.4.0
runk: Upgrade liboci-cli to v0.0.4
2023-01-17 09:48:09 +08:00
utam0k
095e8fdef4
runk: Use the original Kill command instead of the customed it.
We can remove the custom kill command.

Fixes: 

Signed-off-by: utam0k <k0ma@utam0k.jp>
2023-01-16 21:35:47 +09:00
utam0k
0f9e23a3d9
runk: Upgrade liboci-cli to v0.0.4
https://github.com/containers/youki/releases/tag/v0.0.4

Fixes: 

Signed-off-by: utam0k <k0ma@utam0k.jp>
2023-01-16 21:35:09 +09:00
Bin Liu
1592a385eb dependency: update cgroups-rs
Update cgroups-rs.

Fixes: 

Signed-off-by: Bin Liu <bin@hyper.sh>
2023-01-13 14:00:51 +08:00
Zhongtao Hu
ec18368aba
Merge pull request from openanolis/refactor-guest-hook
agent: refactor guest hooks
2023-01-06 22:28:09 +08:00
Fabiano Fidêncio
079462d2eb runk: Fix needless_borrow warning
As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to needless_borrow.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-01-02 17:14:13 +01:00
Yushuo
85f9094f17 agent: refactor guest hooks
We have to execute some hooks both in host and guest. And in
/libs/kata-sys-util/src/hooks.rs, the coomon operations are implemented.

In this commit, we are going to refactor the code of guest hooks using
code in /libs/kata-sys-util/src/hooks.rs. At the same time, we move
function valid_env to kata-sys-util to make it usable by both agent and
runtime.

Fixes: 

Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
2022-12-26 10:15:19 +08:00
Yuan-Zhuo
7fdbbcda82 agent: Drop the Option for LinuxContainer.cgroup_manager
Cgroup manager for a container will always be created.
Thus, dropping the option for LinuxContainer.cgroup_manager
is feasible and could simplify the code.

Fixes: 

Signed-off-by: Yuan-Zhuo <yuanzhuo0118@outlook.com>
2022-12-07 13:40:38 +08:00
Fabiano Fidêncio
212325a9db
Merge pull request 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
GabyCT
013752667b
Merge pull request from liubin/tmp/debug-static-check
ci: let static checks don't depend on build
2022-11-28 07:51:42 -06:00
Bin Liu
6af037d379
Merge pull request 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: 

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-11-28 19:11:21 +09: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: 

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-11-28 15:26:04 +08:00
Bin Liu
b0c7bcce7c
Merge pull request 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
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: 

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: 

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-11-01 20:24:29 +09:00
Yuan-Zhuo
d7bb4b5512 agent: support systemd cgroup for kata agent
1. Implemented a rust module for operating cgroups through systemd with the help of zbus (src/agent/rustjail/src/cgroups/systemd).
2. Add support for optional cgroup configuration through fs and systemd at agent (src/agent/rustjail/src/container.rs).
3. Described the usage and supported properties of the agent systemd cgroup (docs/design/agent-systemd-cgroup.md).

Fixes: 

Signed-off-by: Yuan-Zhuo <yuanzhuo0118@outlook.com>
2022-10-25 13:57:09 +08:00
Gabriela Cervantes
9bd941098e docs: Update urls in runk documentation
This PR updates the urls that we have in the runk documentation.

Fixes 

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2022-09-27 15:45:43 +00:00
Manabu Sugimoto
bcf6bf843c runk: Enable seccomp support by default
Enable seccomp support in `runk` by default.
Due to this, `runk` is built with `gnu libc` by default
because the building `runk` with statically linked the `libseccomp`
and `musl` requires additional configurations.
Also, general container runtimes are built with `gnu libc` as
dynamically linked binaries by default.
The user can disable seccomp by `make SECCOMP=no`.

Fixes: 

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-09-09 10:55:16 +09:00
Manabu Sugimoto
968c2f6e8e runk: Refactor container builder
Refactor the container builder code (`InitContainer` and `ActivatedContainer`)
to make it easier to understand and to maintain.

The details:

1. Separate the existing `builder.rs` into an `init_builder.rs` and
`activated_builder.rs` to make them easy to read and maintain.

2. Move the `create_linux_container` function from the `builder.rs` to
`container.rs` because it is shared by the both files.

3. Some validation functions such as `validate_spec` from `builder.rs`
to `utils.rs` because they will be also used by other components as
utilities in the future.

Fixes: 

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-09-05 14:36:30 +09:00
Archana Shinde
c174eb809e
Merge pull request from ManaSugi/runk/add-init-msg
runk: Add cli message for init command
2022-08-27 00:15:25 +05:30
Bin Liu
875d946fb4
Merge pull request from ManaSugi/runk/refactor-delete-func
runk: Move delete logic to libcontainer
2022-08-25 14:30:30 +08:00
Manabu Sugimoto
b535bac9c3 runk: Add cli message for init command
Add cli message for init command to tell the user
not to run this command directly.

Fixes: 

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-08-25 00:32:35 +09:00
Manabu Sugimoto
bdf8a57bdb runk: Move delete logic to libcontainer
Move delete logic to `libcontainer` crate to make the code clean
like other commands.

Fixes: 

Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
2022-08-24 19:12:36 +09:00
Peng Tao
69080d76da agent/runk: update regex dependency
To bring in fix to CVE-2022-24713.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2022-08-24 17:02:15 +08:00
Chen Yiyang
a6fbaac1bd
runk: add pause/resume commands
To make cgroup v1 and v2 works well, I use `cgroups::cgroup` in
`Container` to manager cgroup now. `CgroupManager` in rustjail has some
drawbacks. Frist, methods in Manager traits are not visiable. So we need
to modify rustjail and make them public. Second, CgrupManager.cgroup is
private too, and it can't be serialized. We can't load/save it in
status file. One solution is adding getter/setter in rustjail, then
create `cgroup` and set it when loading status. In order to keep the
modifications to a minimum in rustjail, I use `cgroups::cgroup`
directly. Now it can work on cgroup v1 or v2, since cgroup-rs do this
stuff.

Fixes:  

Signed-off-by: Chen Yiyang <cyyzero@qq.com>
2022-08-22 23:11:50 +08:00