Cluster plugins should provide a standard service interface for plugin lifecycle operations with grpc streaming responses for structured messages that relay asynchronous status as well as stdio/stderr packets.
Rationale
The current plugin model is simple and straightforward; plugins accept commands, arguments, and options, and stream responses over stdio and stderr. However, this requires extra code on the client for packaging up data to send to the plugin and command line parsing support in each plugin; for returning data, a structured message format is needed to interleave status messages into the stdout/stderr streams, and manual JSON marshaling/unmarshaling (and currently, this is not consistently applied, leading to parse errors on the client).
It is straightforward and more robust to define a standard message format for requests and streaming responses to handle these needs.
The client should be able to start a plugin on an available ephemeral port for the entirety of a cluster managment operation and this should be transparent to the user.
Proposal
Cluster plugins should provide a standard service interface for plugin lifecycle operations with grpc streaming responses for structured messages that relay asynchronous status as well as stdio/stderr packets.
Rationale
The current plugin model is simple and straightforward; plugins accept commands, arguments, and options, and stream responses over stdio and stderr. However, this requires extra code on the client for packaging up data to send to the plugin and command line parsing support in each plugin; for returning data, a structured message format is needed to interleave status messages into the stdout/stderr streams, and manual JSON marshaling/unmarshaling (and currently, this is not consistently applied, leading to parse errors on the client).
It is straightforward and more robust to define a standard message format for requests and streaming responses to handle these needs.
The client should be able to start a plugin on an available ephemeral port for the entirety of a cluster managment operation and this should be transparent to the user.
References
https://grpc.io/docs/guides/concepts.html#server-streaming-rpc https://grpc.io/docs/tutorials/basic/go.html#server-side-streaming-rpc https://grpc.io/docs/tutorials/basic/go.html#server-side-streaming-rpc-1