Skip to content
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

schemagen: parity between cue and protoc implementations #432

Open
2 tasks
sam-heilbron opened this issue Jul 20, 2021 · 0 comments
Open
2 tasks

schemagen: parity between cue and protoc implementations #432

sam-heilbron opened this issue Jul 20, 2021 · 0 comments

Comments

@sam-heilbron
Copy link
Contributor

sam-heilbron commented Jul 20, 2021

At the moment, solo-kit exposes 2 ways of generating open api schemas from proto definitions. Context around this feature can be found in the PR that introduced it: #421.

We are prevented from using the cue implementation in Gloo Edge, due to the following reason (extracted from #421 PR description):


This is our preferred implementation. It is not used in production yet, due to some performance issues with the Gloo Edge API. However, our goal is to eventually migrate our code to rely on this implemenation. I added in this code in this iteration so that we could compare the generated schemas between the implementations.

cuelang/cue#944 tracks the issue we face when using cuelang with the Gloo Edge API. Specifically, as more oneof's are added to the API, the performance degrades dramatically, to the point where it takes longer than 15 minutes to generate schemas. The authors are aware of this issue and are actively working on improving it. Until it is resolved, we cannot move forward with this implementation.

This is the pattern that skv2 relies on (https://github.com/solo-io/skv2/blob/master/codegen/render/manifests_renderer.go) and is loosely based on an istio tool cue-gen (https://github.com/istio/tools/tree/master/cmd/cue-gen). These API's don't have the same number of oneof's as Gloo Edge and therefore don't face the same performance degredation.


Over time, we have added features to the protoc implementation that are not included in the cue implementation. When we eventually use cue in solo-kit, we need to ensure feature parity. Below is a list of changes we'll need to support in cue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant