infobloxopen / atlas-gentool Goto Github PK
View Code? Open in Web Editor NEWDocker image to generate the Go source code from Protocol Buffer schemes
License: Apache License 2.0
Docker image to generate the Go source code from Protocol Buffer schemes
License: Apache License 2.0
Looks like we have switched tooling to gateway/v2, my ‘make protobuf’ broke as infoblox/atlas-gentool:latest emits gateway/v2 stubs. I tried to covert my app to use the new app-toolkit, it compiles but takes a run time error:
proto: extension number 1042 is already registered on message google.protobuf.FileOptions
See https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict
I created a new atlas app using:
atlas init-app -gateway -pubsub -health -helm -name cost-insights-backend -registry soheileizadi -kind
I built and ran this app and it gave me the same panic message.
I debugged this problem, Proto ExtensionType being registered that throws error is:
grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger
I removed the following import from my ‘service.pb.go’ auto-generated code:
_ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options"
The init of the library was registering extension that was causing the problem,
with that change I can run my application now. I am logging this with the gentool but might require additional
supporting atlas app toolkit.
Replace dep/glide with go modules and make sure this code generation issue is fixed in
atlas-cli:
https://github.com/infobloxopen/atlas-cli/issues/60#issuecomment-644542690
We need to try to shrink this to as small as possible.
Some systems like the newer MacBooks with M1 chips don't support the current images being pushed to DockerHub, and can't be built locally because of the UPX package not being present on the arm64 alpine image.
PROTOBUF_ARGS += -I=$(GITHUB_PATH)/vendor
/vendor: warning: directory does not exist.
Here is a sample message as seen from client from old tooling:
{"id":"EC2","aggregation":[104732,107374],"entities":{}}
Versus new tooling:
{"type":"","id":"EC2","aggregation":[69393,59305],"entities":{}}
There are many other fields emitted but just focused on the top level type field as a sample
The autogenerated code have the omit-empty option:
type Entity struct {
....
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
....
}
How do I add github.com/lyft/protoc-gen-validate ?
We want our apps to be able to reference the collection operators in their .proto files, so we should include this proto file in our image.
While v21.2 renders validate rules rules, in 21.3 these rules are omitted.
+ // no validation rules for Name
- if utf8.RuneCountInString(m.GetDescription()) > 255 {
- return ProfileLDAPValidationError{
- field: "Description",
- reason: "value length must be at most 255 runes",
- }
- }
Also, lyft has been renamed to envoyproxy, which will also cause go.mod errors if using version > 0.1.0.
allow_repeated_fields_in_body
flag is introduced in version 1.5.0 of grpc-gateway, which is required to have repeated fields in the POST body
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.