feat: should listen on public endpoint

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-08-18 01:46:46 +02:00
parent 95acdf4f4a
commit bfe88dc008
Signed by: kjuulh
GPG Key ID: 9AA7BC13CE474394
2 changed files with 9 additions and 5 deletions

View File

@ -31,10 +31,10 @@ impl NoData {
tracing::info!("starting no data component"); tracing::info!("starting no data component");
let grpc_server = grpc::no_data_component_server::NoDataComponentServer::new(NoDataGrpc {}); 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() tonic::transport::Server::builder()
.add_service(grpc_server) .add_service(grpc_server)
.serve("127.0.0.1:7900".parse()?) .serve("0.0.0.0:7900".parse()?)
.await .await
.context("nodata component grpc server failed")?; .context("nodata component grpc server failed")?;

View File

@ -215,14 +215,15 @@ async fn spawn_container(
let service = client let service = client
.container() .container()
.from(image) .from(image)
.with_exposed_port(80) .with_exposed_port(7900)
.with_exec(vec!["nodata-transformer-test"])
.as_service(); .as_service();
service service
.up_opts( .up_opts(
ServiceUpOptsBuilder::default() ServiceUpOptsBuilder::default()
.ports(vec![PortForward { .ports(vec![PortForward {
backend: 80, backend: 7900,
frontend: outer_port as isize, frontend: outer_port as isize,
protocol: dagger_sdk::NetworkProtocol::Tcp, protocol: dagger_sdk::NetworkProtocol::Tcp,
}]) }])
@ -249,7 +250,10 @@ mod tests {
tracing::info!("starting dagger container"); tracing::info!("starting dagger container");
let container = dagger_engine let container = dagger_engine
.start_container("some_name", "nginx:latest") .start_container(
"some_name",
"kasperhermansen/nodata-transformer-test:main-1723938077",
)
.await?; .await?;
tracing::info!("getting grpc handle"); tracing::info!("getting grpc handle");