-
Notifications
You must be signed in to change notification settings - Fork 42
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
[storage] Makefile improvements #170
base: main
Are you sure you want to change the base?
Conversation
benlwalker
commented
Oct 21, 2022
- Remove all generated code from the storage part of the repo. It's generated, so it does not need to be version controlled.
- Simplify the Makefile by removing docker (protoc is packaged on most distros so it's trivial to install) and adding a convenience function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks. This address #142
But without generated code golang failed for me in opi-spdk-bridge repo…. Do we need somehow to generate the code there ?
also why remove the v1 ? This is proto versioning….
I might need to have it generate code. Where exactly are you seeing an error? When building opi-spdk-bridge? Also I completely wrecked the existing storage github action and it needs to be rewritten another way. I'll work on that. |
Yes, when running go get and go build i see failure.
Sure, go ahead |
We also need to keep either v1 or v1alpha versioning somehow |
I can easily keep the v1 directory, but I did not understand what purpose that served in the repo itself. |
Like this example we have folders every time new api version released https://github.com/tektoncd/pipeline/tree/main/pkg/apis/pipeline At least this is my grpc versioning understanding |
v1 directory serves to version the APIs. Take a look at Uber's Protobuf Style Guide V2 and Google's API directory structure. Versioning and serving the generated artifacts makes it easier for Go developers to get versioned artifacts via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v1 folder and golang generations have to be resolved before merging this
980db82
to
e76d648
Compare
@glimchb After review of golang requirements and practices, I think the best approach is to have a dedicated, separate repository for the go bindings, and then sync to that using a github action from this repository. Are you able to create the go bindings repo? Do we need to discuss this somewhere and get everyone to agree? I can present pros and cons. |
no need to discuss, @benlwalker I agree |
I've reduced this PR just to the makefile cleanups. I'll do a separate PR for deleting the generated code once we have the dedicated repo set up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing google-api-linter
Did we decide to make a new repo to hold the golang bindings? What's the conclusion there? |
924f4db
to
9767546
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks better, thanks @benlwalker
This makes it easier to change in the future Signed-off-by: Ben Walker <[email protected]>
Reduce the repeated code by using a function Signed-off-by: Ben Walker <[email protected]>
Signed-off-by: Ben Walker <[email protected]>
If you want to build just one binding, or just the documentation, etc. now you can. This also makes parallel make work, so the whole thing builds much more quickly. Signed-off-by: Ben Walker <[email protected]>
This is the same as any other generated output. Signed-off-by: Ben Walker <[email protected]>
The same directory was mounted at /protos and /out. Only mount it once. Signed-off-by: Ben Walker <[email protected]>
Signed-off-by: Ben Walker <[email protected]>
This will compile without any docker containers, using a locally installed protoc. BEWARE - every version of protoc generates different output, so don't check in generated output from this option. Signed-off-by: Ben Walker <[email protected]>
Don't lint anything generated Signed-off-by: Ben Walker <[email protected]>
having client bindings in a separate repo would be good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we waiting for GH actions adjustments to this PR yet or can it already be merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a good positive change - only one comment, otherwise looks good to me. If this works for storage, we can adopt the same for networking as well.
rm -rf ./v1alpha1/{autogen.md,gen,google} | ||
mkdir -p ./v1alpha1/gen/{go,cpp,python,java} | ||
CURRENT_VERSION := v1alpha1 | ||
COMMON_VERSION := v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to call it v1
as yet?
We have transitioned to using "buf" for generation of the protobuf bindings which are included in the makefiles. The plan is to move the bindings to a separate repo which is still being worked. Versioning of the various APIs needs to also be addressed in the current changes. The changes here need to be reviewed/updated for inclusion as needed as some of the changes are valuable. |