Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

[RFC ]Initial gRPC protocol for agent communication #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions hack/update-generated-agent-proto.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Copyright 2017 HyperHQ Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
protoc --proto_path=pkg/agent/api/grpc --go_out=plugins=grpc:pkg/agent/api/grpc pkg/agent/api/grpc/hyperstart.proto pkg/agent/api/grpc/oci.proto
Copy link

Choose a reason for hiding this comment

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

I believe you also want to add a -I=$GOPATH/src/github.com/google/protobuf/src/ to this command. Without it, protoc seems to be unable to find the Empty message:

$ hack/update-generated-agent-proto.sh 
google/protobuf/empty.proto: File not found.
hyperstart.proto: Import "google/protobuf/empty.proto" was not found or had errors.
hyperstart.proto:15:62: "google.protobuf.Empty" is not defined.
hyperstart.proto:16:60: "google.protobuf.Empty" is not defined.
hyperstart.proto:17:54: "google.protobuf.Empty" is not defined.
hyperstart.proto:18:58: "google.protobuf.Empty" is not defined.
hyperstart.proto:25:52: "google.protobuf.Empty" is not defined.
hyperstart.proto:26:56: "google.protobuf.Empty" is not defined.
hyperstart.proto:29:56: "google.protobuf.Empty" is not defined.
hyperstart.proto:30:60: "google.protobuf.Empty" is not defined.
hyperstart.proto:31:62: "google.protobuf.Empty" is not defined.
hyperstart.proto:32:48: "google.protobuf.Empty" is not defined.
hyperstart.proto:33:56: "google.protobuf.Empty" is not defined.

Am I missing something ?

Copy link
Member Author

Choose a reason for hiding this comment

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

➜  runtimes git:(grpc_proto) protoc --version
libprotoc 3.5.0
➜  runtimes git:(grpc_proto) hack/update-generated-agent-proto.sh
➜  runtimes git:(grpc_proto)

Works on my Mac.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sameo Ah I know why you got the Empty errors.

My protoc is built from source and installed together with the include files.

If you download the prebuilt protoc, and only put the bin/protoc binary in your $PATH without install the include/ dir, you will get the import error.

However, I have not generated the code with the getters in the diff yet.

Copy link

@sameo sameo Nov 22, 2017

Choose a reason for hiding this comment

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

@gnawux I installed protoc from my distro protobuf packages (FC27, protobuf and protobuf-compiler)

$ rpm -q protobuf-compiler
protobuf-compiler-3.3.1-2.fc27.x86_644

Copy link
Member Author

Choose a reason for hiding this comment

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

@sameo Then does it have an -devel or -dev like package?

And we need figure out why they generate different code.

Copy link
Member Author

Choose a reason for hiding this comment

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

finally I solved the getter issue. I found an older protoc-gen-go in a higher priority position in my $PATH

Loading