Skip to content

Commit

Permalink
Upgrade gRPC to 1.12.0
Browse files Browse the repository at this point in the history
This also replaces the C++ build image we have from the gRPC docker hub,
with one that we manage ourselves, since getting updates in a timely
matter was getting difficult.

The C++ base will likely go away once the transition to REST based SDK,
so the base may end up going away.

This is prerequisite for #240
  • Loading branch information
markmandel committed Jun 13, 2018
1 parent ce6f88b commit 86240b1
Show file tree
Hide file tree
Showing 324 changed files with 47,623 additions and 16,917 deletions.
25 changes: 14 additions & 11 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@

[[constraint]]
name = "google.golang.org/grpc"
version = "1.8.0"
version = "1.12.0"

[[constraint]]
name = "github.com/golang/protobuf"
version = "1.1.0"

[[constraint]]
branch = "master"
Expand Down
8 changes: 4 additions & 4 deletions build/build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# ForceUpdate 4 -- change here if you need to force a rebuild

# compiling proto + grpc takes an exceptionally long time
# so we'll use that as the base.
FROM grpc/cxx:1.8
# so we'll use a base from `base` - which is manually built using the below tag.
FROM gcr.io/agones-images/grpc-cxx:1.12

RUN apt-get update && \
apt-get install -y wget rsync make python bash-completion zip nano jq && \
Expand Down Expand Up @@ -52,10 +52,10 @@ RUN curl -L ${HELM_URL} > /tmp/helm.tar.gz \
&& rm /tmp/helm.tar.gz && rm -rf /tmp/linux-amd64
RUN echo "source <(helm completion bash)" >> /root/.bashrc

# install go-proto-gen 1.0
# install go-proto-gen 1.1
RUN mkdir -p /go/src/github.com/golang && cd /go/src/github.com/golang && \
git clone https://github.com/golang/protobuf.git && \
cd protobuf && git checkout v1.0.0 && \
cd protobuf && git checkout v1.1.0 && \
go install github.com/golang/protobuf/protoc-gen-go

# install go tooling for development, building and testing
Expand Down
39 changes: 39 additions & 0 deletions build/build-image/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


#
# This image is manually built (for now)
# as gcr.io/agones-images/grpc-cxx:1.12
#

FROM debian:stretch

RUN apt-get update && apt-get install -y \
build-essential autoconf libtool git pkg-config curl \
automake libtool curl make g++ unzip \
&& apt-get clean

# install protobuf first, then grpc
ENV GRPC_RELEASE_TAG v1.12.x
RUN git clone -b ${GRPC_RELEASE_TAG} https://github.com/grpc/grpc /var/local/git/grpc && \
cd /var/local/git/grpc && \
git submodule update --init && \
echo "--- installing protobuf ---" && \
cd third_party/protobuf && \
./autogen.sh && ./configure --enable-shared && \
make -j$(nproc) && make -j$(nproc) check && make install && make clean && ldconfig && \
echo "--- installing grpc ---" && \
cd /var/local/git/grpc && \
make -j$(nproc) && make install && make clean && ldconfig
43 changes: 28 additions & 15 deletions pkg/sdk/sdk.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions sdks/cpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ archive:
-rm $(build_path)/bin/agonessdk-$(VERSION)-src.zip
-rm $(build_path)/bin/agonessdk-$(VERSION)-dev-linux-arch_64.tar.gz
-rm $(build_path)/bin/agonessdk-$(VERSION)-runtime-linux-arch_64.tar.gz
cp /usr/local/lib/libgrpc.so.5 $(build_path)/bin/
cp /usr/local/lib/libgrpc.so.6 $(build_path)/bin/
cp /usr/local/lib/libprotobuf.so.15 $(build_path)/bin/
cp /usr/local/lib/libagonessdk.so $(build_path)/bin/
cp /usr/local/lib/libgpr.so.5 $(build_path)/bin/
cp /usr/local/lib/libgrpc_unsecure.so.5 $(build_path)/bin/
cp /usr/local/lib/libgpr.so.6 $(build_path)/bin/
cp /usr/local/lib/libgrpc_unsecure.so.6 $(build_path)/bin/
cd $(build_path)/bin && tar cvf agonessdk-$(VERSION)-runtime-linux-arch_64.tar.gz *
cd /usr/local && tar cvf $(build_path)/bin/agonessdk-$(VERSION)-dev-linux-arch_64.tar.gz lib include
cd $(build_path) && zip ./bin/agonessdk-$(VERSION)-src.zip Makefile *.md *.cc *.h
Expand Down
17 changes: 9 additions & 8 deletions sdks/cpp/sdk.grpc.pb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
#include "sdk.pb.h"
#include "sdk.grpc.pb.h"

#include <grpc++/impl/codegen/async_stream.h>
#include <grpc++/impl/codegen/async_unary_call.h>
#include <grpc++/impl/codegen/channel_interface.h>
#include <grpc++/impl/codegen/client_unary_call.h>
#include <grpc++/impl/codegen/method_handler_impl.h>
#include <grpc++/impl/codegen/rpc_service_method.h>
#include <grpc++/impl/codegen/service_type.h>
#include <grpc++/impl/codegen/sync_stream.h>
#include <grpcpp/impl/codegen/async_stream.h>
#include <grpcpp/impl/codegen/async_unary_call.h>
#include <grpcpp/impl/codegen/channel_interface.h>
#include <grpcpp/impl/codegen/client_unary_call.h>
#include <grpcpp/impl/codegen/method_handler_impl.h>
#include <grpcpp/impl/codegen/rpc_service_method.h>
#include <grpcpp/impl/codegen/service_type.h>
#include <grpcpp/impl/codegen/sync_stream.h>
namespace stable {
namespace agones {
namespace dev {
Expand All @@ -40,6 +40,7 @@ static const char* SDK_method_names[] = {
};

std::unique_ptr< SDK::Stub> SDK::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
(void)options;
std::unique_ptr< SDK::Stub> stub(new SDK::Stub(channel));
return stub;
}
Expand Down
18 changes: 9 additions & 9 deletions sdks/cpp/sdk.grpc.pb.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdks/cpp/sdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <grpc++/grpc++.h>
#include <grpcpp/grpcpp.h>
#include "sdk.grpc.pb.h"

namespace agones {
Expand Down
2 changes: 1 addition & 1 deletion sdks/cpp/sdk.pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#if 3005001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
Expand Down
5 changes: 3 additions & 2 deletions vendor/github.com/golang/protobuf/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 0 additions & 40 deletions vendor/github.com/golang/protobuf/Make.protobuf

This file was deleted.

15 changes: 4 additions & 11 deletions vendor/github.com/golang/protobuf/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 86240b1

Please sign in to comment.