Rename shim-client to shim-protos

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko 2021-12-28 11:48:27 +02:00
parent 3ae0f183c3
commit 39065ec9ed
54 changed files with 27 additions and 25 deletions

View File

@ -2,7 +2,7 @@
members = [
"crates/client",
"crates/logging",
"crates/shim-client",
"crates/shim-protos",
"crates/shim",
"crates/snapshots"
]

View File

@ -10,7 +10,7 @@ This repository contains the following crates:
| Name | Description | Links |
| --- | --- | --- |
| [containerd-shim-client](crates/shim-client) | TTRPC bindings to shim interfaces | [![Crates.io](https://img.shields.io/crates/v/containerd-shim-client)](https://crates.io/crates/containerd-shim-client) [![docs.rs](https://img.shields.io/docsrs/containerd-shim-client)](https://docs.rs/containerd-shim-client/latest/containerd_shim_client/) |
| [containerd-shim-protos](crates/shim-protos) | TTRPC bindings to shim interfaces | [![Crates.io](https://img.shields.io/crates/v/containerd-shim-protos)](https://crates.io/crates/containerd-shim-protos) [![docs.rs](https://img.shields.io/docsrs/containerd-shim-protos)](https://docs.rs/containerd-shim-protos/latest/containerd_shim_protos/) |
| [containerd-shim-logging](crates/logging) | Shim logger plugins | [![Crates.io](https://img.shields.io/crates/v/containerd-shim-logging)](https://crates.io/crates/containerd-shim-logging) [![docs.rs](https://img.shields.io/docsrs/containerd-shim-logging)](https://docs.rs/containerd-shim-logging/latest/containerd_shim_logging/) |
| [containerd-shim](crates/shim) | Runtime v2 shim wrapper | [![Crates.io](https://img.shields.io/crates/v/containerd-shim)](https://crates.io/crates/containerd-shim) [![docs.rs](https://img.shields.io/docsrs/containerd-shim)](https://docs.rs/containerd-shim/latest/containerd_shim/) |
| [containerd-client](crates/client) | GRPC bindings to containerd APIs | [![Crates.io](https://img.shields.io/crates/v/containerd-client)](https://crates.io/crates/containerd-client) [![docs.rs](https://img.shields.io/docsrs/containerd-client)](https://docs.rs/containerd-client/latest/containerd_client/) |

View File

@ -1,5 +1,5 @@
[package]
name = "containerd-shim-client"
name = "containerd-shim-protos"
version = "0.1.1"
authors = ["Maksym Pavlenko <pavlenko.maksym@gmail.com>", "The containerd Authors"]
edition = "2018"

View File

@ -9,8 +9,8 @@ TTRPC bindings for containerd's shim events and interfaces.
## Design
The `containerd-shim-client` crate provides [Protobuf](https://github.com/protocolbuffers/protobuf.git) message
and [ttRPC](https://github.com/containerd/ttrpc.git) service definitions for the
The `containerd-shim-protos` crate provides [Protobuf](https://github.com/protocolbuffers/protobuf.git) message
and [TTRPC](https://github.com/containerd/ttrpc.git) service definitions for the
[Containerd shim v2](https://github.com/containerd/containerd/blob/main/runtime/v2/task/shim.proto) protocol.
The message and service definitions are auto-generated from protobuf source files under `vendor/`
@ -25,7 +25,7 @@ Add `containerd-shim-client` as a dependency in your `Cargo.toml`
```toml
[dependencies]
containerd-shim-client = "0.1"
containerd-shim-protos = "0.1"
```
Basic client code looks as follows:
@ -46,9 +46,9 @@ let resp = task_client.connect(context, &req)?;
## Example
- [ttRPC shim client](./examples/ttrpc-client.rs)
- [ttRPC shim server](./examples/ttrpc-server.rs)
- [ttRPC client connect](./examples/connect.rs).
- [TTRPC shim client](./examples/ttrpc-client.rs)
- [TTRPC shim server](./examples/ttrpc-server.rs)
- [TTRPC client connect](./examples/connect.rs).
The way to build the [ttRPC client connect](./examples/connect.rs) example:
```bash

View File

@ -16,7 +16,7 @@
use std::env;
use containerd_shim_client as client;
use containerd_shim_protos as client;
use client::api;
use ttrpc::context::Context;

View File

@ -13,8 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use containerd_shim_client::api::CreateTaskRequest;
use containerd_shim_client::TaskClient;
use containerd_shim_protos::{api::CreateTaskRequest, TaskClient};
use ttrpc::client::Client;
use ttrpc::context::{self, Context};

View File

@ -16,8 +16,10 @@
use std::sync::Arc;
use std::thread;
use containerd_shim_client::api::{CreateTaskRequest, CreateTaskResponse};
use containerd_shim_client::{create_task, Task};
use containerd_shim_protos::{
api::{CreateTaskRequest, CreateTaskResponse},
create_task, Task,
};
use ttrpc::server::*;
#[derive(Debug, PartialEq)]

View File

@ -14,7 +14,7 @@
limitations under the License.
*/
//! `containerd-shim-client` contains TTRPC bindings and client/server code to interact with
//! `containerd-shim-protos` contains TTRPC bindings and client/server code to interact with
//! containerd's runtime v2 shims.
//!
//! This crate relies on [ttrpc-rust](https://github.com/containerd/ttrpc-rust) crate to generate
@ -22,7 +22,7 @@
//!
//! Here is a quick example:
//! ```no_run
//! use containerd_shim_client as client;
//! use containerd_shim_protos as client;
//!
//! use client::api;
//! use client::ttrpc::context::Context;

View File

@ -1,4 +1,4 @@
// This file is generated by ttrpc-compiler 0.4.1. Do not edit
// This file is generated by ttrpc-compiler 0.5.0. Do not edit
// @generated
// https://github.com/Manishearth/rust-clippy/issues/702

View File

@ -1,4 +1,4 @@
// This file is generated by ttrpc-compiler 0.4.1. Do not edit
// This file is generated by ttrpc-compiler 0.5.0. Do not edit
// @generated
// https://github.com/Manishearth/rust-clippy/issues/702

View File

@ -7,9 +7,9 @@ use std::collections::HashMap;
use std::sync::mpsc::channel;
use std::sync::Arc;
use containerd_shim_client::api::{CreateTaskRequest, CreateTaskResponse, DeleteRequest};
use containerd_shim_client::shim::shim_ttrpc::create_task;
use containerd_shim_client::Task;
use containerd_shim_protos::api::{CreateTaskRequest, CreateTaskResponse, DeleteRequest};
use containerd_shim_protos::shim::shim_ttrpc::create_task;
use containerd_shim_protos::Task;
use protobuf::{CodedInputStream, CodedOutputStream, Message};
use ttrpc::common::{MESSAGE_TYPE_REQUEST, MESSAGE_TYPE_RESPONSE};
use ttrpc::{Code, MessageHeader, Request, Response, TtrpcContext};

View File

@ -17,7 +17,7 @@ libc = "0.2.95"
nix = "0.23.1"
command-fds = "0.2.1"
containerd-shim-client = { path = "../shim-client", version = "0.1.0" }
containerd-shim-protos = { path = "../shim-protos", version = "0.1.0" }
[dev-dependencies]
tempfile = "3.0"

View File

@ -17,7 +17,7 @@
use std::env;
use containerd_shim::{ttrpc::context::Context, RemotePublisher};
use containerd_shim_client::events::task::TaskOOM;
use containerd_shim_protos::events::task::TaskOOM;
fn main() {
let args: Vec<String> = env::args().collect();

View File

@ -30,7 +30,7 @@ use std::path::{Path, PathBuf};
use std::process::{self, Command, Stdio};
use std::sync::{Arc, Condvar, Mutex};
pub use containerd_shim_client as protos;
pub use containerd_shim_protos as protos;
use protos::protobuf::Message;
use protos::shim::{shim::DeleteResponse, shim_ttrpc::create_task};

View File

@ -18,7 +18,7 @@
use std::time::{SystemTime, UNIX_EPOCH};
use containerd_shim_client as client;
use containerd_shim_protos as client;
use client::protobuf;
use client::shim::{empty, events};