Skip to content

Commit 48b05c1

Browse files
authored
Merge branch 'containerd:master' into serve_connected
2 parents 3cc7506 + 0e86374 commit 48b05c1

File tree

19 files changed

+352
-69
lines changed

19 files changed

+352
-69
lines changed

Cargo.toml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,47 @@
1-
[package]
2-
name = "ttrpc"
3-
version = "0.8.4"
4-
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
1+
[workspace]
2+
members = [
3+
"./compiler",
4+
"./ttrpc-codegen",
5+
"./example",
6+
"./"
7+
]
8+
resolver = "2"
9+
10+
[workspace.package]
511
edition = "2018"
612
license = "Apache-2.0"
7-
keywords = ["ttrpc", "protobuf", "rpc"]
813
readme = "README.md"
914
repository = "https://github.com/containerd/ttrpc-rust"
1015
homepage = "https://github.com/containerd/ttrpc-rust"
16+
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
17+
18+
[workspace.dependencies]
19+
# The dependencies in this section can be used by the crates in this
20+
# workspace by specifying `workspace = true` instead of the crate
21+
# version. For example, for protobuf:
22+
# protobuf = { workspace = true }
23+
ttrpc = { version = "0.8.4", path = "./" }
24+
ttrpc-codegen = { version = "0.5.0", path = "./ttrpc-codegen" }
25+
ttrpc-compiler = { version = "0.7.0", path = "./compiler" }
26+
protobuf = "3.7.2"
27+
protobuf-codegen = "3.7.2"
28+
protobuf-support = "3.7.2"
29+
30+
[package]
31+
name = "ttrpc"
32+
version = "0.8.4"
33+
authors = { workspace = true }
34+
edition = { workspace = true }
35+
license = { workspace = true }
36+
repository = { workspace = true }
37+
homepage = { workspace = true }
38+
keywords = ["ttrpc", "protobuf", "rpc"]
39+
readme = "README.md"
1140
description = "A Rust version of ttrpc."
1241
rust-version = "1.70"
1342

