New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support generating protobuf & grpc service defs from argo packges #853
Comments
Another issue related to this, proteus and go-to-protobuf doesn’t seem to know how to generate proto import statements. This is part of why running proteus with |
@gaigepr -- I created a branch which changes the definition of the Workflow Item such that it is no longer an interface{}. The change is here: https://github.com/jessesuen/argo/tree/protobuf You can give that a try to see if it helps. |
@jessesuen -- Here are some notes on my attempts: I cloned your fork and checked out the
Interestingly, if I do the following, I get proto generated but of course since it is generated from
I am not really sure why |
Another experiment this time using
|
Another go
Here are the changes made to the Gopkg.toml
Now, lets try generating stuff again! I have made sure protoc, protoc-gen-go, et al. are updated.
It seems to exit as normal because of some undefined proto messages... But look!
So let's look at what changed.
So that is interesting, it annotated our go structs! Now lets look at those other files that are new.
|
So, partial progress but the bash script doesn't run to completion so I cannot attest to the quality of the proto. |
Another experiment. This one removes references to grpc-gateway from the
YAHOO! The script runs to completion and does not complain about anything being undefined. |
Is this a BUG REPORT or FEATURE REQUEST?:
This is a FEATURE REQUEST. At present, I can successfully use proteus to generate a
.proto
fromargoproj/argo/pkg/apis/workflow/v1alpha1
but there are a few problems left to solve.The various
k8s.io
packages that argo imports must also have.proto
files generated if the.proto
generated for argo itself is going to be a complete representation of the go definitions. This has not worked so far in my experiments. Oftenproteus
segfaults when trying to run onk8s.io
packages and other times it generates mostly empty.proto
files.You can try too:
Take a look inside
/home/user/go/src/github.com/argoproj/argo/proto
for what it outputs, if it even runs...Here is what I have been doing to generate
.proto
from argo'sworkflow
package.This produces a
.proto
file under./proto/github.com/argoproj/argo/pkg/apis/workflow/v1alpha1/generated.proto
which is great!It also generates a
pkg/apis/workflow/v1alpha1/generated.pb.go
.However, there are a few problems. Not all the
message
s have all their fields. For example,v1alpha1.Item
is defined as follows:But the resulting message lacks any fields... This has to do with an incompatibility between go's
interface{}
type and protoc (including gogo/protoc). One solution might be to use theAny
proto type from google. See this stackoverflow thread.How to reproduce it (as minimally and precisely as possible):
./proto
For what its worth, I also tried using go-to-protobuf and had essentially 0 success.
Environment:
The text was updated successfully, but these errors were encountered: