eigr / massa

A Stateful Serverless framework on the BEAM VM
https://eigr.io
Apache License 2.0
54 stars 5 forks source link

Use our own protobuf contract #116

Open sleipnir opened 2 years ago

sleipnir commented 2 years ago

I would like to have our own protobufs without depending on the Cloudstate protocol, I think certain things will have to evolve without this dependence on Cloudstate. Obviously I appreciate the compatibility with the Cloudstate protocol, after all I invested a lot of time in it. But I think we can guarantee this as a compatibility mode in the proxy, that is, if the client chooses to use the Cloudstate protocol, then the proxy could select the adapter for this protocol but that was not our default mode, opting primarily for our protocol itself instead.

Just for reference as a little has been discussed here https://github.com/eigr/massa/issues/14

marcellanz commented 2 years ago

I agree, it's time. Lets create a repository called functions-protocol, place the CS prptobufs there and sync it with bufs github-action to the buf repository. Buf provides a workflow that wraps protoc, we can use that too.

As soon as we switch, we need at least one of the SDK to be in sync with the protocol, personally I'd go with the Go SDK, but Javascript would also be a good candidate.

marcellanz commented 2 years ago

I've added https://github.com/eigr/eigr-functions-protocol and put inside right the current proto files we have from massa: /eigr/massa/apps/cloudstate_protocol/priv/protos I'll setup a sync to the buf repository now.

@sleipnir we can progress from here, re-org protos if needed, also continue with the original work we've started on the cloudstate project back in the time: https://github.com/cloudstateio/cloudstate/issues/518

Also, we can start to use our very own extension range we've registered earlier Extension: 1110-1114 / https://github.com/protocolbuffers/protobuf/commit/01ac995c942d9b7371ea8f5fa4c6f3eeadd6dcbf

But first, start with what already works for now.

sleipnir commented 2 years ago

Awesome Marcel, for this to work in the Massa project I need the cloudstate protobufs frozen in the version they are today. And then I need to locate them separately from our own protocol, which will probably rename certain things, like cloudstate being replaced by function for example. But we can do this separation by .proto files and create only one buf repository instead of two. I leave that to your decision. In Massa's project I have an app called cloudstate_protocol, my idea is to create another one called functions_protocol to reflect this change in the project, so in Massa's dependencies I would add the two dependencies of both cloudstate and functions