#Can you expose a service to peers on a
1 messages · Page 1 of 1 (latest)
If your function returns either a dagger.Container that runs a service or a dagger.Service, as long as you have withExposedPort already set, the you chain an up on the dagger CLI invocation.
So I've got a service that's running using dagger.io/dagger (not a module) that I've exposed to the host on a given port. So localhost:<port> is functioning but I need to publish this to other devices on the same network e.g. 10.0.0.0/24
So I've got service to service working and service to host working, but I'm not clear on how to take another server's request and pass it to a dagger service
I think the simplest solution is to run nginx locally and set up a reverse proxy so that other devices on your network can reach your local service.
But I am still not entirely sure on your specific use case. If you share more concrete details it will be easier to point in the right direction.
sure.
I'm running a dagger based ci/cd workflow and though it'd be helpful to have a version that will build the application, data-layer, that I can use something like https://github.com/six-ddc/plow to perform performance testing of the build artifact.
I did this by putting the the application components into different dagger services and hooking them up and stuck all of that behind a proxy which allows me to manipulate the traffic for the application.
This all works great from the host running the dagger engine. e.g. curl localhost:<proxy-port> However, when trying to run the load tests from external host curl <dagger-host>:<proxy-port> It doesn't look to be forwarding the traffic over
I guess what I'm really after is something like a --network <host|bridge> for the dagger engine services
but running a proxy on the host and injecting that in might be a workaround
Thanks, this is great!
In this example is dagger-host also your local machine or a remote host?
the dagger host running the dagger engine. e.g. its running go run . with dagger.io\dagger
Oh what I could do is make dagger aware of a host proxy service itself
Hm, this should just work especially if localhost=dagger host
For example, I have a service that I start like this: dagger call serve up --ports 8000:80
this starts a tunnel
▼ .up(ports: [{frontend: 8000, backend: 80, protocol: TCP}]): Void 2m38s
┃ 18:50:38 INF tunnel started port=8000 protocol=tcp http_url=http://localhost:8000 description="tunnel 0.0.0.0:8000 -> e13m15h9p8muq.ks63k0
┃ 77pfi.dagger.local:80"
I can reach it from both localhost:8000 and also the $ip_local_machine:8000
note that the "server" is where the dagger client is, not where the dagger engine is.
also, I am using modules, I don't know if it makes a huge difference but it might in terms of how things are ultimately wired up and exposed.
so up stood up a container on the dagger engine server, as well as a tunnel from your host to that service right?
Yep exactly, in my case I have a remote dagger engine running somewhere else. But I access the running service from my laptop via the tunnel.
I can also see the service by going to my laptops local IP address on port 8000.
I cannot, however, curl the engine on port 8000 because that is not exposed. The tunnel exists on the client. Hope that makes sense.