runtime-rs: Put local dependencies into workspace

Put local dependencies into workspace to avoid complex path dependencies all
over the workspace. This gives an overview of local dependencies this workspace
uses, where those crates are located, and simplifies the local dependencies
referencing process.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
Ruoqing He 2025-04-09 07:30:29 +00:00
parent 3769ad9c0d
commit 28c09ae645
15 changed files with 109 additions and 80 deletions

View File

@ -11,3 +11,32 @@ members = [
"tests/utils", "tests/utils",
] ]
[workspace.dependencies]
agent = { path = "crates/agent" }
hypervisor = { path = "crates/hypervisor" }
persist = { path = "crates/persist"}
resource = { path = "crates/resource" }
runtimes = { path = "crates/runtimes" }
service = { path = "crates/service" }
tests_utils = { path = "tests/utils" }
ch-config = { path = "crates/hypervisor/ch-config" }
common = { path = "crates/runtimes/common" }
linux_container = { path = "crates/runtimes/linux_container" }
virt_container = { path = "crates/runtimes/virt_container" }
wasm_container = { path = "crates/runtimes/wasm_container" }
# Local dependencies from `src/libs`
kata-sys-util = { path = "../libs/kata-sys-util"}
kata-types = { path = "../libs/kata-types"}
logging = { path = "../libs/logging"}
protocols = { path = "../libs/protocols", features=["async"] }
runtime-spec = { path = "../libs/runtime-spec" }
safe-path = { path = "../libs/safe-path"}
shim-interface = { path = "../libs/shim-interface" }
test-utils = { path = "../libs/test-utils" }
# Local dependencies from `src/dragonball`
dragonball = { path = "../dragonball" }
dbs-utils = { path = "../dragonball/dbs_utils" }

View File

@ -25,9 +25,9 @@ nix = "0.24.2"
oci-spec = { version = "0.6.8", features = ["runtime"] } oci-spec = { version = "0.6.8", features = ["runtime"] }
# Local dependencies # Local dependencies
kata-types = { path = "../../../libs/kata-types"} kata-types = { workspace = true }
logging = { path = "../../../libs/logging"} logging = { workspace = true }
protocols = { path = "../../../libs/protocols", features=["async"] } protocols = { workspace = true, features=["async"] }
[features] [features]
default = [] default = []

View File

@ -41,17 +41,17 @@ hyperlocal = "0.8.0"
hyper = { version = "0.14.18", features = ["client"] } hyper = { version = "0.14.18", features = ["client"] }
# Local dependencies # Local dependencies
kata-sys-util = { path = "../../../libs/kata-sys-util" } kata-sys-util = { workspace = true }
kata-types = { path = "../../../libs/kata-types" } kata-types = { workspace = true }
logging = { path = "../../../libs/logging" } logging = { workspace = true }
protocols = { path = "../../../libs/protocols", features = ["async"] } protocols = { workspace = true, features = ["async"] }
shim-interface = { path = "../../../libs/shim-interface" } shim-interface = { workspace = true }
persist = { path = "../persist" } persist = { workspace = true }
ch-config = { path = "ch-config", optional = true } ch-config = { workspace = true, optional = true }
tests_utils = { path = "../../tests/utils" } tests_utils = { workspace = true }
# Local dependencies: Dragonball # Local dependencies: Dragonball
dragonball = { path = "../../../dragonball", features = [ dragonball = { workspace = true, features = [
"atomic-guest-memory", "atomic-guest-memory",
"virtio-vsock", "virtio-vsock",
"hotplug", "hotplug",
@ -65,7 +65,7 @@ dragonball = { path = "../../../dragonball", features = [
"vhost-user-net", "vhost-user-net",
"host-device", "host-device",
], optional = true } ], optional = true }
dbs-utils = { path = "../../../dragonball/dbs_utils" } dbs-utils = { workspace = true }
[features] [features]
default = [] default = []
@ -81,8 +81,8 @@ serial_test = "2.0.0"
# Local dev-dependencies # Local dev-dependencies
# Force the CH tests to run, even when the feature is not enabled for # Force the CH tests to run, even when the feature is not enabled for
# a normal build. # a normal build.
hypervisor = { path = ".", features = ["cloud-hypervisor"] } hypervisor = { workspace = true, features = ["cloud-hypervisor"] }
test-utils = { path = "../../../libs/test-utils" } test-utils = { workspace = true }
[build-dependencies] [build-dependencies]
ttrpc-codegen = "0.4.2" ttrpc-codegen = "0.4.2"

View File

@ -24,5 +24,5 @@ thiserror = "1.0.38"
api_client = { git = "https://github.com/cloud-hypervisor/cloud-hypervisor", crate = "api_client", tag = "v27.0" } api_client = { git = "https://github.com/cloud-hypervisor/cloud-hypervisor", crate = "api_client", tag = "v27.0" }
# Local dependencies # Local dependencies
kata-types = { path = "../../../../libs/kata-types"} kata-types = { workspace = true }
kata-sys-util = { path = "../../../../libs/kata-sys-util"} kata-sys-util = { workspace = true }

View File

@ -13,7 +13,7 @@ serde = { version = "1.0.138", features = ["derive"] }
serde_json = "1.0.82" serde_json = "1.0.82"
# Local dependencies # Local dependencies
kata-sys-util = { path = "../../../libs/kata-sys-util"} kata-sys-util = { workspace = true }
kata-types = { path = "../../../libs/kata-types" } kata-types = { workspace = true }
shim-interface = { path = "../../../libs/shim-interface" } shim-interface = { workspace = true }
safe-path = { path = "../../../libs/safe-path"} safe-path = { workspace = true }

View File

@ -9,7 +9,7 @@ license = "Apache-2.0"
tempfile = "3.2.0" tempfile = "3.2.0"
# Local dev-dependencies # Local dev-dependencies
test-utils = { path = "../../../libs/test-utils" } test-utils = { workspace = true }
[dependencies] [dependencies]
anyhow = "^1.0" anyhow = "^1.0"
@ -38,12 +38,12 @@ uuid = { version = "0.4", features = ["v4"] }
oci-spec = { version = "0.6.8", features = ["runtime"] } oci-spec = { version = "0.6.8", features = ["runtime"] }
# Local dependencies # Local dependencies
agent = { path = "../agent" } agent = { workspace = true }
hypervisor = { path = "../hypervisor" } hypervisor = { workspace = true }
kata-types = { path = "../../../libs/kata-types" } kata-types = { workspace = true }
kata-sys-util = { path = "../../../libs/kata-sys-util" } kata-sys-util = { workspace = true }
logging = { path = "../../../libs/logging" } logging = { workspace = true }
persist = { path = "../persist"} persist = { workspace = true }
tests_utils = { path = "../../tests/utils" } tests_utils = { workspace = true }
[features] [features]

View File

@ -27,21 +27,21 @@ prometheus = { version = "0.13.0", features = ["process"] }
oci-spec = { version = "0.6.8", features = ["runtime"] } oci-spec = { version = "0.6.8", features = ["runtime"] }
# Local dependencies # Local dependencies
agent = { path = "../agent" } agent = { workspace = true }
common = { path = "./common" } common = { workspace = true }
kata-types = { path = "../../../libs/kata-types" } kata-types = { workspace = true }
kata-sys-util = { path = "../../../libs/kata-sys-util" } kata-sys-util = { workspace = true }
logging = { path = "../../../libs/logging"} logging = { workspace = true }
runtime-spec = { path = "../../../libs/runtime-spec" } runtime-spec = { workspace = true }
shim-interface = { path = "../../../libs/shim-interface" } shim-interface = { workspace = true }
persist = { path = "../persist" } persist = { workspace = true }
hypervisor = { path = "../hypervisor" } hypervisor = { workspace = true }
resource = { path = "../resource" } resource = { workspace = true }
# Local dependencies: runtime handler # Local dependencies: runtime handler
linux_container = { path = "./linux_container", optional = true } linux_container = { workspace = true, optional = true }
virt_container = { path = "./virt_container", optional = true } virt_container = { workspace = true, optional = true }
wasm_container = { path = "./wasm_container", optional = true } wasm_container = { workspace = true, optional = true }
[features] [features]
default = ["virt"] default = ["virt"]

View File

@ -24,10 +24,10 @@ ttrpc = "0.8.4"
oci-spec = { version = "0.6.8", features = ["runtime"] } oci-spec = { version = "0.6.8", features = ["runtime"] }
# Local dependencies # Local dependencies
persist = { path = "../../persist" } persist = { workspace = true }
agent = { path = "../../agent" } agent = { workspace = true }
kata-sys-util = { path = "../../../../libs/kata-sys-util" } kata-sys-util = { workspace = true }
kata-types = { path = "../../../../libs/kata-types" } kata-types = { workspace = true }
runtime-spec = { path = "../../../../libs/runtime-spec" } runtime-spec = { workspace = true }
resource = { path = "../../resource" } resource = { workspace = true }
protocols = { path = "../../../../libs/protocols"} protocols = { workspace = true }

View File

@ -10,6 +10,6 @@ async-trait = "0.1.48"
tokio = { version = "1.38.0" } tokio = { version = "1.38.0" }
# Local dependencies # Local dependencies
common = { path = "../common" } common = { workspace = true }
kata-types = { path = "../../../../libs/kata-types" } kata-types = { workspace = true }
resource = { path = "../../resource" } resource = { workspace = true }

View File

@ -30,15 +30,15 @@ oci-spec = { version = "0.6.8", features = ["runtime"] }
strum = { version = "0.24.0", features = ["derive"] } strum = { version = "0.24.0", features = ["derive"] }
# Local dependencies # Local dependencies
agent = { path = "../../agent" } agent = { workspace = true }
common = { path = "../common" } common = { workspace = true }
hypervisor = { path = "../../hypervisor", features = ["cloud-hypervisor"] } hypervisor = { workspace = true, features = ["cloud-hypervisor"] }
kata-sys-util = { path = "../../../../libs/kata-sys-util" } kata-sys-util = { workspace = true }
kata-types = { path = "../../../../libs/kata-types" } kata-types = { workspace = true }
logging = { path = "../../../../libs/logging"} logging = { workspace = true }
runtime-spec = { path = "../../../../libs/runtime-spec" } runtime-spec = { workspace = true }
persist = { path = "../../persist"} persist = { workspace = true }
resource = { path = "../../resource" } resource = { workspace = true }
[features] [features]
default = ["cloud-hypervisor"] default = ["cloud-hypervisor"]

View File

@ -10,6 +10,6 @@ async-trait = "0.1.48"
tokio = { version = "1.38.0" } tokio = { version = "1.38.0" }
# Local dependencies # Local dependencies
common = { path = "../common" } common = { workspace = true }
kata-types = { path = "../../../../libs/kata-types" } kata-types = { workspace = true }
resource = { path = "../../resource" } resource = { workspace = true }

View File

@ -17,8 +17,8 @@ containerd-shim-protos = { version = "0.6.0", features = ["async", "sandbox"] }
containerd-shim = { version = "0.6.0", features = ["async"] } containerd-shim = { version = "0.6.0", features = ["async"] }
# Local dependencies # Local dependencies
common = { path = "../runtimes/common" } common = { workspace = true }
logging = { path = "../../../libs/logging" } logging = { workspace = true }
kata-types = { path = "../../../libs/kata-types" } kata-types = { workspace = true }
runtimes = { path = "../runtimes" } runtimes = { workspace = true }
persist = { path = "../persist" } persist = { workspace = true }

View File

@ -10,6 +10,6 @@ anyhow = "^1.0"
tokio = { version = "1.38.0", features = [ "rt", "rt-multi-thread" ] } tokio = { version = "1.38.0", features = [ "rt", "rt-multi-thread" ] }
# Local dependencies # Local dependencies
common = { path = "../runtimes/common" } common = { workspace = true }
logging = { path = "../../../libs/logging"} logging = { workspace = true }
runtimes = { path = "../runtimes" } runtimes = { workspace = true }

View File

@ -34,12 +34,12 @@ tracing-opentelemetry = "0.18.0"
oci-spec = { version = "0.6.8", features = ["runtime"] } oci-spec = { version = "0.6.8", features = ["runtime"] }
# Local dependencies # Local dependencies
kata-types = { path = "../../../libs/kata-types"} kata-types = { workspace = true }
kata-sys-util = { path = "../../../libs/kata-sys-util"} kata-sys-util = { workspace = true }
logging = { path = "../../../libs/logging"} logging = { workspace = true }
runtime-spec = { path = "../../../libs/runtime-spec" } runtime-spec = { workspace = true }
service = { path = "../service" } service = { workspace = true }
runtimes = { path = "../runtimes" } runtimes = { workspace = true }
[dev-dependencies] [dev-dependencies]
tempfile = "3.2.0" tempfile = "3.2.0"
@ -47,4 +47,4 @@ rand = "0.8.4"
serial_test = "0.5.1" serial_test = "0.5.1"
# Local dev-dependencies # Local dev-dependencies
tests_utils = { path = "../../tests/utils"} tests_utils = { workspace = true }

View File

@ -12,4 +12,4 @@ anyhow = "^1.0"
rand = "0.8.4" rand = "0.8.4"
# Local dependencies # Local dependencies
kata-types = { path = "../../../libs/kata-types" } kata-types = { workspace = true }