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

Migrade from github.com/golang/protobuf to google.golang.org/protobuf #2644

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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Table of Contents
* [make gen-embedded-openapi](#make-gen-embedded-openapi)
* [make gen-crd-client](#make-gen-crd-client)
* [make gen-sdk-grpc](#make-gen-sdk-grpc)
* [make gen-allocation-grpc](#make-gen-allocation-grpc)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

make gen-allocation-grpc is defined in Makefile, but this was not described in build/README.md

* [Build Image Targets](#build-image-targets)
* [make clean-config](#make-clean-config)
* [make clean-build-image](#make-clean-build-image)
Expand Down Expand Up @@ -634,6 +635,9 @@ Generate the Custom Resource Definition client(s)
#### `make gen-sdk-grpc`
Generate the SDK gRPC server and client code

#### `make gen-allocation-grpc`
Generate the allocator gRPC code

### Build Image Targets

Targets for building the build image
Expand Down
41 changes: 27 additions & 14 deletions build/build-allocation-images/go/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,48 @@

set -ex
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aligned to build/build-sdk-images/go/gen.sh


header() {
cat /go/src/agones.dev/agones/build/boilerplate.go.txt "$1" | sponge "$1"
}

export GO111MODULE=on

mkdir -p /go/src/
cp -r /go/src/agones.dev/agones/vendor/* /go/src/

cd /go/src/agones.dev/agones
go install -mod=vendor github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go install -mod=vendor github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go install -mod=vendor github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
go install -mod=vendor github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2

outputpath=pkg/allocation/go
protopath=proto/allocation
googleapis=/go/src/agones.dev/agones/proto/googleapis
gatewaygrpc=/go/src/agones.dev/agones/proto/grpc-gateway
protofile=${protopath}/allocation.proto

rm ./${outputpath}/allocation.pb.go || true
rm ./${outputpath}/allocation.gw.pb.go || true
rm ./${outputpath}/allocation_grpc.pb.go || true

# generate the go code
protoc -I ${googleapis} -I ${gatewaygrpc} -I . -I ./vendor ${protofile} --go_out=proto --go-grpc_opt=require_unimplemented_servers=false --go-grpc_out=proto

# generate grpc gateway
protoc -I ${googleapis} -I ${gatewaygrpc} -I . -I ./vendor ${protofile} --go_out=proto --grpc-gateway_out=logtostderr=true:proto

# generate openapi v2
protoc -I ${googleapis} -I ${gatewaygrpc} -I . -I ./vendor ${protofile} --openapiv2_opt=logtostderr=true,simple_operation_ids=true,disable_default_errors=true --openapiv2_out=logtostderr=true:.

protoc -I ${googleapis} -I . -I ./vendor ${protofile} --go_out=plugins=grpc:.
protoc -I ${googleapis} -I . -I ./vendor ${protofile} --grpc-gateway_out=logtostderr=true:.
protoc -I ${googleapis} -I . -I ./vendor ${protofile} --swagger_out=logtostderr=true:.
jq 'del(.schemes[] | select(. == "http"))' ./${protopath}/allocation.swagger.json > ./${outputpath}/allocation.swagger.json

cat ./build/boilerplate.go.txt ./${protopath}/allocation.pb.go >> ./allocation.pb.go
cat ./build/boilerplate.go.txt ./${protopath}/allocation.pb.gw.go >> ./allocation.pb.gw.go
rm ${protopath}/allocation.swagger.json

goimports -w ./allocation.pb.go
goimports -w ./allocation.pb.gw.go
header ${protopath}/allocation.pb.go
header ${protopath}/allocation.pb.gw.go
header ${protopath}/allocation_grpc.pb.go

mv ./allocation.pb.go ./${outputpath}/allocation.pb.go
mv ./allocation.pb.gw.go ./${outputpath}/allocation.gw.pb.go
mv ${protopath}/allocation.pb.go ${outputpath}/allocation.pb.go
mv ${protopath}/allocation.pb.gw.go ${outputpath}/allocation.pb.gw.go
mv ${protopath}/allocation_grpc.pb.go ${outputpath}/allocation_grpc.pb.go

rm ./${protopath}/allocation.pb.go
rm ./${protopath}/allocation.pb.gw.go
rm ./${protopath}/allocation.swagger.json
goimports -w ./${outputpath}
13 changes: 11 additions & 2 deletions build/build-sdk-images/cpp/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,23 @@ header() {

sdk=/go/src/agones.dev/agones/proto/sdk
googleapis=/go/src/agones.dev/agones/proto/googleapis
gatewaygrpc=/go/src/agones.dev/agones/proto/grpc-gateway
protoc_intermediate=/go/src/agones.dev/agones/sdks/cpp/.generated
protoc_destination=/go/src/agones.dev/agones/sdks/cpp

mkdir -p ${protoc_intermediate}
mkdir -p ${protoc_destination}/src/agones
mkdir -p ${protoc_destination}/src/google
mkdir -p ${protoc_destination}/src/protoc-gen-openapiv2
mkdir -p ${protoc_destination}/include/agones
mkdir -p ${protoc_destination}/include/google/api
mkdir -p ${protoc_destination}/include/protoc-gen-openapiv2/options

cd /go/src/agones.dev/agones/sdks/cpp
find -name '*.pb.*' -delete
cd /go/src/agones.dev/agones
protoc -I ${googleapis} -I ${sdk} --grpc_out=${protoc_intermediate} --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` sdk.proto
protoc -I ${googleapis} -I ${sdk} --cpp_out=dllexport_decl=AGONES_EXPORT:${protoc_intermediate} sdk.proto ${googleapis}/google/api/annotations.proto ${googleapis}/google/api/http.proto
protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk} --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` --grpc_out=${protoc_intermediate} sdk.proto
protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk} --cpp_out=dllexport_decl=AGONES_EXPORT:${protoc_intermediate} sdk.proto ${googleapis}/google/api/annotations.proto ${googleapis}/google/api/http.proto ${gatewaygrpc}/protoc-gen-openapiv2/options/annotations.proto ${gatewaygrpc}/protoc-gen-openapiv2/options/openapiv2.proto
Comment on lines +40 to +41
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unified order of -I


cd ${protoc_intermediate}
header sdk.grpc.pb.cc ${protoc_destination}/src/agones
Expand All @@ -49,4 +52,10 @@ header http.pb.cc ${protoc_destination}/src/google
header annotations.pb.h ${protoc_destination}/include/google/api
header http.pb.h ${protoc_destination}/include/google/api

cd ${protoc_intermediate}/protoc-gen-openapiv2/options
header annotations.pb.cc ${protoc_destination}/src/protoc-gen-openapiv2
header openapiv2.pb.cc ${protoc_destination}/src/protoc-gen-openapiv2
header annotations.pb.h ${protoc_destination}/include/protoc-gen-openapiv2/options
header openapiv2.pb.h ${protoc_destination}/include/protoc-gen-openapiv2/options

rm -r ${protoc_intermediate}
51 changes: 45 additions & 6 deletions build/build-sdk-images/csharp/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,52 @@

set -ex

header() {
cat /go/src/agones.dev/agones/build/boilerplate.go.txt "$1" | sponge "$1"
}

sdk=/go/src/agones.dev/agones/proto/sdk
googleapis=/go/src/agones.dev/agones/proto/googleapis
protoc_intermediate=/go/src/agones.dev/agones/sdks/csharp/proto
protoc_destination=/go/src/agones.dev/agones/sdks/csharp/sdk/generated

# Generate C# proto file `Sdk.cs`
protoc --csharp_out=${protoc_destination} -I ${sdk} -I ${googleapis} --plugin=protoc-gen-grpc=`which grpc_csharp_plugin` sdk.proto
protoc --csharp_out=${protoc_destination} -I ${sdk}/alpha -I ${googleapis} --plugin=protoc-gen-grpc=`which grpc_csharp_plugin` alpha.proto
# Generate proto stub?
protoc --grpc_out=${protoc_destination} -I ${sdk} -I ${googleapis} --plugin=protoc-gen-grpc=`which grpc_csharp_plugin` sdk.proto
protoc --grpc_out=${protoc_destination} -I ${sdk}/alpha -I ${googleapis} --plugin=protoc-gen-grpc=`which grpc_csharp_plugin` alpha.proto
# Create temporary proto files
mkdir -p ${protoc_intermediate}
cp -r ${sdk} ${protoc_intermediate}

# Remove protoc-gen-openapiv2 definitions because C# package doesn't support grpc-gateway
sed -i -e 's/import "protoc-gen-openapiv2\/options\/annotations.proto";//' ${protoc_intermediate}/sdk/sdk.proto
sed -i -e 's/option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {//' ${protoc_intermediate}/sdk/sdk.proto
sed -i -e 's/info: {//' ${protoc_intermediate}/sdk/sdk.proto
sed -i -e 's/title: "sdk.proto";//' ${protoc_intermediate}/sdk/sdk.proto
sed -i -z 's/version: "version not set";\n };//' ${protoc_intermediate}/sdk/sdk.proto
sed -i -e 's/schemes: HTTP;//' ${protoc_intermediate}/sdk/sdk.proto
sed -i -e 's/consumes: "application\/json";//' ${protoc_intermediate}/sdk/sdk.proto
sed -i -z 's/produces: "application\/json";\n};//' ${protoc_intermediate}/sdk/sdk.proto
sed -i -e 's/bool disabled = 1.*/bool disabled = 1;/' ${protoc_intermediate}/sdk/sdk.proto

sed -i -e 's/import "protoc-gen-openapiv2\/options\/annotations.proto";//' ${protoc_intermediate}/sdk/alpha/alpha.proto
sed -i -e 's/option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {//' ${protoc_intermediate}/sdk/alpha/alpha.proto
sed -i -e 's/info: {//' ${protoc_intermediate}/sdk/alpha/alpha.proto
sed -i -e 's/title: "alpha.proto";//' ${protoc_intermediate}/sdk/alpha/alpha.proto
sed -i -z 's/version: "version not set";\n };//' ${protoc_intermediate}/sdk/alpha/alpha.proto
sed -i -e 's/schemes: HTTP;//' ${protoc_intermediate}/sdk/alpha/alpha.proto
sed -i -e 's/consumes: "application\/json";//' ${protoc_intermediate}/sdk/alpha/alpha.proto
sed -i -z 's/produces: "application\/json";\n};//' ${protoc_intermediate}/sdk/alpha/alpha.proto
sed -i -e 's/bool bool = 1.*/bool bool = 1;/' ${protoc_intermediate}/sdk/alpha/alpha.proto
Comment on lines +32 to +51
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is workaround. Remove protoc-gen-openapiv2 definitions from C# sdk image because C# package doesn't support grpc-gateway


# Generate C# proto file like `Sdk.cs`
protoc -I ${googleapis} -I ${protoc_intermediate}/sdk --plugin=protoc-gen-grpc=`which grpc_csharp_plugin` --csharp_out=${protoc_destination} ${protoc_intermediate}/sdk/sdk.proto
protoc -I ${googleapis} -I ${protoc_intermediate}/sdk/alpha --plugin=protoc-gen-grpc=`which grpc_csharp_plugin` --csharp_out=${protoc_destination} ${protoc_intermediate}/sdk/alpha/alpha.proto

# Generate grpc file like `SdkGrpc.cs`
protoc -I ${googleapis} -I ${protoc_intermediate}/sdk --plugin=protoc-gen-grpc=`which grpc_csharp_plugin` --grpc_out=${protoc_destination} ${protoc_intermediate}/sdk/sdk.proto
protoc -I ${googleapis} -I ${protoc_intermediate}/sdk/alpha --plugin=protoc-gen-grpc=`which grpc_csharp_plugin` --grpc_out=${protoc_destination} ${protoc_intermediate}/sdk/alpha/alpha.proto

cd ${protoc_destination}
header Alpha.cs
header AlphaGrpc.cs
header Sdk.cs
header SdkGrpc.cs

rm -rf ${protoc_intermediate}
6 changes: 3 additions & 3 deletions build/build-sdk-images/go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ RUN wget -q https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \

ENV PATH /usr/local/go/bin:/go/bin:$PATH

# install go-proto-gen 1.1
RUN go get github.com/golang/protobuf/protoc-gen-go@v1.2.0 && \
# install protoc-gen-go
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 && \
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 && \
go get -u golang.org/x/tools/cmd/goimports


# code generation scripts
COPY *.sh /root/
Expand Down
39 changes: 24 additions & 15 deletions build/build-sdk-images/go/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,52 @@ header() {

sdk=/go/src/agones.dev/agones/proto/sdk
googleapis=/go/src/agones.dev/agones/proto/googleapis
gatewaygrpc=/go/src/agones.dev/agones/proto/grpc-gateway

export GO111MODULE=on

mkdir -p /go/src/
cp -r /go/src/agones.dev/agones/vendor/* /go/src/

cd /go/src/agones.dev/agones
go install -mod=vendor github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go install -mod=vendor github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go install -mod=vendor github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
go install -mod=vendor github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2

mkdir -p ./pkg/sdk/{alpha,beta} || true

rm ./pkg/sdk/beta/beta.pb.go || true
rm ./pkg/sdk/alpha/alpha.pb.go || true
rm ./pkg/sdk/beta/beta_grpc.pb.go || true
rm ./pkg/sdk/alpha/alpha_grpc.pb.go || true
rm ./pkg/sdk/beta/beta.pb.gw.go || true
rm ./pkg/sdk/alpha/alpha.pb.gw.go || true

# generate the go code for each feature stage
protoc -I ${googleapis} -I ${sdk} sdk.proto --go_out=plugins=grpc:pkg/sdk
protoc -I ${googleapis} -I ${sdk}/alpha alpha.proto --go_out=plugins=grpc:pkg/sdk/alpha
protoc -I ${googleapis} -I ${sdk}/beta beta.proto --go_out=plugins=grpc:pkg/sdk/beta
protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk} sdk.proto --go_out=pkg --go-grpc_opt=require_unimplemented_servers=false --go-grpc_out=pkg
protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk}/alpha alpha.proto --go_out=pkg/sdk --go-grpc_opt=require_unimplemented_servers=false --go-grpc_out=pkg/sdk
protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk}/beta beta.proto --go_out=pkg/sdk --go-grpc_opt=require_unimplemented_servers=false --go-grpc_out=pkg/sdk

# generate grpc gateway
protoc -I ${googleapis} -I ${sdk} sdk.proto --grpc-gateway_out=logtostderr=true:pkg/sdk
protoc -I ${googleapis} -I ${sdk}/alpha alpha.proto --grpc-gateway_out=logtostderr=true:pkg/sdk/alpha
protoc -I ${googleapis} -I ${sdk}/beta beta.proto --grpc-gateway_out=logtostderr=true:pkg/sdk/beta
protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk} sdk.proto --grpc-gateway_out=logtostderr=true:pkg
protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk}/alpha alpha.proto --grpc-gateway_out=logtostderr=true:pkg/sdk
protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk}/beta beta.proto --grpc-gateway_out=logtostderr=true:pkg/sdk

protoc -I ${googleapis} -I ${sdk} sdk.proto --swagger_out=logtostderr=true:sdks/swagger
protoc -I ${googleapis} -I ${sdk}/alpha alpha.proto --swagger_out=logtostderr=true:sdks/swagger
protoc -I ${googleapis} -I ${sdk}/beta beta.proto --swagger_out=logtostderr=true:sdks/swagger
# generate openapi v2
protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk} sdk.proto --openapiv2_opt=logtostderr=true,simple_operation_ids=true,disable_default_errors=true --openapiv2_out=logtostderr=true:sdks/swagger
protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk}/alpha alpha.proto --openapiv2_opt=logtostderr=true,simple_operation_ids=true,disable_default_errors=true --openapiv2_out=logtostderr=true:sdks/swagger
protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk}/beta beta.proto --openapiv2_opt=logtostderr=true,simple_operation_ids=true,disable_default_errors=true --openapiv2_out=logtostderr=true:sdks/swagger

jq 'del(.schemes[] | select(. == "https"))' ./sdks/swagger/sdk.swagger.json | sponge ./sdks/swagger/sdk.swagger.json
jq 'del(.schemes[] | select(. == "https"))' ./sdks/swagger/alpha.swagger.json | sponge ./sdks/swagger/alpha.swagger.json
jq 'del(.schemes[] | select(. == "https"))' ./sdks/swagger/beta.swagger.json | sponge ./sdks/swagger/beta.swagger.json
# hard coding because protoc-gen-openapiv2 doesn't work well in Stream and doesn't generate 'googlerpcStatus' and 'protobufAny' definitions
cat sdks/swagger/sdk.swagger.json | jq '.definitions |= .+{"googlerpcStatus": {"type": "object", "properties": { "code": { "type": "integer", "format": "int32"}, "message": { "type":"string"}, "details": { "type": "array", "items": { "$ref": "#/definitions/protobufAny"}}}}}' | sponge sdks/swagger/sdk.swagger.json
cat sdks/swagger/sdk.swagger.json | jq '.definitions |= .+{"protobufAny": { "type": "object", "properties": { "@type": { "type": "string" }}, "additionalProperties": {}},}' | sponge sdks/swagger/sdk.swagger.json
Comment on lines +60 to +62
Copy link
Contributor Author

@govargo govargo Jun 25, 2022

Choose a reason for hiding this comment

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

This is workaround. Add jq logic to sdks/swagger/sdk.swagger.json because protoc-gen-openapiv2 doesn't work well in Stream and doesn't generate nessesary definitions.
It seems that the bug occurs if both stream definition and --openapiv2_opt=disable_default_errors=true exist.

If --openapiv2_opt=disable_default_errors=false(default behaviour), googlerpcStatus and protobufAny are outputed.


header ./pkg/sdk/sdk.pb.go
header ./pkg/sdk/sdk.pb.gw.go
header ./pkg/sdk/alpha/alpha.pb.go
header ./pkg/sdk/beta/beta.pb.go
header ./pkg/sdk/sdk.pb.gw.go
header ./pkg/sdk/sdk_grpc.pb.go
header ./pkg/sdk/alpha/alpha_grpc.pb.go
header ./pkg/sdk/beta/beta_grpc.pb.go

# these files may not exist if there are no grpc services
if [ -f "./pkg/sdk/alpha/alpha.pb.gw.go" ]; then
Expand Down
2 changes: 1 addition & 1 deletion build/build-sdk-images/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN echo "deb-src [signed-by=$KEYRING] https://deb.nodesource.com/$VERSION $DIST
RUN apt-get update && apt-get install -y nodejs

# Installing request is to address a bug with node-pre-gyp
RUN npm install --unsafe-perm --global request@2.88.2 grpc-tools@1.8.1
RUN npm install --unsafe-perm --global request@2.88.2 grpc-tools@1.11.2

# code generation scripts
COPY *.sh /root/
Expand Down
15 changes: 11 additions & 4 deletions build/build-sdk-images/node/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,28 @@ header() {

sdk=/go/src/agones.dev/agones/proto/sdk
googleapis=/go/src/agones.dev/agones/proto/googleapis
gatewaygrpc=/go/src/agones.dev/agones/proto/grpc-gateway

mkdir -p ./sdks/nodejs/lib/alpha

cd /go/src/agones.dev/agones

grpc_tools_node_protoc --proto_path=${googleapis} --proto_path=${sdk} --js_out=import_style=commonjs,binary:./sdks/nodejs/lib google/api/annotations.proto google/api/http.proto
grpc_tools_node_protoc --proto_path=${googleapis} --proto_path=${sdk}/alpha --js_out=import_style=commonjs,binary:./sdks/nodejs/lib/alpha google/api/annotations.proto google/api/http.proto
grpc_tools_node_protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk} --js_out=import_style=commonjs,binary:./sdks/nodejs/lib google/api/annotations.proto google/api/http.proto protoc-gen-openapiv2/options/annotations.proto protoc-gen-openapiv2/options/openapiv2.proto
grpc_tools_node_protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk}/alpha --js_out=import_style=commonjs,binary:./sdks/nodejs/lib/alpha google/api/annotations.proto google/api/http.proto protoc-gen-openapiv2/options/annotations.proto protoc-gen-openapiv2/options/openapiv2.proto

grpc_tools_node_protoc --proto_path=${googleapis} --proto_path=${sdk} --grpc_out=generate_package_definition:./sdks/nodejs/lib --js_out=import_style=commonjs,binary:./sdks/nodejs/lib sdk.proto
grpc_tools_node_protoc --proto_path=${googleapis} --proto_path=${sdk}/alpha --grpc_out=generate_package_definition:./sdks/nodejs/lib/alpha --js_out=import_style=commonjs,binary:./sdks/nodejs/lib/alpha alpha.proto
grpc_tools_node_protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk} --grpc_out=generate_package_definition:./sdks/nodejs/lib --js_out=import_style=commonjs,binary:./sdks/nodejs/lib sdk.proto
grpc_tools_node_protoc -I ${googleapis} -I ${gatewaygrpc} -I ${sdk}/alpha --grpc_out=generate_package_definition:./sdks/nodejs/lib/alpha --js_out=import_style=commonjs,binary:./sdks/nodejs/lib/alpha alpha.proto

header ./sdks/nodejs/lib/sdk_pb.js
header ./sdks/nodejs/lib/sdk_grpc_pb.js
header ./sdks/nodejs/lib/google/api/annotations_pb.js
header ./sdks/nodejs/lib/google/api/http_pb.js
header ./sdks/nodejs/lib/protoc-gen-openapiv2/options/annotations_pb.js
header ./sdks/nodejs/lib/protoc-gen-openapiv2/options/openapiv2_pb.js

header ./sdks/nodejs/lib/alpha/alpha_pb.js
header ./sdks/nodejs/lib/alpha/alpha_grpc_pb.js
header ./sdks/nodejs/lib/alpha/google/api/annotations_pb.js
header ./sdks/nodejs/lib/alpha/google/api/http_pb.js
header ./sdks/nodejs/lib/alpha/protoc-gen-openapiv2/options/annotations_pb.js
header ./sdks/nodejs/lib/alpha/protoc-gen-openapiv2/options/openapiv2_pb.js
2 changes: 1 addition & 1 deletion build/build-sdk-images/restapi/build-sdk-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
# limitations under the License.

mkdir /go/src/agones.dev/agones/swagger
wget -q https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.10/swagger-codegen-cli-2.4.10.jar -O /tmp/swagger-codegen-cli.jar
wget -q https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.34/swagger-codegen-cli-3.0.34.jar -O /tmp/swagger-codegen-cli.jar
java -jar /tmp/swagger-codegen-cli.jar generate -i /go/src/agones.dev/agones/sdks/swagger/sdk.swagger.json -l go -o /go/src/agones.dev/agones/test/sdk/restapi/swagger
java -jar /tmp/swagger-codegen-cli.jar generate -i /go/src/agones.dev/agones/sdks/swagger/alpha.swagger.json -l go -o /go/src/agones.dev/agones/test/sdk/restapi/alpha/swagger
2 changes: 0 additions & 2 deletions build/build-sdk-images/restapi/sdktest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
set -ex
GO111MODULE=on
cd /go/src/agones.dev/agones/test/sdk/restapi
# swagger gen has a bug wherein it doesn't generate the file, so we're providing it by hand
cp ./model_xstreamdefinitionssdkgameserver.go.nolint ./swagger/model_xstreamdefinitionssdkgameserver.go
Comment on lines -20 to -21
Copy link
Contributor Author

@govargo govargo Jun 25, 2022

Choose a reason for hiding this comment

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

Removed model_xstreamdefinitionssdkgameserver.go.nolint file because latest protoc-gen-swagger and protoc-gen-openapiv2 doesn't support x-stream-definitions.
Ref: grpc-ecosystem/grpc-gateway#1112

cp ./http-api-test.go.nolint ./http-api-test.go
go run http-api-test.go
cd /go/src/agones.dev/agones/test/sdk/websocket-watch
Expand Down
Loading