premAI-io / Ayup

Quickly and securely turn any Linux box into a build and deployment assistant
https://premai.io?utm_source=ayup
Apache License 2.0
26 stars 5 forks source link

Assistant-user communication #45

Open richiejp opened 1 week ago

richiejp commented 1 week ago

We need a way for external assistants (#38 #19) to communicate with the user through a socket we expose to the assistants container. We could use gRPC which the CLI and server use to communicate, but it's kind of a heavyweight solution. Not all languages have an implementation and it's not easy to implement. Using Protocol Buffers on their own is another option, but still has the same issues as gRPC.

Ideally the protocol should:

The first thing to come to my mind is Reddis RESP. It may even be possible to use existing client libraries although it may be better not to judging from some of the experiences I've had with Reddis clients xD

sarrubia commented 1 week ago

Hi, maybe this can help (or not :P ), someones that come to my mind are options like:

Or building something to send and receive AVRO files/frames

Apache Avro™ is the leading serialization format for record data, and first choice for streaming data pipelines. It offers excellent schema evolution, and has implementations for the JVM (Java, Kotlin, Scala, …), Python, C/C++/C#, PHP, Ruby, Rust, JavaScript, and even Perl.
richiejp commented 1 week ago

Nice, although my first reaction is that they are too complicated. Some combination of these could have been a nice alternative to gRPC + libp2p which is what is being used for CLI to server communication.

Maybe AVRO could be used in this case, but my initial impression is that because it has a schema that's used during decoding, it's going to be more complicated than RESP. I'll have to take a closer look though.