rust-extensions/crates/shim-protos
Tim Zhang 18609f2762 release containerd-shim-protos: v0.3.0
Bump containerd-shim-protos from 0.2.0 to 0.3.0 to
include changes made in #95.

Because the update in #95 is not compatible we need a major
version update.

Signed-off-by: Tim Zhang <tim@hyper.sh>
2023-04-14 15:43:13 +08:00
..
examples Run fmt 2022-09-29 11:55:31 -07:00
src Run fmt 2022-09-29 11:55:31 -07:00
tests Run fmt 2022-09-29 11:55:31 -07:00
vendor Runc shim implementation 2022-02-17 23:02:14 +08:00
Cargo.toml release containerd-shim-protos: v0.3.0 2023-04-14 15:43:13 +08:00
README.md docs: Update link for containerd shimv2 proto file 2023-03-08 15:15:19 +01:00
build.rs Run fmt 2022-09-29 11:55:31 -07:00

README.md

Shim protos and client for containerd

Crates.io docs.rs Crates.io CI

TTRPC bindings for containerd's shim events and interfaces.

Design

The containerd-shim-protos crate provides Protobuf message and TTRPC service definitions for the Containerd shim v2 protocol.

Usage

Add containerd-shim-client as a dependency in your Cargo.toml

[dependencies]
containerd-shim-protos = "0.1"

Basic client code looks as follows:

let client = client::Client::connect(socket_path)?;
let task_client = client::TaskClient::new(client);

let context = client::ttrpc::context::with_timeout(0);

let req = client::api::ConnectRequest {
    id: pid,
    ..Default::default()
};

let resp = task_client.connect(context, &req)?;

Example

The way to build the example:

# build sync connect, client and server
$ cargo build --example shim-proto-connect
$ sudo ./shim-proto-connect unix:///containerd-shim/shim_socket_path.sock
$ cargo build --example shim-proto-client
$ cargo build --example shim-proto-server

# build async connect, client and server
$ cargo build --example shim-proto-connect-async --features async
$ cargo build --example shim-proto-client-async --features async
$ cargo build --example shim-proto-server-async --features async