chore(tvix): upgrade to tonic 0.12 / hyper 1.0

Change-Id: Idd8ce48869ddd869d51a10959b920f1290a8a9b3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11991
Autosubmit: yuka <yuka@yuka.dev>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
This commit is contained in:
Yureka 2024-07-20 20:15:42 +02:00 committed by clbot
parent 1515a970be
commit ca8e2b9fbf
15 changed files with 1840 additions and 751 deletions

596
tvix/Cargo.lock generated

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -7,11 +7,11 @@ edition = "2021"
bytes = "1.4.0" bytes = "1.4.0"
clap = { version = "4.0", features = ["derive", "env"] } clap = { version = "4.0", features = ["derive", "env"] }
itertools = "0.12.0" itertools = "0.12.0"
prost = "0.12.1" prost = "0.13.1"
thiserror = "1.0.56" thiserror = "1.0.56"
tokio = { version = "1.32.0" } tokio = { version = "1.32.0" }
tokio-listener = { version = "0.4.1", features = [ "tonic011" ] } tokio-listener = { version = "0.4.1", features = [ "tonic012" ] }
tonic = { version = "0.11.0", features = ["tls", "tls-roots"] } tonic = { version = "0.12.0", features = ["tls", "tls-roots"] }
tvix-castore = { path = "../castore" } tvix-castore = { path = "../castore" }
tvix-tracing = { path = "../tracing" } tvix-tracing = { path = "../tracing" }
tracing = "0.1.40" tracing = "0.1.40"
@ -19,11 +19,11 @@ url = "2.4.0"
[dependencies.tonic-reflection] [dependencies.tonic-reflection]
optional = true optional = true
version = "0.11.0" version = "0.12.0"
[build-dependencies] [build-dependencies]
prost-build = "0.12.1" prost-build = "0.13.1"
tonic-build = "0.11.0" tonic-build = "0.12.0"
[features] [features]
default = [] default = []

View file

@ -15,17 +15,17 @@ digest = "0.10.7"
fastcdc = { version = "3.1.0", features = ["tokio"] } fastcdc = { version = "3.1.0", features = ["tokio"] }
futures = "0.3.30" futures = "0.3.30"
lazy_static = "1.4.0" lazy_static = "1.4.0"
object_store = { version = "0.9.1", features = ["http"] } object_store = { version = "0.10.1", features = ["http"] }
parking_lot = "0.12.1" parking_lot = "0.12.1"
pin-project-lite = "0.2.13" pin-project-lite = "0.2.13"
prost = "0.12.1" prost = "0.13.1"
sled = { version = "0.34.7" } sled = { version = "0.34.7" }
thiserror = "1.0.38" thiserror = "1.0.38"
tokio-stream = { version = "0.1.14", features = ["fs", "net"] } tokio-stream = { version = "0.1.14", features = ["fs", "net"] }
tokio-util = { version = "0.7.9", features = ["io", "io-util", "codec"] } tokio-util = { version = "0.7.9", features = ["io", "io-util", "codec"] }
tokio-tar = "0.3.1" tokio-tar = "0.3.1"
tokio = { version = "1.32.0", features = ["fs", "macros", "net", "rt", "rt-multi-thread", "signal"] } tokio = { version = "1.32.0", features = ["fs", "macros", "net", "rt", "rt-multi-thread", "signal"] }
tonic = "0.11.0" tonic = "0.12.0"
tower = "0.4.13" tower = "0.4.13"
tracing = "0.1.37" tracing = "0.1.37"
tracing-indicatif = "0.3.6" tracing-indicatif = "0.3.6"
@ -39,6 +39,7 @@ serde_qs = "0.12.0"
petgraph = "0.6.4" petgraph = "0.6.4"
erased-serde = "0.4.5" erased-serde = "0.4.5"
serde_tagged = "0.3.0" serde_tagged = "0.3.0"
hyper-util = "0.1.6"
[dependencies.bigtable_rs] [dependencies.bigtable_rs]
optional = true optional = true
@ -58,7 +59,7 @@ optional = true
[dependencies.tonic-reflection] [dependencies.tonic-reflection]
optional = true optional = true
version = "0.11.0" version = "0.12.0"
[dependencies.vhost] [dependencies.vhost]
optional = true optional = true
@ -85,8 +86,8 @@ optional = true
version = "0.2.1" version = "0.2.1"
[build-dependencies] [build-dependencies]
prost-build = "0.12.1" prost-build = "0.13.1"
tonic-build = "0.11.0" tonic-build = "0.12.0"
[dev-dependencies] [dev-dependencies]
async-process = "2.1.0" async-process = "2.1.0"

View file

@ -2,6 +2,7 @@ use crate::blobservice::{BlobService, MemoryBlobService};
use crate::proto::blob_service_client::BlobServiceClient; use crate::proto::blob_service_client::BlobServiceClient;
use crate::proto::GRPCBlobServiceWrapper; use crate::proto::GRPCBlobServiceWrapper;
use crate::{blobservice::GRPCBlobService, proto::blob_service_server::BlobServiceServer}; use crate::{blobservice::GRPCBlobService, proto::blob_service_server::BlobServiceServer};
use hyper_util::rt::TokioIo;
use tonic::transport::{Endpoint, Server, Uri}; use tonic::transport::{Endpoint, Server, Uri};
/// Constructs and returns a gRPC BlobService. /// Constructs and returns a gRPC BlobService.
@ -33,7 +34,7 @@ pub async fn make_grpc_blob_service_client() -> Box<dyn BlobService> {
.unwrap() .unwrap()
.connect_with_connector(tower::service_fn(move |_: Uri| { .connect_with_connector(tower::service_fn(move |_: Uri| {
let right = maybe_right.take().unwrap(); let right = maybe_right.take().unwrap();
async move { Ok::<_, std::io::Error>(right) } async move { Ok::<_, std::io::Error>(TokioIo::new(right)) }
})) }))
.await .await
.unwrap(), .unwrap(),

View file

@ -6,6 +6,7 @@ use crate::{
proto::directory_service_server::DirectoryServiceServer, proto::directory_service_server::DirectoryServiceServer,
}; };
use hyper_util::rt::TokioIo;
use tonic::transport::{Endpoint, Server, Uri}; use tonic::transport::{Endpoint, Server, Uri};
/// Constructs and returns a gRPC DirectoryService. /// Constructs and returns a gRPC DirectoryService.
@ -37,7 +38,7 @@ pub async fn make_grpc_directory_service_client() -> Box<dyn DirectoryService> {
.unwrap() .unwrap()
.connect_with_connector(tower::service_fn(move |_: Uri| { .connect_with_connector(tower::service_fn(move |_: Uri| {
let right = maybe_right.take().unwrap(); let right = maybe_right.take().unwrap();
async move { Ok::<_, std::io::Error>(right) } async move { Ok::<_, std::io::Error>(TokioIo::new(right)) }
})) }))
.await .await
.unwrap(), .unwrap(),

View file

@ -1,3 +1,4 @@
use hyper_util::rt::TokioIo;
use tokio::net::UnixStream; use tokio::net::UnixStream;
use tonic::transport::{Channel, Endpoint}; use tonic::transport::{Channel, Endpoint};
@ -25,7 +26,10 @@ pub async fn channel_from_url(url: &url::Url) -> Result<Channel, self::Error> {
let connector = tower::service_fn({ let connector = tower::service_fn({
let url = url.clone(); let url = url.clone();
move |_: tonic::transport::Uri| UnixStream::connect(url.path().to_string().clone()) move |_: tonic::transport::Uri| {
let unix = UnixStream::connect(url.path().to_string().clone());
async move { Ok::<_, std::io::Error>(TokioIo::new(unix.await?)) }
}
}); });
// the URL doesn't matter // the URL doesn't matter

View file

@ -1,3 +1,4 @@
{ {
"git+https://github.com/tokio-rs/tracing-opentelemetry?branch=otel-0.24#0.25.0": "1b0qw6jv1dws2s8vmk1m0zryhihsd4n1vp0yvbbwx5qjqdsny3i1",
"git+https://github.com/tvlfyi/wu-manber.git#wu-manber@0.1.0": "1zhk83lbq99xzyjwphv2qrb8f8qgfqwa5bbbvyzm0z0bljsjv0pd" "git+https://github.com/tvlfyi/wu-manber.git#wu-manber@0.1.0": "1zhk83lbq99xzyjwphv2qrb8f8qgfqwa5bbbvyzm0z0bljsjv0pd"
} }

View file

@ -19,6 +19,7 @@ let
(lib.nameValuePair "${crates.internal.crates.${k}.crateName}-${crates.internal.crates.${k}.version}" crates.internal.crates.${k}.src.outputHash) (lib.nameValuePair "${crates.internal.crates.${k}.crateName}-${crates.internal.crates.${k}.version}" crates.internal.crates.${k}.src.outputHash)
) [ ) [
"wu-manber" "wu-manber"
"tracing-opentelemetry 0.25.0"
]); ]);
}; };

View file

@ -12,7 +12,7 @@ futures = "0.3.30"
magic = "0.16.2" magic = "0.16.2"
nix-compat = { path = "../nix-compat" } nix-compat = { path = "../nix-compat" }
pin-project = "1.1" pin-project = "1.1"
reqwest = { version = "0.11.22", features = ["rustls-tls-native-roots"], default-features = false } reqwest = { version = "0.12.0", features = ["rustls-tls-native-roots"], default-features = false }
tvix-build = { path = "../build", default-features = false, features = []} tvix-build = { path = "../build", default-features = false, features = []}
tvix-eval = { path = "../eval" } tvix-eval = { path = "../eval" }
tvix-castore = { path = "../castore" } tvix-castore = { path = "../castore" }

View file

@ -12,13 +12,13 @@ clap = { version = "4.0", features = ["derive", "env"] }
data-encoding = "2.3.3" data-encoding = "2.3.3"
futures = "0.3.30" futures = "0.3.30"
itertools = "0.12.0" itertools = "0.12.0"
prost = "0.12.1" prost = "0.13.1"
nix-compat = { path = "../nix-compat", features = ["async"] } nix-compat = { path = "../nix-compat", features = ["async"] }
thiserror = "1.0.56" thiserror = "1.0.56"
tokio = { version = "1.32.0" } tokio = { version = "1.32.0" }
tokio-listener = { version = "0.4.2", features = [ "axum07", "clap", "multi-listener", "sd_listen" ] } tokio-listener = { version = "0.4.2", features = [ "axum07", "clap", "multi-listener", "sd_listen" ] }
tokio-util = { version = "0.7.9", features = ["io", "io-util", "compat"] } tokio-util = { version = "0.7.9", features = ["io", "io-util", "compat"] }
tonic = { version = "0.11.0", features = ["tls", "tls-roots"] } tonic = { version = "0.12.0", features = ["tls", "tls-roots"] }
tvix-castore = { path = "../castore" } tvix-castore = { path = "../castore" }
tvix-store = { path = "../store" } tvix-store = { path = "../store" }
tvix-tracing = { path = "../tracing", features = ["tonic", "axum"] } tvix-tracing = { path = "../tracing", features = ["tonic", "axum"] }
@ -30,8 +30,8 @@ lru = "0.12.3"
parking_lot = "0.12.3" parking_lot = "0.12.3"
[build-dependencies] [build-dependencies]
prost-build = "0.12.1" prost-build = "0.13.1"
tonic-build = "0.11.0" tonic-build = "0.12.0"
[features] [features]
default = ["otlp"] default = ["otlp"]

View file

@ -17,7 +17,7 @@ futures = "0.3.30"
lazy_static = "1.4.0" lazy_static = "1.4.0"
nix-compat = { path = "../nix-compat", features = ["async"] } nix-compat = { path = "../nix-compat", features = ["async"] }
pin-project-lite = "0.2.13" pin-project-lite = "0.2.13"
prost = "0.12.1" prost = "0.13.1"
serde = { version = "1.0.197", features = [ "derive" ] } serde = { version = "1.0.197", features = [ "derive" ] }
serde_json = "1.0" serde_json = "1.0"
serde_with = "3.7.0" serde_with = "3.7.0"
@ -26,34 +26,35 @@ sha2 = "0.10.6"
sled = { version = "0.34.7" } sled = { version = "0.34.7" }
thiserror = "1.0.38" thiserror = "1.0.38"
tokio = { version = "1.32.0", features = ["fs", "macros", "net", "rt", "rt-multi-thread", "signal"] } tokio = { version = "1.32.0", features = ["fs", "macros", "net", "rt", "rt-multi-thread", "signal"] }
tokio-listener = { version = "0.4.2", features = [ "clap", "multi-listener", "sd_listen", "tonic011" ] } tokio-listener = { version = "0.4.2", features = [ "clap", "multi-listener", "sd_listen", "tonic012" ] }
tokio-stream = { version = "0.1.14", features = ["fs"] } tokio-stream = { version = "0.1.14", features = ["fs"] }
tokio-util = { version = "0.7.9", features = ["io", "io-util", "compat"] } tokio-util = { version = "0.7.9", features = ["io", "io-util", "compat"] }
tonic = { version = "0.11.0", features = ["tls", "tls-roots"] } tonic = { version = "0.12.0", features = ["tls", "tls-roots"] }
tower = "0.4.13" tower = "0.4.13"
tower-http = { version = "0.4.4", features = ["trace"] } tower-http = { version = "0.5.0", features = ["trace"] }
tvix-castore = { path = "../castore" } tvix-castore = { path = "../castore" }
url = "2.4.0" url = "2.4.0"
walkdir = "2.4.0" walkdir = "2.4.0"
reqwest = { version = "0.11.22", features = ["rustls-tls-native-roots", "stream"], default-features = false } reqwest = { version = "0.12.0", features = ["rustls-tls-native-roots", "stream"], default-features = false }
reqwest-middleware = "0.2.5" reqwest-middleware = "0.3.0"
lru = "0.12.3" lru = "0.12.3"
parking_lot = "0.12.2" parking_lot = "0.12.2"
tvix-tracing = { path = "../tracing", features = ["tonic", "reqwest"] } tvix-tracing = { path = "../tracing", features = ["tonic", "reqwest"] }
tracing = "0.1.40" tracing = "0.1.40"
tracing-indicatif = "0.3.6" tracing-indicatif = "0.3.6"
hyper-util = "0.1.6"
[dependencies.tonic-reflection] [dependencies.tonic-reflection]
optional = true optional = true
version = "0.11.0" version = "0.12.0"
[dependencies.bigtable_rs] [dependencies.bigtable_rs]
optional = true optional = true
version = "0.2.10" version = "0.2.10"
[build-dependencies] [build-dependencies]
prost-build = "0.12.1" prost-build = "0.13.1"
tonic-build = "0.11.0" tonic-build = "0.12.0"
[dev-dependencies] [dev-dependencies]
async-process = "2.1.0" async-process = "2.1.0"

View file

@ -1,5 +1,6 @@
use std::sync::Arc; use std::sync::Arc;
use hyper_util::rt::TokioIo;
use tonic::transport::{Endpoint, Server, Uri}; use tonic::transport::{Endpoint, Server, Uri};
use tvix_castore::{blobservice::BlobService, directoryservice::DirectoryService}; use tvix_castore::{blobservice::BlobService, directoryservice::DirectoryService};
@ -57,7 +58,7 @@ pub async fn make_grpc_path_info_service_client() -> (
.unwrap() .unwrap()
.connect_with_connector(tower::service_fn(move |_: Uri| { .connect_with_connector(tower::service_fn(move |_: Uri| {
let right = maybe_right.take().unwrap(); let right = maybe_right.take().unwrap();
async move { Ok::<_, std::io::Error>(right) } async move { Ok::<_, std::io::Error>(TokioIo::new(right)) }
})) }))
.await .await
.unwrap(), .unwrap(),

View file

@ -12,17 +12,17 @@ tracing-indicatif = "0.3.6"
tokio = { version = "1.32.0" , features = ["sync", "rt"] } tokio = { version = "1.32.0" , features = ["sync", "rt"] }
thiserror = "1.0.38" thiserror = "1.0.38"
tracing-opentelemetry = { version = "0.23.0", optional = true } tracing-opentelemetry = { git = "https://github.com/tokio-rs/tracing-opentelemetry", branch = "otel-0.24", version = "0.25.0", optional = true }
opentelemetry = { version = "0.22.0", optional = true } opentelemetry = { version = "0.24.0", optional = true }
opentelemetry-otlp = { version = "0.15.0", optional = true } opentelemetry-otlp = { version = "0.17.0", optional = true }
opentelemetry_sdk = { version = "0.22.1", features = ["rt-tokio"], optional = true } opentelemetry_sdk = { version = "0.24.1", features = ["rt-tokio"], optional = true }
tracing-tracy = { version = "0.11.0", features = ["flush-on-exit"], optional = true } tracing-tracy = { version = "0.11.0", features = ["flush-on-exit"], optional = true }
opentelemetry-http = { version = "0.11.0", optional = true } opentelemetry-http = { version = "0.13.0", optional = true }
tonic = { version = "0.11.0", optional = true } tonic = { version = "0.12.0", optional = true }
http = { version = "0.2.11", optional = true } http = { version = "1.1.0", optional = true }
reqwest-tracing = { version = "0.4.8", default-features = false, optional = true } reqwest-tracing = { version = "0.5.0", default-features = false, optional = true }
axum = { version = "0.7.5", optional = true } axum = { version = "0.7.5", optional = true }

View file

@ -6,7 +6,10 @@ use tracing_indicatif::{filter::IndicatifFilter, writer, IndicatifLayer, Indicat
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Layer}; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Layer};
#[cfg(feature = "otlp")] #[cfg(feature = "otlp")]
use opentelemetry::{trace::Tracer, KeyValue}; use opentelemetry::{
trace::{Tracer, TracerProvider},
KeyValue,
};
#[cfg(feature = "otlp")] #[cfg(feature = "otlp")]
use opentelemetry_sdk::{ use opentelemetry_sdk::{
propagation::TraceContextPropagator, propagation::TraceContextPropagator,
@ -264,7 +267,7 @@ fn gen_otlp_tracer(
impl Tracer + tracing_opentelemetry::PreSampledTracer, impl Tracer + tracing_opentelemetry::PreSampledTracer,
mpsc::Sender<Option<oneshot::Sender<()>>>, mpsc::Sender<Option<oneshot::Sender<()>>>,
) { ) {
let tracer = opentelemetry_otlp::new_pipeline() let tracer_provider = opentelemetry_otlp::new_pipeline()
.tracing() .tracing()
.with_exporter(opentelemetry_otlp::new_exporter().tonic()) .with_exporter(opentelemetry_otlp::new_exporter().tonic())
.with_batch_config( .with_batch_config(
@ -281,7 +284,7 @@ fn gen_otlp_tracer(
.with_scheduled_delay(std::time::Duration::from_secs(10)) .with_scheduled_delay(std::time::Duration::from_secs(10))
.build(), .build(),
) )
.with_trace_config(opentelemetry_sdk::trace::config().with_resource({ .with_trace_config(opentelemetry_sdk::trace::Config::default().with_resource({
// use SdkProvidedResourceDetector.detect to detect resources, // use SdkProvidedResourceDetector.detect to detect resources,
// but replace the default service name with our default. // but replace the default service name with our default.
// https://github.com/open-telemetry/opentelemetry-rust/issues/1298 // https://github.com/open-telemetry/opentelemetry-rust/issues/1298
@ -302,9 +305,7 @@ fn gen_otlp_tracer(
// Trace provider is need for later use like flushing the provider. // Trace provider is need for later use like flushing the provider.
// Needs to be kept around for each message to rx we need to handle. // Needs to be kept around for each message to rx we need to handle.
let tracer_provider = tracer let tracer = tracer_provider.tracer("tvix");
.provider()
.expect("Failed to get the tracer provider");
// Set up a channel for flushing trace providers later // Set up a channel for flushing trace providers later
let (tx, mut rx) = mpsc::channel::<Option<oneshot::Sender<()>>>(16); let (tx, mut rx) = mpsc::channel::<Option<oneshot::Sender<()>>>(16);