From bfe88dc008de2cfa16b13741097a16e64616fdf5 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sun, 18 Aug 2024 01:46:46 +0200 Subject: [PATCH] feat: should listen on public endpoint Signed-off-by: kjuulh --- crates/nodata-sdk/src/lib.rs | 4 ++-- crates/nodata/src/dagger_engine.rs | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crates/nodata-sdk/src/lib.rs b/crates/nodata-sdk/src/lib.rs index 4bbea36..3708989 100644 --- a/crates/nodata-sdk/src/lib.rs +++ b/crates/nodata-sdk/src/lib.rs @@ -31,10 +31,10 @@ impl NoData { tracing::info!("starting no data component"); let grpc_server = grpc::no_data_component_server::NoDataComponentServer::new(NoDataGrpc {}); - tracing::info!("component grpc listening on: 127.0.0.1:7900"); + tracing::info!("component grpc listening on: 0.0.0.0:7900"); tonic::transport::Server::builder() .add_service(grpc_server) - .serve("127.0.0.1:7900".parse()?) + .serve("0.0.0.0:7900".parse()?) .await .context("nodata component grpc server failed")?; diff --git a/crates/nodata/src/dagger_engine.rs b/crates/nodata/src/dagger_engine.rs index f078963..cc8e5b2 100644 --- a/crates/nodata/src/dagger_engine.rs +++ b/crates/nodata/src/dagger_engine.rs @@ -215,14 +215,15 @@ async fn spawn_container( let service = client .container() .from(image) - .with_exposed_port(80) + .with_exposed_port(7900) + .with_exec(vec!["nodata-transformer-test"]) .as_service(); service .up_opts( ServiceUpOptsBuilder::default() .ports(vec![PortForward { - backend: 80, + backend: 7900, frontend: outer_port as isize, protocol: dagger_sdk::NetworkProtocol::Tcp, }]) @@ -249,7 +250,10 @@ mod tests { tracing::info!("starting dagger container"); let container = dagger_engine - .start_container("some_name", "nginx:latest") + .start_container( + "some_name", + "kasperhermansen/nodata-transformer-test:main-1723938077", + ) .await?; tracing::info!("getting grpc handle");