Unverified Commit b2aa504b authored by Dan Aloni's avatar Dan Aloni Committed by GitHub
Browse files

fix: upgrade axum to 0.8 and etcd-client to 0.16 (#2317)


Signed-off-by: default avatarDan Aloni <dan.aloni@vastdata.com>
parent 6be5c196
...@@ -367,38 +367,6 @@ version = "1.4.0" ...@@ -367,38 +367,6 @@ version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "axum"
version = "0.6.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf"
dependencies = [
"async-trait",
"axum-core 0.3.4",
"bitflags 1.3.2",
"bytes",
"futures-util",
"http 0.2.12",
"http-body 0.4.6",
"hyper 0.14.32",
"itoa",
"matchit 0.7.3",
"memchr",
"mime",
"percent-encoding",
"pin-project-lite",
"rustversion",
"serde",
"serde_json",
"serde_path_to_error",
"serde_urlencoded",
"sync_wrapper 0.1.2",
"tokio",
"tower 0.4.13",
"tower-layer",
"tower-service",
]
[[package]] [[package]]
name = "axum" name = "axum"
version = "0.7.9" version = "0.7.9"
...@@ -460,23 +428,6 @@ dependencies = [ ...@@ -460,23 +428,6 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "axum-core"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c"
dependencies = [
"async-trait",
"bytes",
"futures-util",
"http 0.2.12",
"http-body 0.4.6",
"mime",
"rustversion",
"tower-layer",
"tower-service",
]
[[package]] [[package]]
name = "axum-core" name = "axum-core"
version = "0.4.5" version = "0.4.5"
...@@ -1145,7 +1096,7 @@ dependencies = [ ...@@ -1145,7 +1096,7 @@ dependencies = [
"futures-core", "futures-core",
"prost 0.13.5", "prost 0.13.5",
"prost-types", "prost-types",
"tonic", "tonic 0.12.3",
"tracing-core", "tracing-core",
] ]
...@@ -1169,7 +1120,7 @@ dependencies = [ ...@@ -1169,7 +1120,7 @@ dependencies = [
"thread_local", "thread_local",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
"tonic", "tonic 0.12.3",
"tracing", "tracing",
"tracing-core", "tracing-core",
"tracing-subscriber", "tracing-subscriber",
...@@ -2249,17 +2200,17 @@ dependencies = [ ...@@ -2249,17 +2200,17 @@ dependencies = [
[[package]] [[package]]
name = "etcd-client" name = "etcd-client"
version = "0.14.1" version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc0452bcc559431b16f472b7ab86e2f9ccd5f3c2da3795afbd6b773665e047fe" checksum = "88365f1a5671eb2f7fc240adb216786bc6494b38ce15f1d26ad6eaa303d5e822"
dependencies = [ dependencies = [
"http 1.3.1", "http 1.3.1",
"prost 0.13.5", "prost 0.13.5",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
"tonic", "tonic 0.13.1",
"tonic-build", "tonic-build",
"tower 0.4.13", "tower 0.5.2",
"tower-service", "tower-service",
] ]
...@@ -4107,7 +4058,7 @@ dependencies = [ ...@@ -4107,7 +4058,7 @@ dependencies = [
name = "metrics" name = "metrics"
version = "0.4.0" version = "0.4.0"
dependencies = [ dependencies = [
"axum 0.6.20", "axum 0.8.3",
"clap 4.5.40", "clap 4.5.40",
"dynamo-llm", "dynamo-llm",
"dynamo-runtime", "dynamo-runtime",
...@@ -7545,10 +7496,8 @@ dependencies = [ ...@@ -7545,10 +7496,8 @@ dependencies = [
"percent-encoding", "percent-encoding",
"pin-project", "pin-project",
"prost 0.13.5", "prost 0.13.5",
"rustls-pemfile",
"socket2", "socket2",
"tokio", "tokio",
"tokio-rustls",
"tokio-stream", "tokio-stream",
"tower 0.4.13", "tower 0.4.13",
"tower-layer", "tower-layer",
...@@ -7556,11 +7505,41 @@ dependencies = [ ...@@ -7556,11 +7505,41 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "tonic"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e581ba15a835f4d9ea06c55ab1bd4dce26fc53752c69a04aac00703bfb49ba9"
dependencies = [
"async-trait",
"axum 0.8.3",
"base64 0.22.1",
"bytes",
"h2 0.4.9",
"http 1.3.1",
"http-body 1.0.1",
"http-body-util",
"hyper 1.6.0",
"hyper-timeout",
"hyper-util",
"percent-encoding",
"pin-project",
"prost 0.13.5",
"socket2",
"tokio",
"tokio-rustls",
"tokio-stream",
"tower 0.5.2",
"tower-layer",
"tower-service",
"tracing",
]
[[package]] [[package]]
name = "tonic-build" name = "tonic-build"
version = "0.12.3" version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" checksum = "eac6f67be712d12f0b41328db3137e0d0757645d8904b4cb7d51cd9c2279e847"
dependencies = [ dependencies = [
"prettyplease", "prettyplease",
"proc-macro2", "proc-macro2",
...@@ -7598,9 +7577,12 @@ checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" ...@@ -7598,9 +7577,12 @@ checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"futures-util", "futures-util",
"indexmap 2.9.0",
"pin-project-lite", "pin-project-lite",
"slab",
"sync_wrapper 1.0.2", "sync_wrapper 1.0.2",
"tokio", "tokio",
"tokio-util",
"tower-layer", "tower-layer",
"tower-service", "tower-service",
"tracing", "tracing",
......
...@@ -43,7 +43,7 @@ chrono = { version = "0.4", default-features = false, features = ["alloc", "std" ...@@ -43,7 +43,7 @@ chrono = { version = "0.4", default-features = false, features = ["alloc", "std"
derive_builder = { version = "0.20" } derive_builder = { version = "0.20" }
derive-getters = { version = "0.5" } derive-getters = { version = "0.5" }
either = { version = "1.13", features = ["serde"] } either = { version = "1.13", features = ["serde"] }
etcd-client = { version = "0.14", features = ["tls"] } etcd-client = { version = "0.16", features = ["tls"] }
futures = { version = "0.3" } futures = { version = "0.3" }
hf-hub = { version = "0.4.2", default-features = false, features = ["tokio", "rustls-tls", "ureq"] } hf-hub = { version = "0.4.2", default-features = false, features = ["tokio", "rustls-tls", "ureq"] }
humantime = { version = "2.2.0" } humantime = { version = "2.2.0" }
......
...@@ -35,7 +35,6 @@ thiserror = { workspace = true } ...@@ -35,7 +35,6 @@ thiserror = { workspace = true }
tokio = { workspace = true } tokio = { workspace = true }
tracing = { workspace = true } tracing = { workspace = true }
# TODO: Update axum to 0.8 axum = { version = "0.8" }
axum = { version = "0.6" }
clap = { version = "4.5", features = ["derive", "env"] } clap = { version = "4.5", features = ["derive", "env"] }
reqwest = { version = "0.12.22", default-features = false, features = ["json", "rustls-tls"] } reqwest = { version = "0.12.22", default-features = false, features = ["json", "rustls-tls"] }
...@@ -210,20 +210,12 @@ impl PrometheusMetricsCollector { ...@@ -210,20 +210,12 @@ impl PrometheusMetricsCollector {
let (tx, rx) = tokio::sync::oneshot::channel(); let (tx, rx) = tokio::sync::oneshot::channel();
self.shutdown_tx = Some(tx); self.shutdown_tx = Some(tx);
// Try to bind to the address first to fail early if it's not available
let server = match axum::Server::try_bind(&addr) {
Ok(server) => server,
Err(e) => {
return Err(error!(
"Failed to bind to address {}: {}. The port may be in use.",
addr, e
));
}
};
// Spawn the server in a background task // Spawn the server in a background task
tokio::spawn(async move { tokio::spawn(async move {
let server = server.serve(app.into_make_service()); let listener = tokio::net::TcpListener::bind(addr)
.await
.unwrap_or_else(|_| panic!("could not bind to address: {addr}"));
let server = axum::serve(listener, app);
// Create a future that completes when shutdown signal is received // Create a future that completes when shutdown signal is received
let shutdown_future = async { let shutdown_future = async {
......
...@@ -316,40 +316,13 @@ version = "1.4.0" ...@@ -316,40 +316,13 @@ version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "axum"
version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f"
dependencies = [
"async-trait",
"axum-core 0.4.5",
"bytes",
"futures-util",
"http",
"http-body",
"http-body-util",
"itoa",
"matchit 0.7.3",
"memchr",
"mime",
"percent-encoding",
"pin-project-lite",
"rustversion",
"serde",
"sync_wrapper",
"tower 0.5.2",
"tower-layer",
"tower-service",
]
[[package]] [[package]]
name = "axum" name = "axum"
version = "0.8.3" version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de45108900e1f9b9242f7f2e254aa3e2c029c921c258fe9e6b4217eeebd54288" checksum = "de45108900e1f9b9242f7f2e254aa3e2c029c921c258fe9e6b4217eeebd54288"
dependencies = [ dependencies = [
"axum-core 0.5.2", "axum-core",
"bytes", "bytes",
"form_urlencoded", "form_urlencoded",
"futures-util", "futures-util",
...@@ -359,7 +332,7 @@ dependencies = [ ...@@ -359,7 +332,7 @@ dependencies = [
"hyper", "hyper",
"hyper-util", "hyper-util",
"itoa", "itoa",
"matchit 0.8.4", "matchit",
"memchr", "memchr",
"mime", "mime",
"percent-encoding", "percent-encoding",
...@@ -371,32 +344,12 @@ dependencies = [ ...@@ -371,32 +344,12 @@ dependencies = [
"serde_urlencoded", "serde_urlencoded",
"sync_wrapper", "sync_wrapper",
"tokio", "tokio",
"tower 0.5.2", "tower",
"tower-layer", "tower-layer",
"tower-service", "tower-service",
"tracing", "tracing",
] ]
[[package]]
name = "axum-core"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199"
dependencies = [
"async-trait",
"bytes",
"futures-util",
"http",
"http-body",
"http-body-util",
"mime",
"pin-project-lite",
"rustversion",
"sync_wrapper",
"tower-layer",
"tower-service",
]
[[package]] [[package]]
name = "axum-core" name = "axum-core"
version = "0.5.2" version = "0.5.2"
...@@ -1179,7 +1132,7 @@ dependencies = [ ...@@ -1179,7 +1132,7 @@ dependencies = [
"async-stream", "async-stream",
"async-trait", "async-trait",
"async_zmq", "async_zmq",
"axum 0.8.3", "axum",
"blake3", "blake3",
"bs62", "bs62",
"bytemuck", "bytemuck",
...@@ -1271,7 +1224,7 @@ dependencies = [ ...@@ -1271,7 +1224,7 @@ dependencies = [
"async-stream", "async-stream",
"async-trait", "async-trait",
"async_zmq", "async_zmq",
"axum 0.8.3", "axum",
"blake3", "blake3",
"bytes", "bytes",
"chrono", "chrono",
...@@ -1434,9 +1387,9 @@ dependencies = [ ...@@ -1434,9 +1387,9 @@ dependencies = [
[[package]] [[package]]
name = "etcd-client" name = "etcd-client"
version = "0.14.1" version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc0452bcc559431b16f472b7ab86e2f9ccd5f3c2da3795afbd6b773665e047fe" checksum = "88365f1a5671eb2f7fc240adb216786bc6494b38ce15f1d26ad6eaa303d5e822"
dependencies = [ dependencies = [
"http", "http",
"prost", "prost",
...@@ -1444,7 +1397,7 @@ dependencies = [ ...@@ -1444,7 +1397,7 @@ dependencies = [
"tokio-stream", "tokio-stream",
"tonic", "tonic",
"tonic-build", "tonic-build",
"tower 0.4.13", "tower",
"tower-service", "tower-service",
] ]
...@@ -1965,7 +1918,7 @@ checksum = "3ac5654356c6f7f6116905aeaf92ab002c3d03414ada5dbe0bb2e32aa5fea173" ...@@ -1965,7 +1918,7 @@ checksum = "3ac5654356c6f7f6116905aeaf92ab002c3d03414ada5dbe0bb2e32aa5fea173"
dependencies = [ dependencies = [
"fancy-regex", "fancy-regex",
"ggml-quants", "ggml-quants",
"indexmap 2.9.0", "indexmap",
"log", "log",
"num_enum", "num_enum",
] ]
...@@ -1994,7 +1947,7 @@ dependencies = [ ...@@ -1994,7 +1947,7 @@ dependencies = [
"futures-core", "futures-core",
"futures-sink", "futures-sink",
"http", "http",
"indexmap 2.9.0", "indexmap",
"slab", "slab",
"tokio", "tokio",
"tokio-util", "tokio-util",
...@@ -2015,12 +1968,6 @@ dependencies = [ ...@@ -2015,12 +1968,6 @@ dependencies = [
"rand_distr", "rand_distr",
] ]
[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.14.5" version = "0.14.5"
...@@ -2368,16 +2315,6 @@ dependencies = [ ...@@ -2368,16 +2315,6 @@ dependencies = [
"icu_properties", "icu_properties",
] ]
[[package]]
name = "indexmap"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown 0.12.3",
]
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "2.9.0" version = "2.9.0"
...@@ -2640,12 +2577,6 @@ dependencies = [ ...@@ -2640,12 +2577,6 @@ dependencies = [
"regex-automata 0.1.10", "regex-automata 0.1.10",
] ]
[[package]]
name = "matchit"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
[[package]] [[package]]
name = "matchit" name = "matchit"
version = "0.8.4" version = "0.8.4"
...@@ -3265,7 +3196,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -3265,7 +3196,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772"
dependencies = [ dependencies = [
"fixedbitset", "fixedbitset",
"indexmap 2.9.0", "indexmap",
] ]
[[package]] [[package]]
...@@ -3921,7 +3852,7 @@ dependencies = [ ...@@ -3921,7 +3852,7 @@ dependencies = [
"tokio", "tokio",
"tokio-rustls", "tokio-rustls",
"tokio-util", "tokio-util",
"tower 0.5.2", "tower",
"tower-http", "tower-http",
"tower-service", "tower-service",
"url", "url",
...@@ -4864,7 +4795,7 @@ version = "0.22.27" ...@@ -4864,7 +4795,7 @@ version = "0.22.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
dependencies = [ dependencies = [
"indexmap 2.9.0", "indexmap",
"serde", "serde",
"serde_spanned", "serde_spanned",
"toml_datetime", "toml_datetime",
...@@ -4880,13 +4811,12 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" ...@@ -4880,13 +4811,12 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
[[package]] [[package]]
name = "tonic" name = "tonic"
version = "0.12.3" version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" checksum = "7e581ba15a835f4d9ea06c55ab1bd4dce26fc53752c69a04aac00703bfb49ba9"
dependencies = [ dependencies = [
"async-stream",
"async-trait", "async-trait",
"axum 0.7.9", "axum",
"base64 0.22.1", "base64 0.22.1",
"bytes", "bytes",
"h2", "h2",
...@@ -4899,12 +4829,11 @@ dependencies = [ ...@@ -4899,12 +4829,11 @@ dependencies = [
"percent-encoding", "percent-encoding",
"pin-project", "pin-project",
"prost", "prost",
"rustls-pemfile",
"socket2", "socket2",
"tokio", "tokio",
"tokio-rustls", "tokio-rustls",
"tokio-stream", "tokio-stream",
"tower 0.4.13", "tower",
"tower-layer", "tower-layer",
"tower-service", "tower-service",
"tracing", "tracing",
...@@ -4912,9 +4841,9 @@ dependencies = [ ...@@ -4912,9 +4841,9 @@ dependencies = [
[[package]] [[package]]
name = "tonic-build" name = "tonic-build"
version = "0.12.3" version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" checksum = "eac6f67be712d12f0b41328db3137e0d0757645d8904b4cb7d51cd9c2279e847"
dependencies = [ dependencies = [
"prettyplease", "prettyplease",
"proc-macro2", "proc-macro2",
...@@ -4924,26 +4853,6 @@ dependencies = [ ...@@ -4924,26 +4853,6 @@ dependencies = [
"syn 2.0.100", "syn 2.0.100",
] ]
[[package]]
name = "tower"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
dependencies = [
"futures-core",
"futures-util",
"indexmap 1.9.3",
"pin-project",
"pin-project-lite",
"rand 0.8.5",
"slab",
"tokio",
"tokio-util",
"tower-layer",
"tower-service",
"tracing",
]
[[package]] [[package]]
name = "tower" name = "tower"
version = "0.5.2" version = "0.5.2"
...@@ -4952,9 +4861,12 @@ checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" ...@@ -4952,9 +4861,12 @@ checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"futures-util", "futures-util",
"indexmap",
"pin-project-lite", "pin-project-lite",
"slab",
"sync_wrapper", "sync_wrapper",
"tokio", "tokio",
"tokio-util",
"tower-layer", "tower-layer",
"tower-service", "tower-service",
"tracing", "tracing",
...@@ -4973,7 +4885,7 @@ dependencies = [ ...@@ -4973,7 +4885,7 @@ dependencies = [
"http-body", "http-body",
"iri-string", "iri-string",
"pin-project-lite", "pin-project-lite",
"tower 0.5.2", "tower",
"tower-layer", "tower-layer",
"tower-service", "tower-service",
] ]
...@@ -5900,7 +5812,7 @@ dependencies = [ ...@@ -5900,7 +5812,7 @@ dependencies = [
"crc32fast", "crc32fast",
"crossbeam-utils", "crossbeam-utils",
"displaydoc", "displaydoc",
"indexmap 2.9.0", "indexmap",
"num_enum", "num_enum",
"thiserror 1.0.69", "thiserror 1.0.69",
] ]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment