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

Removes http_02 dependency and updates tonic/prost #670

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
320 changes: 231 additions & 89 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ futures = "0.3"
futures-core = "0.3.29"
futures-util = "0.3.29"
golem-wasm-ast = "0.3.2"
golem-wasm-rpc = { version = "0.0.34", default-features = false, features = ["host"] }
#golem-wasm-rpc = { version = "0.0.34", default-features = false, features = ["host"] }
golem-wasm-rpc = { git = "https://github.com/golemcloud/wasm-rpc", branch="update-prost", default-features = false, features = ["host"] }
http = "1.0.0" # keep in sync with wasmtime
http_02 = { package = "http", version = "0.2.11" }
humantime-serde = "1.1.1"
hyper = { version = "1.0.1", features = ["full"] } # keep in sync with wasmtime
iso8601-timestamp = "0.2.16"
Expand Down Expand Up @@ -121,8 +121,8 @@ poem = { version = "3.0.1", features = ["prometheus", "opentelemetry", "test"] }
postgres = "0.19.7"
prometheus = { version = "0.13.3", features = ["process"] }
proptest = "1.4.0"
prost = "0.12.3"
prost-types = "0.12.3"
prost = "0.13.1"
prost-types = "0.13.1"
redis = { version = "0.25.2", features = ["default"] }
regex = "1.10.3"
reqwest = { version = "0.12.5", features = [
Expand Down Expand Up @@ -165,9 +165,9 @@ tokio-rustls = { version = "0.26.0" }
tokio-stream = { version = "0.1", features = ["sync"] }
tokio-util = "0.7.10"
toml = "0.8.14"
tonic = "0.11.0"
tonic-reflection = "0.11.0"
tonic-health = "0.11.0"
tonic = "0.12.0"
tonic-reflection = "0.12.0"
tonic-health = "0.12.0"
tracing = { version = "0.1.40", features = ["log"] }
tracing-opentelemetry = "0.24.0"
tracing-serde = "0.1.3"
Expand Down
2 changes: 1 addition & 1 deletion golem-api-grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ uuid = { workspace = true }

[build-dependencies]
cargo_metadata = "0.18.1"
tonic-build = "0.11.0"
tonic-build = "0.12.0"
2 changes: 1 addition & 1 deletion golem-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ derive_more = { workspace = true }
figment = { workspace = true }
fred = { workspace = true }
futures-core = { workspace = true }
http = { workspace = true }
humantime-serde = { workspace = true }
http_02 = { workspace = true }
iso8601-timestamp = { workspace = true }
lazy_static = { workspace = true }
poem = { workspace = true }
Expand Down
10 changes: 5 additions & 5 deletions golem-common/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use tonic::{Code, Status};

#[derive(Clone)]
pub struct GrpcClient<T: Clone> {
endpoint: http_02::Uri,
endpoint: http::Uri,
config: GrpcClientConfig,
client: Arc<Mutex<Option<GrpcClientConnection<T>>>>,
client_factory: Arc<dyn Fn(Channel) -> T + Send + Sync + 'static>,
Expand All @@ -34,7 +34,7 @@ pub struct GrpcClient<T: Clone> {
impl<T: Clone> GrpcClient<T> {
pub fn new(
client_factory: impl Fn(Channel) -> T + Send + Sync + 'static,
endpoint: http_02::Uri,
endpoint: http::Uri,
config: GrpcClientConfig,
) -> Self {
Self {
Expand Down Expand Up @@ -96,7 +96,7 @@ impl<T: Clone> GrpcClient<T> {
#[derive(Clone)]
pub struct MultiTargetGrpcClient<T: Clone> {
config: GrpcClientConfig,
clients: Arc<DashMap<http_02::Uri, GrpcClientConnection<T>>>,
clients: Arc<DashMap<http::Uri, GrpcClientConnection<T>>>,
client_factory: Arc<dyn Fn(Channel) -> T + Send + Sync>,
}

Expand All @@ -112,7 +112,7 @@ impl<T: Clone> MultiTargetGrpcClient<T> {
}
}

pub async fn call<F, R>(&self, endpoint: http_02::Uri, f: F) -> Result<R, Status>
pub async fn call<F, R>(&self, endpoint: http::Uri, f: F) -> Result<R, Status>
where
F: for<'a> Fn(&'a mut T) -> Pin<Box<dyn Future<Output = Result<R, Status>> + 'a + Send>>
+ Send,
Expand Down Expand Up @@ -143,7 +143,7 @@ impl<T: Clone> MultiTargetGrpcClient<T> {

fn get(
&self,
endpoint: http_02::Uri,
endpoint: http::Uri,
) -> Result<GrpcClientConnection<T>, tonic::transport::Error> {
let connect_timeout = self.config.connect_timeout;
let entry = self
Expand Down
4 changes: 2 additions & 2 deletions golem-common/src/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ impl Pod {
.expect("Failed to build URI")
}

pub fn uri_02(&self) -> http_02::Uri {
http_02::Uri::builder()
pub fn uri_02(&self) -> http::Uri {
http::Uri::builder()
.scheme("http")
.authority(format!("{}:{}", self.host, self.port).as_str())
.path_and_query("/")
Expand Down
1 change: 0 additions & 1 deletion golem-component-compilation-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ golem-worker-executor-base = { version = "0.0.0", path = "../golem-worker-execut
async-trait = { workspace = true }
futures = { workspace = true }
http = { workspace = true }
http_02 = { workspace = true }
tokio = { workspace = true }

tracing = { workspace = true }
Expand Down
10 changes: 0 additions & 10 deletions golem-component-compilation-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,3 @@ fn create_wasmtime_config() -> wasmtime::Config {

config
}

pub trait UriBackConversion {
fn as_http_02(&self) -> http_02::Uri;
}

impl UriBackConversion for http::Uri {
fn as_http_02(&self) -> http_02::Uri {
self.to_string().parse().unwrap()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl CompileWorker {
ComponentServiceClient::new(channel)
.max_decoding_message_size(max_component_size)
},
uri.as_http_02(),
uri,
GrpcClientConfig {
retries_on_unavailable: config.retries.clone(),
..Default::default() // TODO
Expand Down
1 change: 0 additions & 1 deletion golem-component-service-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ anyhow = { workspace = true }
async-trait = { workspace = true }
bincode = { workspace = true }
bytes = { workspace = true }
http_02 = { workspace = true }
prost = { workspace = true }
serde = { workspace = true }
sqlx = { workspace = true, features = [
Expand Down
4 changes: 2 additions & 2 deletions golem-component-service-base/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ pub struct ComponentCompilationEnabledConfig {
}

impl ComponentCompilationEnabledConfig {
pub fn uri(&self) -> http_02::Uri {
http_02::Uri::builder()
pub fn uri(&self) -> http::Uri {
http::Uri::builder()
.scheme("http")
.authority(format!("{}:{}", self.host, self.port).as_str())
.path_and_query("/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub struct ComponentCompilationServiceDefault {
}

impl ComponentCompilationServiceDefault {
pub fn new(uri: http_02::Uri) -> Self {
pub fn new(uri: http::Uri) -> Self {
let client = GrpcClient::new(
ComponentCompilationServiceClient::new,
uri,
Expand Down
1 change: 0 additions & 1 deletion golem-component-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ console-subscriber = { workspace = true }
figment = { workspace = true }
futures-util = { workspace = true }
golem-wasm-ast = { workspace = true }
http_02 = { workspace = true }
humantime-serde = { workspace = true }
lazy_static = { workspace = true }
mappable-rc = "0.1.1"
Expand Down
1 change: 0 additions & 1 deletion golem-service-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ bigdecimal = "0.4.2"
bincode = { workspace = true }
futures = { workspace = true }
http = { workspace = true }
http_02 = { workspace = true }
hyper = { workspace = true }
num-traits = "0.2"
poem-openapi = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion golem-service-base/src/routing_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub struct RoutingTableConfig {
}

impl RoutingTableConfig {
pub fn url(&self) -> http_02::Uri {
pub fn url(&self) -> http::Uri {
format!("http://{}:{}", self.host, self.port)
.parse()
.expect("Failed to parse shard manager URL")
Expand Down
1 change: 0 additions & 1 deletion golem-shard-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ figment = { workspace = true }
fred = { workspace = true }
futures = { workspace = true }
http = { workspace = true }
http_02 = { workspace = true }
humantime-serde = { workspace = true }
k8s-openapi = { workspace = true, optional = true }
kube = { workspace = true, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion golem-shard-manager/src/http_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use std::net::SocketAddr;

use http_02::{Response, StatusCode};
use http::{Response, StatusCode};
use prometheus::{Encoder, Registry, TextEncoder};
use tokio::task::JoinHandle;
use warp::hyper::Body;
Expand Down
4 changes: 2 additions & 2 deletions golem-shard-manager/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ impl Pod {
Endpoint::from(self.uri())
}

pub fn uri(&self) -> http_02::Uri {
http_02::Uri::builder()
pub fn uri(&self) -> http::Uri {
http::Uri::builder()
.scheme("http")
.authority(format!("{}:{}", self.ip, self.port).as_str())
.path_and_query("")
Expand Down
1 change: 0 additions & 1 deletion golem-worker-executor-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ futures-util = { workspace = true }
gethostname = "0.4.3"
golem-wit = { version = "0.3.1" }
http = { workspace = true }
http_02 = { workspace = true }
http-body = "1.0.0" # keep in sync with wasmtime
humansize = "2.1.3"
humantime-serde = { workspace = true }
Expand Down
10 changes: 0 additions & 10 deletions golem-worker-executor-base/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1830,16 +1830,6 @@ impl GrpcInvokeRequest for golem::workerexecutor::InvokeAndAwaitWorkerRequest {
}
}

pub trait UriBackConversion {
fn as_http_02(&self) -> http_02::Uri;
}

impl UriBackConversion for http::Uri {
fn as_http_02(&self) -> http_02::Uri {
self.to_string().parse().unwrap()
}
}

pub fn authorised_grpc_request<T>(request: T, access_token: &Uuid) -> Request<T> {
let mut req = Request::new(request);
req.metadata_mut().insert(
Expand Down
2 changes: 1 addition & 1 deletion golem-worker-executor-base/src/http_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use std::fmt::Display;
use std::net::SocketAddr;

use http_02::{Response, StatusCode};
use http::{Response, StatusCode};
use prometheus::{Encoder, Registry, TextEncoder};
use tokio::task::JoinHandle;
use tracing::info;
Expand Down
2 changes: 1 addition & 1 deletion golem-worker-executor-base/src/services/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl ComponentServiceGrpc {
ComponentServiceClient::new(channel)
.max_decoding_message_size(max_component_size)
},
endpoint.as_http_02(),
endpoint,
GrpcClientConfig {
retries_on_unavailable: retry_config.clone(),
..Default::default() // TODO
Expand Down
2 changes: 1 addition & 1 deletion golem-worker-executor-base/src/services/shard_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl ShardManagerServiceGrpc {
pub fn new(config: ShardManagerServiceGrpcConfig) -> Self {
let client = GrpcClient::new(
ShardManagerServiceClient::new,
config.uri().as_http_02(),
config.uri(),
GrpcClientConfig {
retries_on_unavailable: config.retries.clone(),
..Default::default()
Expand Down
2 changes: 1 addition & 1 deletion golem-worker-executor-base/src/services/worker_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl RemoteWorkerProxy {
Self {
client: GrpcClient::new(
WorkerServiceClient::new,
endpoint.as_http_02(),
endpoint,
Default::default(), // TODO
),
access_token,
Expand Down
2 changes: 1 addition & 1 deletion golem-worker-executor-base/tests/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::sync::{Arc, Mutex};
use std::time::Duration;

use assert2::check;
use http_02::{Response, StatusCode};
use http::{Response, StatusCode};
use redis::Commands;

use golem_api_grpc::proto::golem::worker::{
Expand Down
2 changes: 1 addition & 1 deletion golem-worker-executor-base/tests/guest_languages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use std::net::SocketAddr;

use chrono::Datelike;
use golem_wasm_rpc::Value;
use http_02::{Response, StatusCode};
use http::{Response, StatusCode};
use std::sync::{Arc, Mutex};
use std::time::Duration;

Expand Down
2 changes: 1 addition & 1 deletion golem-worker-executor-base/tests/hot_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use assert2::check;
use async_mutex::Mutex;
use golem_test_framework::dsl::TestDslUnsafe;
use golem_wasm_rpc::Value;
use http_02::{Response, StatusCode};
use http::{Response, StatusCode};
use log::info;
use std::collections::HashMap;
use std::net::SocketAddr;
Expand Down
2 changes: 1 addition & 1 deletion golem-worker-executor-base/tests/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use golem_test_framework::dsl::{
drain_connection, stdout_event, stdout_event_starting_with, worker_error_message, TestDslUnsafe,
};
use golem_wasm_rpc::Value;
use http_02::{Response, StatusCode};
use http::{Response, StatusCode};
use std::collections::HashMap;
use std::net::SocketAddr;
use std::sync::{Arc, Mutex};
Expand Down
2 changes: 1 addition & 1 deletion golem-worker-executor-base/tests/wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use golem_test_framework::dsl::{
drain_connection, stderr_event, stdout_event, worker_error_message, TestDslUnsafe,
};
use golem_wasm_rpc::Value;
use http_02::{Response, StatusCode};
use http::{Response, StatusCode};
use tokio::spawn;
use tokio::time::Instant;
use tonic::transport::Body;
Expand Down
1 change: 0 additions & 1 deletion golem-worker-service-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ figment = { workspace = true }
futures = { workspace = true }
futures-util = { workspace = true }
http = { workspace = true }
http_02 = { workspace = true }
humantime-serde = { workspace = true }
hyper = { workspace = true }
lazy_static = { workspace = true }
Expand Down
10 changes: 0 additions & 10 deletions golem-worker-service-base/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,3 @@ pub mod repo;
pub mod service;
mod worker_binding;
pub mod worker_bridge_execution;

pub trait UriBackConversion {
fn as_http_02(&self) -> http_02::Uri;
}

impl UriBackConversion for Uri {
fn as_http_02(&self) -> http_02::Uri {
self.to_string().parse().unwrap()
}
}
2 changes: 1 addition & 1 deletion golem-worker-service-base/src/service/component/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl RemoteComponentService {
Self {
client: GrpcClient::new(
ComponentServiceClient::new,
uri.as_http_02(),
uri,
GrpcClientConfig {
retries_on_unavailable: retry_config.clone(),
..Default::default() // TODO
Expand Down
1 change: 0 additions & 1 deletion golem-worker-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ figment = { workspace = true }
futures = { workspace = true }
futures-util = { workspace = true }
http = { workspace = true }
http_02 = { workspace = true }
humantime-serde = { workspace = true }
hyper = { workspace = true }
lazy_static = { workspace = true }
Expand Down
Loading