Support embedded Runme servers and the connect protocol#767
Support embedded Runme servers and the connect protocol#767jlewi wants to merge 7 commits intorunmedev:mainfrom
Conversation
Signed-off-by: Jeremy Lewi <jeremy@lewi.us>
Signed-off-by: Jeremy Lewi <jeremy@lewi.us>
Signed-off-by: Jeremy Lewi <jeremy@lewi.us>
Signed-off-by: Jeremy Lewi <jeremy@lewi.us>
Signed-off-by: Jeremy Lewi <jeremy@lewi.us>
|
There are some lint failures but I'm going to punt on resolving them until we figure out what to do about this PR. |
That's fair. As long as this isn't blocking you. I have yet to take a closer look and make up my mind on how to support linking. |
🤔 |
|
So originally I needed connectrpc because I want to use the Connect GoLang Server(jlewi/cloud-assistant#4). Which requires generating the connectrpc golang generated libraries. I was then connecting to it using grpc-web as the transport. Originally I was only planning on using server side streaming as that is what is supported. If we are using websockets, then the Runme service no longer needs to be exposed as a GRPC/Connect service in my client in which case generating golang connectrpc clients should no longer be necessary. So we could drop that part. I think I still want to be able to link in Runme to an existing binary which requires finding someway to relax the internal visibility restriction. I'm fine waiting to ensure there is sufficient value in linking in Runme before modifying code on main to support it. I'm fine with closing this PR for now or marking it as draft. |
Aye on both. I'll look into the best way to remove the Moving the PR into draft for now. |
|
One thing I wasn't aware of was the envCollector. runme/internal/command/env_collector.go Line 45 in b6d3c8b It looks like this is always set currently by the CommandFactory runme/internal/command/factory.go Line 301 in b6d3c8b This ends up having Runme invoke itself at the (start? and/or end?) of every command in order to dump/collect the environment runme/internal/cmd/environment.go Line 86 in b6d3c8b So from the perspective of linking in Runme into an existing binary we would potentially need to link in that functionality as well or make it possible to disable it. |
Runme's stateful execution (making the ENV sticky) won't work without the EnvCollector as part of Snapshotting. Don't think you want to disable it. However, it should be easy to replicate the My suggestion would be to only replicate this command and ignore the rest of the |
Note to self: We also need to figure out how to properly deal with it being different subcommands when linking Runme into unrelated binaries. @sourishkrout now that we are using websockets; I don't think we need ExecuteOneshot (#764) . Want me to send you a revert PR? |
No need, thank you. I'll remove it. |
|
I think this is superceded by the branch |
I'd like to be able to link Runme into an existing CLI. This way users don't have to download a new binary in order to be able to run runme as a server; I can just distribute as part of my existing binary server.
The blocker is that most of the Runme libraries are hidden inside the internal package which prevents other packages from importing them as a library.
This creates a thin non-hidden wrapper for the stuff I need. Arguably, refactoring the code out of the internal package is a better solution but that seems like it could be a bit of a lift.
This PR also updates
buf.gen.yamlso we can generate connectrpc golibs. It turns out that trying to link golibraries from the buf registry and simulatenously link Runme as a library leads to name packages.@sourishkrout I'm not really blocked on this because I can just use a rewrite declaration in go.mod to pull in my fork. So no rush.