1443
[dependencies]
15-
protobuf = { version = "3.7.2" }
44+
protobuf = { workspace = true }
1645
libc = { version = "0.2.59", features = [ "extra_traits" ] }
1746
nix = "0.26.2"
1847
log = "0.4"
@@ -31,9 +60,7 @@ windows-sys = {version = "0.48", features = [ "Win32_Foundation", "Win32_Storage
3160
tokio-vsock = { version = "0.7.0", optional = true }
3261

3362
[build-dependencies]
34-
# lock home to avoid conflict with latest version
35-
home = "=0.5.9"
36-
protobuf-codegen = "3.7.2"
63+
protobuf-codegen = { workspace = true }
3764

3865
[features]
3966
default = ["sync"]

RELEASE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Release Process
2+
3+
This document describes the steps to release a new version of the crate or wasi-demo-app images.
4+
5+
## Crate Release Process
6+
7+
### Release Steps
8+
9+
1. Bump package and dependency versions in:
10+
* `./compiler/Cargo.toml`: Bump the package version as needed.
11+
* `./ttrpc-codegen/Cargo.toml`: Bump the package version as needed.
12+
* `./Cargo.toml`: Bump package version as needed. Then bump the workspace dependencies version to match the respective crates versions.
13+
2. Commit the changes and get them merged in the repo.
14+
2. Dry run the `cargo publish` command as follow
15+
```bash
16+
cargo +nightly publish \
17+
-Z package-workspace \
18+
--dry-run \
19+
--locked \
20+
-p ttrpc \
21+
-p ttrpc-codegen \
22+
-p ttrpc-compiler
23+
```
24+
2. If the dry run succeeds, publish the crates that need publishing using `cargo publihs -p <crate>` in the following order
25+
1. `ttrpc-compiler`
26+
2. `ttrpc-codegen`
27+
3. `ttrpc`

compiler/Cargo.toml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
[package]
22
name = "ttrpc-compiler"
33
version = "0.7.0"
4-
edition = "2018"
5-
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
6-
license = "Apache-2.0"
4+
edition = { workspace = true }
5+
license = { workspace = true }
6+
authors = { workspace = true }
7+
readme = "README.md"
78
keywords = ["compiler", "ttrpc", "protobuf"]
89
description = "ttRPC compiler for ttrpc"
910
categories = ["network-programming"]
1011
repository = "https://github.com/containerd/ttrpc-rust/tree/master/compiler"
1112
homepage = "https://github.com/containerd/ttrpc-rust/tree/master/compiler"
12-
readme = "README.md"
1313

1414
[dependencies]
15-
# lock home to avoid conflict with latest version
16-
home = "=0.5.9"
17-
protobuf = "3.7.2"
18-
protobuf-codegen = "3.7.2"
15+
protobuf = { workspace = true }
16+
protobuf-codegen = { workspace = true }
1917
prost = "0.8"
2018
prost-build = "0.8"
2119
prost-types = "0.8"

example/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ readme = "README.md"
99
repository = "https://github.com/alipay/ttrpc-rust"
1010
homepage = "https://github.com/alipay/ttrpc-rust"
1111
description = "An example of ttrpc."
12+
publish = false
1213

1314
[dev-dependencies]
1415
protobuf = "3.7.2"
@@ -23,7 +24,7 @@ ctrlc = { version = "3.0", features = ["termination"] }
2324
tokio = { version = "1.0.1", features = ["signal", "time"] }
2425
async-trait = "0.1.42"
2526
rand = "0.8.5"
26-
27+
clap = { version = "4.5.40", features = ["derive"] }
2728

2829
[[example]]
2930
name = "client"

example/async-client.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ use ttrpc::r#async::Client;
1111

1212
#[tokio::main(flavor = "current_thread")]
1313
async fn main() {
14-
let c = Client::connect(utils::SOCK_ADDR).await.unwrap();
14+
let sock_addr = utils::get_sock_addr();
15+
let c = Client::connect(sock_addr).await.unwrap();
16+
1517
let hc = health_ttrpc::HealthClient::new(c.clone());
1618
let ac = agent_ttrpc::AgentServiceClient::new(c);
1719

example/async-server.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ async fn main() {
5858
let hservice = health_ttrpc::create_health(Arc::new(HealthService {}));
5959
let aservice = agent_ttrpc::create_agent_service(Arc::new(AgentService {}));
6060

61-
utils::remove_if_sock_exist(utils::SOCK_ADDR).unwrap();
61+
let sock_addr = utils::get_sock_addr();
62+
utils::remove_if_sock_exist(sock_addr).unwrap();
6263

6364
let mut server = Server::new()
64-
.bind(utils::SOCK_ADDR)
65+
.bind(sock_addr)
6566
.unwrap()
6667
.register_service(hservice)
6768
.register_service(aservice);

example/async-stream-client.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ use ttrpc::r#async::Client;
1313
async fn main() {
1414
simple_logging::log_to_stderr(log::LevelFilter::Info);
1515

16-
let c = Client::connect(utils::SOCK_ADDR).await.unwrap();
16+
let sock_addr = utils::get_sock_addr();
17+
let c = Client::connect(sock_addr).await.unwrap();
18+
1719
let sc = streaming_ttrpc::StreamingClient::new(c);
1820

1921
let _now = std::time::Instant::now();

example/async-stream-server.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,12 @@ impl streaming_ttrpc::Streaming for StreamingService {
171171
async fn main() {
172172
simple_logging::log_to_stderr(LevelFilter::Info);
173173
let service = streaming_ttrpc::create_streaming(Arc::new(StreamingService {}));
174-
utils::remove_if_sock_exist(utils::SOCK_ADDR).unwrap();
174+
175+
let sock_addr = utils::get_sock_addr();
176+
utils::remove_if_sock_exist(sock_addr).unwrap();
175177

176178
let mut server = Server::new()
177-
.bind(utils::SOCK_ADDR)
179+
.bind(sock_addr)
178180
.unwrap()
179181
.register_service(service);
180182

example/client.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ fn main() {
5050
fn connect_once() {
5151
simple_logging::log_to_stderr(LevelFilter::Trace);
5252

53-
let c = Client::connect(utils::SOCK_ADDR).unwrap();
53+
let sock_addr = utils::get_sock_addr();
54+
let c = Client::connect(sock_addr).unwrap();
55+
5456
let hc = health_ttrpc::HealthClient::new(c.clone());
5557
let ac = agent_ttrpc::AgentServiceClient::new(c);
5658

example/protocols/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
//
33
// SPDX-License-Identifier: Apache-2.0
44
//
5+
6+
#[rustfmt::skip]
57
pub mod asynchronous;
8+
9+
#[rustfmt::skip]
610
pub mod sync;

0 commit comments

Comments
 (0)