1
0
mirror of https://github.com/kata-containers/kata-containers.git synced 2025-05-06 23:47:31 +00:00
kata-containers/src/agent
Peng Tao 1f21947dd1 agent: fix protobuf depenedency
So that we don't use the latest one that requires unstable rust
features.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2020-07-02 10:40:13 +08:00
..
.cargo linker: no such file linking error on AArch64 2020-01-09 11:08:23 +08:00
logging agent: separate logging into a single crate 2020-02-03 20:40:26 +08:00
netlink agent: fix protobuf depenedency 2020-07-02 10:40:13 +08:00
oci oci: add Default and Clone to oci spec objects 2020-03-20 17:03:54 +08:00
protocols agent: fix protobuf depenedency 2020-07-02 10:40:13 +08:00
rustjail agent: fix protobuf depenedency 2020-07-02 10:40:13 +08:00
src grpc: fix the issue of potential crashes 2020-04-02 18:58:24 +08:00
Cargo.toml agent: fix protobuf depenedency 2020-07-02 10:40:13 +08:00
kata-agent.service.in systemd-service: build rust-agent systemd services 2020-03-03 09:24:02 +08:00
kata-containers.target systemd-service: build rust-agent systemd services 2020-03-03 09:24:02 +08:00
LICENSE rust-agent: Land rust agent into kata-containers 2019-10-31 10:46:45 +08:00
Makefile ci: install rust back to 1.42.0 to avoid ci failure. 2020-05-19 10:14:23 +08:00
README.md agent: Remove get_key_value to enable building in stable rust. 2019-10-31 12:25:34 -06:00
VERSION rust-agent: Land rust agent into kata-containers 2019-10-31 10:46:45 +08:00

Kata Agent in Rust

This is a rust version of the kata-agent.

In Denver PTG, we discussed about re-writing agent in rust:

In general, we all think about re-write agent in rust to reduce the footprint of agent. Moreover, Eric mentioned the possibility to stop using gRPC, which may have some impact on footprint. We may begin to do some PoC to show how much we could save by re-writing agent in rust.

After that, we drafted the initial code here, and any contributions are welcome.

Features

Feature Status
OCI Behaviors
create/start containers
signal/wait process
exec/list process
I/O stream
Cgroups
Capabilities, rlimit, readonly path, masked path, users
container stats (stats_container)
Hooks
Agent Features & APIs
run agent as init (mount fs, udev, setup lo)
block device as root device
Health API
network, interface/routes (update_container)
File transfer API (copy_file)
Device APIs (reseed_random_device, , online_cpu_memory, mem_hotplug_probe, set_guet_data_time)
vsock support
virtio-serial support ✖️
OCI Spec validator
Infrastructures
Debug Console
Command line
Tracing ✖️

Getting Started

Dependencies

The rust-agent depends on grpc-rs by PingCAP. However, the upstream grpc-rs and gRPC need some changes to be used here, which may take some time to be landed. Therefore, we created a temporary fork or grpc-rs here:

Build from Source

The rust-agent need to be built with rust nightly, and static linked with musl.

rustup target add x86_64-unknown-linux-musl
git submodule update --init --recursive  
sudo ln -s /usr/bin/g++ /bin/musl-g++  
cargo build --target x86_64-unknown-linux-musl --release

Run Kata CI with rust-agent

$sudo -E PATH=$PATH -E GOPATH=$GOPATH integration/containerd/shimv2/shimv2-tests.sh

Mini Benchmark

The memory of 'RssAnon' consumed by the go-agent and rust-agent as below: go-agent: about 11M rust-agent: about 1.1M