-
Notifications
You must be signed in to change notification settings - Fork 376
Version the CSI protobuf #74
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
Version the CSI protobuf #74
Conversation
Hi @jdef, You were invited but unable to join the call with @saad-ali, @jieyu, and myself yesterday. There is a plan to handle your concerns, and in fact I even mentioned your specific concern in our group chat in Slack a few hours back: @jieyu summarized yesterday's meeting in this comment, but it looks like you were not tagged. I hope this helps assuage any concerns you may have. |
@akutz thanks for the summary. Looking forward to the PR that adds back .proto validation. If it doesn't happen over the next couple of days then I'd like to track the need via an issue. |
That's fine. The lost capability that I'm looking to get back is validation
of the syntax of the .proto file, which we'll gain as soon as *any*
bindings are generated in CI from the .proto file
…On Thu, Aug 10, 2017 at 4:52 PM, Schley Andrew Kutz < ***@***.***> wrote:
Hi @jdef <https://github.com/jdef>,
To be clear, it won't be validation but Go language binding generation.
The validation @jieyu <https://github.com/jieyu>, @saad-ali
<https://github.com/saad-ali>, and I discussed includes using a
bare-minimum Cxx and Go client to replicate the understood workflows
against a mock plug-in, similar to CNI's methodology.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#74 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACPVLHfDSxvtb_TTV2vZxFrZDgrjuOduks5sW22dgaJpZM4Oz0dV>
.
|
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.
Can you update CONTRIBUTING.md about the flow of updating protobuf in the spec:
- update the protobuf in spec.md
- run
make
locally - commit the change and send a PR.
Makefile
Outdated
|
||
build: $(CSI_PROTO) $(CSI_GOSRC) | ||
# the target for building the temporary csi protobuf file. |
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.
nits: Can you use full sentences for the comment. In other word, Capitalize the first word of a sentence and uses a period in the end. Ditto everywhere else in this file.
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.
Hi @jieyu,
As I was the first to create comments in the Makefiles for this project, is this your personal preference or part of the project's style guidelines? What you see is my preference, but I will change it in accordance with a posted style manual. Thanks!
README.md
Outdated
| `CSI_PROTO_DIR` | The path of the directory in which the protobuf and Go source files will be generated. If this directory does not exist it will be created. | `.` | | ||
| `CSI_PROTO_ADD` | A list of additional protobuf files used when building the Go source file | | | ||
| `CSI_IMPORT_PATH` | The package of the generated Go source | `csi` | | ||
This project contains the CSI [specification](spec.md) and |
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.
Please follow the markdown style guid here:
https://github.com/container-storage-interface/spec/blob/master/CONTRIBUTING.md#markdown-style
One sentence per line.
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.
Hi @jieyu,
It is a single sentence. Do you mean I should not hard-wrap it? Sure, if that's this project's style. I prefer hard-wrapping for the sake of readability, but I will gladly adhere to the project's style guidelines.
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.
I mean this is a single sentence, you should not wrap it. see the rationale here:
https://github.com/container-storage-interface/spec/blob/master/CONTRIBUTING.md#markdown-style
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.
Fixed.
Makefile
Outdated
|
||
clean: | ||
rm -f $(CSI_PROTO) $(CSI_GOSRC) | ||
rm -f $(CSI_PROTO) |
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.
Remove the tmp file as well?
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.
Hi @jieyu,
Good catch.
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.
Fixed.
.travis.yml
Outdated
- printf "%s" "$GITHUB_API_TOKEN" > "${HOME}/.gist" | ||
- gist -d "https://travis-ci.org/container-storage-interface/spec/jobs/${TRAVIS_BUILD_ID}" *.{proto,go} | ||
# run make | ||
script: make |
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.
For travis CI for now (until we have validation tooling checked in), can we try to call protoc to generate the go file to capture any protobuf syntax errors?
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.
Hi @jieyu,
That's not necessary. The other PR is almost on deck.
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.
ok, but I do want to merge this first. The other might take a while to review. Sounds like not too much work here. Just call protoc in travis yaml?
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.
Hi @jieyu,
You can then review them in tandem if you wish or I'll put them into the same PR. Your call. I don't want to reintroduce a lot of what I already pulled out.
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.
Sounds good. Let's pull the other one into the same PR.
Hi @jdef, FWIW it's already in progress with successful, forked builds. But the second PR will be dependent upon this PR. I will rebase the latter once this one is accepted. |
72ab19f
to
459e38f
Compare
a98cf4a
to
d9cd7d3
Compare
lib/go/Makefile
Outdated
ifeq (,$(strip $(GOPATH))) | ||
GOPATH := $(HOME)/go | ||
else | ||
# If GOPATH is arleady set then update GOPATH to be its own |
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.
s/arleady/already/
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.
Fixed
d9cd7d3
to
81353a7
Compare
Hi @jieyu, Would you please mark this as approved? I've address all your suggested changes/fixes. |
865871b
to
79c961f
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.
Can you split this big patch into logically separate pieces. For instance, adding guideline for commit style should be in its own commit. See why we need to do this in the link below (probably add this to CONTRIBUTING.md as well).
https://kernelnewbies.org/PatchPhilosophy
You can separate this patch into the following logic changes:
- Remove tailing white spaces in the spec
- Adding guideline for commit message
- Build system refactor
protoc.mk
Outdated
PROTOC_ARCH := x86_32 | ||
endif | ||
|
||
PROTOC := ./protoc |
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.
I don't like the way we build protoc all the time. For C++ projects like Mesos/grpc, it might already bundle protoc and probably do not want to build protoc again. I'd suggest we allow downstream project to pass in a path to protoc (pre-existed at some location).
If you do need a *.mk
file for modularization, please put that under build/make
subdirectory. I might be interested in adding CMake support under build/cmake
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.
Hi @jieyu,
I do like it. It ensures a specific version.
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.
I only made proto.mk
external from the Go process in the case that you might want to re-use it. If that's not the case I'll move it into lib/go/Makefile
directly. Thank you for the feedback.
protoc.mk
Outdated
PROTOC_OS := osx | ||
endif | ||
|
||
PROTOC_ARCH := $(shell uname -m) |
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.
Instead of that, let's allow users to pass in the value directory. uname
does not work on windows.
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.
Hi @jieyu,
CSI does not support Windows today, so it is irrelevant.
Makefile
Outdated
diff "$@" "$?" | ||
else | ||
diff "$@" "$?" > /dev/null 2>&1 || cp -f "$?" "$@" | ||
.PHONY: $(CSI_PROTO).tmp |
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.
Can you explain why this is a PHONY target?
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.
Hi @jieyu,
Because it ensures that a local, stale temp file won't cause the protobuf from not being rebuilt. We discussed this yesterday on Slack.
|
||
# If this is not running on Travis-CI then for sake of convenience | ||
# go ahead and update the language bindings as well. | ||
ifneq (true,$(TRAVIS)) |
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.
Why not build library as well in CI? We need to capture library build error on CI as well, right?
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.
Hi @jieyu,
Because I don't want the default target in the root Makefile to do recursive Make.
lib/go/Makefile
Outdated
go get $(@:$(GOPATH)/src/%=%) | ||
|
||
PROTOC_GO := $(PROTOC_GO_PKGS) $(PROTOC_GEN_GO) | ||
protoc-go: $(PROTOC_GO) |
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 PHONY target?
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.
Hi @jieyu,
Yes and no. It's an alias.
lib/go/Makefile
Outdated
ifeq (true,$(TRAVIS)) | ||
diff "$@" "$?" | ||
else | ||
diff "$@" "$?" > /dev/null 2>&1 || cp -f "$?" "$@" |
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.
So this output will depends on the version of protoc as well as the plugins i think? I am not sure if there will be any compatibility issue or not. For instance, what if a downstream wants to use a specific version of protoc because of some other dependencies?
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.
Hi @jieyu,
Then they can use that version. Please note that the version variable allows itself to be specified externally.
PROTOC_VER ?= 3.3.0
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.
As for the plug-ins, I'm thinking I will vendor the Go pkg dependencies in lib/go
and build the plug-in out of that to ensure a specific version. I'll use Glide to record to actual dependency manifest. Good call.
lib/go/Makefile
Outdated
go clean -i -v | ||
|
||
clobber: | ||
rm -f $(CSI_GO) $(CSI_GO_TMP) |
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.
rm .build
directory as well?
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.
Hi @jieyu,
That's a good catch, thanks.
@akutz The merge was meant for the makefile refactor. Merging top level makefile change with golang binding changes. I am fine with that. But the commit style change and whitespace fix should be in separate commits. |
Guys, I am not going to spend time breaking this back up. Please feel free to do so. I wouldn't have even touched the spec.md file if not for adding two lines to the spec in order to specify the package. I did this because @jieyu did the same in a now-closed PR. I thought it was a good idea. I cannot edit that file without it updating the WS. As I pointed out in Slack. We had a whole conversation. I even cleared this with @jdef and @saad-ali. @jdef, please feel free to add that text via your editor and I'll reset my copy of spec.md. Just... sigh Yeah. :) |
And @jieyu, the merge was meant for a use case, not a single file refactor. I get that you're being careful with the repo, but please don't forget there is a purpose to provide a feature/use case here, not simply the refactor of a single file. |
@akutz at the very least, the style guide change should be a separate commit. Make sense? |
79c961f
to
8b58152
Compare
@jieyu, why? What purpose does that serve? The update to the contribution file regarding proper procedure for updating the spec is irrelevant without the rest of the changes. Commits should be atomic features, and the remark in the contribution doc is pointless on its own. |
Hi @jieyu, Also, you keep referring to |
Hi @jdef, Could you please file a PR where you add the following to
It's around line 212. That way I can reset |
… On Fri, Aug 11, 2017 at 2:58 PM, Schley Andrew Kutz < ***@***.***> wrote:
Hi @jdef <https://github.com/jdef>,
Could you please file a PR where you add the following to spec.md?
Container Storage Interface
This section describes the interface between COs and Plugins.
syntax = "proto3";package csi;
It's around line 212. That way I can reset spec.md in this PR once I
rebase off of your merged commit. It will remove all the whitespace
changes. Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#74 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACPVLEOUwYA2Do7n333sQ9PUDbHGs3Eaks5sXKRLgaJpZM4Oz0dV>
.
|
We need to ensure that this community is fosters an environment of collaboration while maintaining a high quality bar. I know we all have good intentions, and we'll sort this out. To that end, I sent out an invite for a meeting @ 1:30 PM PT today to see if we can resolve the open questions around this PR. Message me on slack (saad-ali) if you want an invite. |
Hi @jdef, It is going to, and is, fail(ing) because the existing build process places that text at the top of the file. You'd have to modify the existing code generation process. |
thanks @akutz, fixed |
8b58152
to
f636064
Compare
We had a productive meeting. Follow up items we agreed on:
|
Hi @saad-ali, One slight change - I'm sticking with In other words -- supporting Windows is more than just replacing the use of the |
|
Hi @jieyu, Thank you for your suggestion, but I'm going to leave it as is. FWIW, I had actually made the change to |
861bdb8
to
6f1ce3a
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.
LGTM! Thanks @akutz !
Makefile
Outdated
diff "$@" "$?" | ||
else | ||
diff "$@" "$?" > /dev/null 2>&1 || cp -f "$?" "$@" | ||
.PHONY: $(CSI_PROTO).tmp |
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.
Can you remove the PHONY target here for now as we discussed offline?
This patch versions the generated CSI protobuf and provides a Travis-CI build step that verifies the protobuf is up-to-date before allowing any changes to be merged. Additionally this patch also adds minimal Go language bindings in order to verify the specification. Finally, scaffolding was put into place in order to support Cxx language bindings in the future as well.
6f1ce3a
to
15419ea
Compare
This patch versions the generated CSI protobuf and provides a Travis-CI build step that verifies the protobuf is up-to-date before allowing any changes to be merged.
Additionally this patch also adds minimal Go language bindings in order to verify the specification. Finally, scaffolding was put into place in order to support Cxx language bindings in the future as well.