#Can anyone think of a more clever way to

1 messages · Page 1 of 1 (latest)

rugged pond
#

Briefly went down this rabbit hole during the hackathon and decided to just say "run two dagger ups" for now. 😅 Also curious what ideas people have

drowsy star
#

That was my backup plan lol

#

I can forward multiple ports from one service with up, right?

rugged pond
#

If we find a nice way to do it, at least a lot of the "hard parts" we get for ~free (log multiplexing, etc)

rugged pond
#

it might be a socat one-liner 🤔

drowsy star
#

I was going to create a proxy module that's just an nginx container that creates reverse proxy entry for each service added

rugged pond
#

dope

drowsy star
#

we'll see how it goes! the unanticipated part of my demo was that since I have one service serving the frontend, and another service serving the backend, they both need to be accessible to the host since the frontend->backend communication happens host side

ionic falcon
drowsy star
#

I'll do it once for all of us 😂 daggercloak

clever maple
#

same problem I had with the graphiql/playground module

#

@drowsy star if you check in my tailscale module there is the “introspect ports, generate multi-socat proxy” logic, if you want to steal that. nginx config sounds nice too 🙂 will it work for raw tcp though?

drowsy star
rugged pond
drowsy star
#

Proxy module unlocked: https://daggerverse.dev/mod/github.com/kpenfound/dagger-modules/proxy@f9cc629f6d5d98e620c4fc35312d27d3d6de48f7

The API isn't exactly what I want yet, but that's due to limitations of the Python SDK and I wanted to use Python. Once we're able to put properties on the base class in Python it'll be much easier to use.

Here's how the usage looks today: https://github.com/kpenfound/greetings-api/blob/zenith/ci/main.go#L29-L37
working with: dagger -m ./ci up -p 8080,8081 serve --dir "."

GitHub

Contribute to kpenfound/greetings-api development by creating an account on GitHub.

#

with the SDK limitations:

proxy := dag.Proxy().Proxy(backendService, "backend", 8080)
proxy = dag.Proxy().AdditionalProxy(proxy, frontendService, "frontend", 8081)
return dag.Proxy().Service(proxy)

vs how I want it once python has classes and properties:

return dag.Proxy().
  WithService(backendService, "backend", 8080).
  WithService(frontendService, "frontend", 8081).
  Serve()
clever maple
#

@drowsy star quick question on the ./ci part. Have you considered a pattern where the dagger.json is at the root of the app repo? Would make that -m ./ci not necessary

#

mm but not super friendly with the current tooling, mod init dropping files everywhere