Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Standardize Cargo.toml files, enable more workspace dependencies #200

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[workspace]
members = [
"crates/client",
"crates/logging",
"crates/shim-protos",
"crates/shim",
"crates/snapshots",
"crates/runc",
"crates/runc-shim",
"crates/client",
"crates/logging",
"crates/runc",
"crates/runc-shim",
"crates/shim",
"crates/shim-protos",
"crates/snapshots",
]

[profile.release]
Expand All @@ -24,14 +24,21 @@ edition = "2021"

# Common dependencies for all crates
[workspace.dependencies]
async-trait = "0.1.52"
futures = "0.3.19"
libc = "0.2.112"
log = "0.4"
nix = "0.26"
oci-spec = "0.6"
os_pipe = "1.1"
prost = "0.12"
prost-types = "0.12"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0"
time = { version = "0.3.7", features = ["serde", "std"] }
tokio = "1.26"
tower = "0.4"

tonic = "0.10"
tonic-build = "0.10"

prost = "0.12"
prost-types = "0.12"

async-trait = "0.1.52"
futures = "0.3.19"
tower = "0.4"
uuid = { version = "1.0", features = ["v4"] }
14 changes: 11 additions & 3 deletions crates/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "containerd-client"
version = "0.4.0"
authors = [
"Maksym Pavlenko <[email protected]>",
"The containerd Authors",
"Maksym Pavlenko <[email protected]>",
"The containerd Authors",
]
description = "GRPC bindings to containerd APIs"
keywords = ["containerd", "client", "grpc", "containers"]
Expand All @@ -14,11 +14,19 @@ license.workspace = true
repository.workspace = true
homepage.workspace = true

[[example]]
name = "container"
path = "examples/container.rs"

[[example]]
name = "version"
path = "examples/version.rs"

[dependencies]
tonic.workspace = true
prost.workspace = true
prost-types.workspace = true
tokio = { workspace = true, optional = true }
tonic.workspace = true
tower = { workspace = true, optional = true }

[build-dependencies]
Expand Down
6 changes: 5 additions & 1 deletion crates/logging/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[package]
name = "containerd-shim-logging"
version = "0.1.1"
authors = ["Maksym Pavlenko <[email protected]>", "The containerd Authors"]
authors = [
"Maksym Pavlenko <[email protected]>",
"The containerd Authors"
]
description = "Logger extension for containerd v2 runtime"
keywords = ["containerd", "shim", "containers"]
categories = ["api-bindings", "asynchronous"]

edition.workspace = true
license.workspace = true
Expand Down
28 changes: 14 additions & 14 deletions crates/runc-shim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ authors = [
"Tianyang Zhang <[email protected]>",
"The containerd Authors",
]
keywords = ["containerd", "shim", "containers"]
description = "Rust implementation of containerd's runc v2 shim runtime"
keywords = ["containerd", "shim", "containers"]
categories = ["api-bindings", "asynchronous"]

edition.workspace = true
license.workspace = true
Expand All @@ -24,20 +25,19 @@ path = "src/main.rs"
doc = false

[dependencies]
log = "0.4"
nix = "0.26"
libc = "0.2.95"
time = { version = "0.3.7", features = ["serde", "std"] }
serde = { version = "1.0.133", features = ["derive"] }
serde_json = "1.0.74"
oci-spec = "0.6.0"
containerd-shim = { path = "../shim", version = "0.5.0", features = ["async"] }
crossbeam = "0.8.1"
uuid = { version = "1.0.0", features = ["v4"] }
libc.workspace = true
log.workspace = true
nix.workspace = true
oci-spec.workspace = true
runc = { path = "../runc", version = "0.2.0", features = ["async"] }
serde.workspace = true
serde_json.workspace = true
time.workspace = true
uuid.workspace = true

# Async dependencies
async-trait = { workspace = true }
async-trait.workspace = true
futures.workspace = true
tokio = { workspace = true, features = ["full"] }
futures = { workspace = true }

containerd-shim = { path = "../shim", version = "0.5.0", features = ["async"] }
runc = { path = "../runc", version = "0.2.0", features = ["async"] }
31 changes: 17 additions & 14 deletions crates/runc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[package]
name = "runc"
version = "0.2.0"
authors = ["Yuna Tomida <[email protected]>", "The containerd Authors"]
keywords = ["containerd", "containers", "runc"]
authors = [
"Yuna Tomida <[email protected]>",
"The containerd Authors",
]
description = "A crate for consuming the runc binary in your Rust applications"
keywords = ["containerd", "containers", "runc"]
categories = ["api-bindings", "asynchronous"]

edition.workspace = true
license.workspace = true
Expand All @@ -13,24 +17,23 @@ homepage.workspace = true
[features]
async = ["tokio", "async-trait", "futures", "tokio-pipe"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
libc = "0.2.112"
log = "0.4.14"
nix = "0.26"
oci-spec = "0.6.0"
libc.workspace = true
log.workspace = true
nix.workspace = true
oci-spec.workspace = true
os_pipe.workspace = true
path-absolutize = "3.0.11"
rand = "0.8.4"
serde = { version = "1.0.133", features = ["derive"] }
serde_json = "1.0.74"
serde.workspace = true
serde_json.workspace = true
tempfile = "3.6.0"
thiserror = "1.0.30"
time = { version = "0.3.7", features = ["serde", "std"] }
uuid = { version = "1.0.0", features = ["v4"] }
os_pipe = "1.0.0"
thiserror.workspace = true
time.workspace = true
uuid.workspace = true

# Async dependencies
tokio = { workspace = true, features = ["full"], optional = true }
async-trait = { workspace = true, optional = true }
futures = { workspace = true, optional = true }
tokio = { workspace = true, features = ["full"], optional = true }
tokio-pipe = { version="0.2.10", optional = true }
45 changes: 21 additions & 24 deletions crates/shim-protos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,18 @@
name = "containerd-shim-protos"
version = "0.5.0"
authors = [
"Maksym Pavlenko <[email protected]>",
"The containerd Authors",
"Maksym Pavlenko <[email protected]>",
"The containerd Authors",
]
description = "TTRPC bindings for containerd shim interfaces"
keywords = ["containerd", "shim", "containers", "ttrpc", "client"]
categories = ["api-bindings"]
categories = ["api-bindings", "asynchronous"]

edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true

[dependencies]
protobuf = "3.1"

# Quickfix to make CI green.
# 0.8.1 introduces a breaking change in the API.
# https://github.com/containerd/ttrpc-rust/pull/197
# https://github.com/containerd/ttrpc-rust/pull/209
ttrpc = "=0.8.0"
async-trait = { version = "0.1.48", optional = true }

[build-dependencies]
ttrpc-codegen = "0.4"

[dev-dependencies]
ctrlc = { version = "3.0", features = ["termination"] }
log = "0.4"
simple_logger = { version = "4.0", default-features = false, features = [
"stderr",
] }
tokio = { workspace = true, features = ["full"] }

[features]
default = []
async = ["ttrpc/async", "async-trait"]
Expand Down Expand Up @@ -66,3 +45,21 @@ required-features = ["async"]
name = "shim-proto-connect-async"
path = "examples/connect-async.rs"
required-features = ["async"]

[dependencies]
async-trait = { version = "0.1.48", optional = true }
protobuf = "3.1"
# Quickfix to make CI green.
# 0.8.1 introduces a breaking change in the API.
# https://github.com/containerd/ttrpc-rust/pull/197
# https://github.com/containerd/ttrpc-rust/pull/209
ttrpc = "=0.8.0"

[build-dependencies]
ttrpc-codegen = "0.4"

[dev-dependencies]
ctrlc = { version = "3.0", features = ["termination"] }
log.workspace = true
simple_logger = { version = "4.0", default-features = false, features = ["stderr"]}
tokio = { workspace = true, features = ["full"] }
57 changes: 37 additions & 20 deletions crates/shim/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
[package]
name = "containerd-shim"
version = "0.5.0"
authors = ["Maksym Pavlenko <[email protected]>", "The containerd Authors"]
keywords = ["containerd", "shim", "containers"]
authors = [
"Maksym Pavlenko <[email protected]>",
"The containerd Authors",
]
description = "containerd shim extension"
keywords = ["containerd", "shim", "containers"]
categories = ["api-bindings", "asynchronous"]

edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true

[features]
async = ["tokio", "containerd-shim-protos/async", "async-trait", "futures", "signal-hook-tokio"]
async = [
"async-trait",
"containerd-shim-protos/async",
"futures",
"signal-hook-tokio",
"tokio",
]

[[example]]
name = "skeleton_async"
Expand All @@ -22,27 +32,26 @@ name = "windows-log-reader"
path = "examples/windows_log_reader.rs"

[dependencies]
containerd-shim-protos = { path = "../shim-protos", version = "0.5.0" }
go-flag = "0.1.0"
thiserror = "1.0"
log = { version = "0.4", features = ["std"] }
libc = "0.2.95"
nix = "0.26"
lazy_static = "1.4.0"
time = { version = "0.3.7", features = ["serde", "std"] }
serde_json = "1.0.78"
serde_derive = "1.0.136"
serde = "1.0.136"
signal-hook = "0.3.13"
oci-spec = "0.6.0"
prctl = "1.0.0"
libc.workspace = true
log = { workspace = true, features = ["std"]}
nix.workspace = true
oci-spec.workspace = true
page_size = "0.6.0"
prctl = "1.0.0"
signal-hook = "0.3.13"
serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true
time.workspace = true

containerd-shim-protos = { path = "../shim-protos", version = "0.5.0" }

# Async dependencies
async-trait = { workspace = true, optional = true }
tokio = { workspace = true, features = ["full"], optional = true }
futures = { workspace = true, optional = true}
signal-hook-tokio = { version = "0.3.1", optional = true, features = ["futures-v0_3"]}
tokio = { workspace = true, features = ["full"], optional = true }

[target.'cfg(target_os = "linux")'.dependencies]
cgroups-rs = "0.2.9"
Expand All @@ -51,9 +60,17 @@ cgroups-rs = "0.2.9"
command-fds = "0.2.1"

[target.'cfg(windows)'.dependencies]
windows-sys = {version = "0.48.0", features = ["Win32_Foundation","Win32_System_WindowsProgramming","Win32_System_Console", "Win32_System_Pipes","Win32_Security", "Win32_Storage_FileSystem", "Win32_System_Threading"]}
mio = { version = "0.8", features = ["os-ext", "os-poll"] }
os_pipe = "1.1.3"
os_pipe.workspace = true
windows-sys = {version = "0.48.0", features = [
"Win32_Foundation",
"Win32_System_WindowsProgramming",
"Win32_System_Console",
"Win32_System_Pipes",
"Win32_Security",
"Win32_Storage_FileSystem",
"Win32_System_Threading",
]}

[dev-dependencies]
tempfile = "3.0"
tempfile = "3.6"
20 changes: 10 additions & 10 deletions crates/snapshots/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@
name = "containerd-snapshots"
version = "0.3.0"
authors = [
"Maksym Pavlenko <[email protected]>",
"The containerd Authors",
"Maksym Pavlenko <[email protected]>",
"The containerd Authors",
]
description = "Remote snapshotter extension for containerd"
keywords = ["containerd", "server", "grpc", "containers"]
categories = ["api-bindings", "asynchronous"]
description = "Remote snapshotter extension for containerd"

edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true

[dependencies]
thiserror = "1.0"
tonic.workspace = true
async-stream = "0.3.3"
futures.workspace = true
pin-utils = "0.1.0"
prost.workspace = true
prost-types.workspace = true
serde.workspace = true
thiserror.workspace = true
tonic.workspace = true
tokio = { workspace = true, features = ["sync"] }
tokio-stream = "0.1.8"
serde = { version = "1.0", features = ["derive"] }
async-stream = "0.3.3"
futures.workspace = true
pin-utils = "0.1.0"

[dev-dependencies]
log = "0.4"
async-stream = "0.3.2"
futures.workspace = true
log.workspace = true
simple_logger = { version = "4.0", default-features = false }

[build-dependencies]
Expand Down