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

[storage] Makefile improvements #170

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

benlwalker
Copy link

  • 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.

@benlwalker benlwalker requested a review from a team as a code owner October 21, 2022 20:36
Copy link
Member

@glimchb glimchb left a 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….

@benlwalker
Copy link
Author

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.

@glimchb
Copy link
Member

glimchb commented Oct 21, 2022

I might need to have it generate code. Where exactly are you seeing an error? When building opi-spdk-bridge?

Yes, when running go get and go build i see failure.

Also I completely wrecked the existing storage github action and it needs to be rewritten another way. I'll work on that.

Sure, go ahead

@glimchb
Copy link
Member

glimchb commented Oct 21, 2022

We also need to keep either v1 or v1alpha versioning somehow

@benlwalker
Copy link
Author

I can easily keep the v1 directory, but I did not understand what purpose that served in the repo itself.

@glimchb
Copy link
Member

glimchb commented Oct 21, 2022

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

@glimchb glimchb added the Storage APIs or code related to storage area label Oct 21, 2022
@PWAlessi
Copy link
Contributor

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 go get. It's like publishing jars to artifactory.

Copy link
Member

@glimchb glimchb left a 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

@benlwalker
Copy link
Author

@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.

@glimchb
Copy link
Member

glimchb commented Oct 26, 2022

no need to discuss, @benlwalker I agree
The committed generated proto files with sources in the same repo was a temp hack until we ramp up

@benlwalker
Copy link
Author

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.

Copy link
Member

@glimchb glimchb left a 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

@benlwalker
Copy link
Author

Did we decide to make a new repo to hold the golang bindings? What's the conclusion there?

@benlwalker benlwalker force-pushed the storage branch 4 times, most recently from 924f4db to 9767546 Compare November 8, 2022 20:41
@glimchb glimchb self-requested a review November 9, 2022 02:16
Copy link
Member

@glimchb glimchb left a 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]>
Ben Walker added 8 commits November 9, 2022 10:48
Reduce the repeated code by using a function

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]>
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]>
@jainvipin
Copy link
Contributor

@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.

having client bindings in a separate repo would be good.

Copy link
Contributor

@jainvipin jainvipin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@intelfisz intelfisz left a 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?

Copy link
Contributor

@jainvipin jainvipin left a 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
Copy link
Contributor

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?

@sandersms
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage APIs or code related to storage area
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants