Files
kata-containers/src/agent
Penny Zheng 44b2caa2e5 AArch64: missing symbols on target aarch64-unknown-linux-musl
The __addtf3, __subtf3 and __multf3 symbols are used by aarch64-musl,
but are not provided by rust compiler-builtins.
For now, the only temporary but functional workaround accepted by rust
communities is to get them from libgcc.

Fixes: #107

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2020-01-09 11:06:04 +08:00
..
2019-11-22 18:08:56 +08:00
2020-01-09 09:59:20 +08:00
2019-11-01 17:17:38 +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