Repository navigation
shim: unix->tcp API proxy - #3706
Conversation
There was a problem hiding this comment.
Until we build an engine image w/ CNI support all exec ops are in the same network namespace so I think this will create conflicts?
Fortunately it will soon be easy to include CNI support with the engine image!
There was a problem hiding this comment.
Right!
Do I try some random port with retry logic, or leave this feature be?
I'm trying to get python tests running in dagger but apparently there's no easy way for Python to communicate over unix sockets.
Currently for extensions, as far as I can see, it's pythoruntime.go that uses a socat to do the proxying.
There was a problem hiding this comment.
If you listen on localhost:0 a random open port will be chosen for you, which you can then retrieve from the listener object with the right incantation (just learned this earlier today here).
So I think that'd work here; listen on random port, set env var based on that.
If someone is trying to run 10,000 shims on their box I guess port contention could matter, but I look forward to that bug report!
There was a problem hiding this comment.
Will do!
Also -- this is only enabled when using the (semi) internal nesting flag on exec.
Proxy kicks off only if DAGGER_HOST is set
There was a problem hiding this comment.
HTTP works too 👍
I went with TCP early on when it wasn't clear whether I'd need to switch everything to gRPC, but now that it's gRPC-over-HTTP it doesn't really matter. I can just rebase on this. Besides, the TCP connection was just for local testing by hand.
c5d017b to
5025db2
Compare
5025db2 to
3de9364
Compare
Will automatically rewrite a DAGGER_HOST from `unix://` to `http://` This removes the need for SDKs to implement unix socket support. Signed-off-by: Andrea Luzzardi <[email protected]>
Signed-off-by: Andrea Luzzardi <[email protected]>
3de9364 to
bee8660
Compare
Will automatically rewrite a
DAGGER_HOSTfromunix://tohttp://This removes the need for SDKs to implement unix socket support.
/cc @helderco @slumbering @TomChv