From ff03847182a1fbd3c36cfafd1c69fdfb11f4b3af Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 12 Nov 2015 09:27:13 +0000 Subject: Moved nanopb to 3rd party --- tools/codegen/core/gen_load_balancing_proto.sh | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 tools/codegen/core/gen_load_balancing_proto.sh (limited to 'tools/codegen/core') diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh new file mode 100755 index 0000000000..7dd1470b19 --- /dev/null +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +if [ $# -eq 0 ]; then + echo "Usage: $0 " + exit 1 +fi + +readonly EXPECTED_OPTIONS_FILE_PATH="${1%.*}.options" + +if [[ ! -f "$1" ]]; then + echo "Input proto file '$1' doesn't exist." + exit 2 +fi +if [[ ! -f "${EXPECTED_OPTIONS_FILE_PATH}" ]]; then + echo "Expected nanopb options file '${EXPECTED_OPTIONS_FILE_PATH}' missing" + exit 3 +fi + +readonly GRPC_ROOT=$PWD + +pushd "$(dirname $1)" > /dev/null + +protoc \ +--plugin=protoc-gen-nanopb="$GRPC_ROOT/third_party/nanopb/generator/protoc-gen-nanopb" \ +--nanopb_out='-L#include\ \"third_party/nanopb/pb.h\"'":$GRPC_ROOT/src/core/proto" \ +"$(basename $1)" + +popd > /dev/null -- cgit v1.2.3 From 886b7d19bafbb61e84141e66a040da8c27781c44 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 3 Dec 2015 13:19:41 -0800 Subject: Added example to gen_load_balancing_proto.sh --- tools/codegen/core/gen_load_balancing_proto.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/codegen/core') diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index 7dd1470b19..20fddf14f3 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -1,4 +1,8 @@ #!/bin/bash +# +# Example usage: +# tools/codegen/core/gen_load_balancing_proto.sh \ +# src/core/client_config/lb_policies/proto/load_balancer.proto if [ $# -eq 0 ]; then echo "Usage: $0 " -- cgit v1.2.3 From 756a36cdacbe057eada8febf73878c0d06af2cd4 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 8 Jan 2016 15:56:21 -0800 Subject: Srcs and hdrs sanity checks skip third_party --- BUILD | 48 +++--- Makefile | 32 ++-- binding.gyp | 8 +- build.yaml | 25 +-- gRPC.podspec | 28 +-- .../client_config/lb_policies/load_balancer_api.c | 1 - .../client_config/lb_policies/load_balancer_api.h | 6 +- .../lb_policies/proto/load_balancer.options | 6 - .../lb_policies/proto/load_balancer.proto | 115 ------------- src/core/proto/grpc/lb/v0/load_balancer.pb.c | 118 +++++++++++++ src/core/proto/grpc/lb/v0/load_balancer.pb.h | 189 +++++++++++++++++++++ src/core/proto/load_balancer.pb.c | 87 ---------- src/core/proto/load_balancer.pb.h | 150 ---------------- .../lb_policies/proto/load_balancer.pb.c | 87 ---------- .../lb_policies/proto/load_balancer.pb.h | 150 ---------------- src/proto/grpc/lb/v0/load_balancer.options | 6 + src/proto/grpc/lb/v0/load_balancer.proto | 115 +++++++++++++ .../run_tests/sources_and_headers.json.template | 21 ++- test/cpp/grpclb/grpclb_api_test.cc | 13 +- tools/codegen/core/gen_load_balancing_proto.sh | 10 +- tools/doxygen/Doxyfile.core.internal | 16 +- tools/run_tests/run_sanity.sh | 1 + tools/run_tests/sources_and_headers.json | 34 ++-- vsprojects/vcxproj/grpc/grpc.vcxproj | 22 +-- vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 53 +++--- .../vcxproj/grpc_unsecure/grpc_unsecure.vcxproj | 22 +-- .../grpc_unsecure/grpc_unsecure.vcxproj.filters | 53 +++--- .../test/grpclb_api_test/grpclb_api_test.vcxproj | 8 +- .../grpclb_api_test.vcxproj.filters | 20 +-- 29 files changed, 651 insertions(+), 793 deletions(-) delete mode 100644 src/core/client_config/lb_policies/proto/load_balancer.options delete mode 100644 src/core/client_config/lb_policies/proto/load_balancer.proto create mode 100644 src/core/proto/grpc/lb/v0/load_balancer.pb.c create mode 100644 src/core/proto/grpc/lb/v0/load_balancer.pb.h delete mode 100644 src/core/proto/load_balancer.pb.c delete mode 100644 src/core/proto/load_balancer.pb.h delete mode 100644 src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.c delete mode 100644 src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.h create mode 100644 src/proto/grpc/lb/v0/load_balancer.options create mode 100644 src/proto/grpc/lb/v0/load_balancer.proto (limited to 'tools/codegen/core') diff --git a/BUILD b/BUILD index 51c4023917..f8fbc70e5a 100644 --- a/BUILD +++ b/BUILD @@ -227,7 +227,7 @@ cc_library( "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.h", @@ -267,13 +267,13 @@ cc_library( "src/core/transport/static_metadata.h", "src/core/transport/transport.h", "src/core/transport/transport_impl.h", + "src/core/census/aggregation.h", + "src/core/census/context.h", + "src/core/census/rpc_metric_id.h", "third_party/nanopb/pb.h", "third_party/nanopb/pb_common.h", "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", - "src/core/census/aggregation.h", - "src/core/census/context.h", - "src/core/census/rpc_metric_id.h", "src/core/httpcli/httpcli_security_connector.c", "src/core/security/base64.c", "src/core/security/client_auth_filter.c", @@ -374,7 +374,7 @@ cc_library( "src/core/json/json_reader.c", "src/core/json/json_string.c", "src/core/json/json_writer.c", - "src/core/proto/load_balancer.pb.c", + "src/core/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_reader.c", @@ -422,13 +422,13 @@ cc_library( "src/core/transport/static_metadata.c", "src/core/transport/transport.c", "src/core/transport/transport_op_string.c", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_encode.c", "src/core/census/context.c", "src/core/census/initialize.c", "src/core/census/operation.c", "src/core/census/tracing.c", + "third_party/nanopb/pb_common.c", + "third_party/nanopb/pb_decode.c", + "third_party/nanopb/pb_encode.c", ], hdrs = [ "include/grpc/grpc_security.h", @@ -529,7 +529,7 @@ cc_library( "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.h", @@ -569,13 +569,13 @@ cc_library( "src/core/transport/static_metadata.h", "src/core/transport/transport.h", "src/core/transport/transport_impl.h", + "src/core/census/aggregation.h", + "src/core/census/context.h", + "src/core/census/rpc_metric_id.h", "third_party/nanopb/pb.h", "third_party/nanopb/pb_common.h", "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", - "src/core/census/aggregation.h", - "src/core/census/context.h", - "src/core/census/rpc_metric_id.h", "src/core/surface/init_unsecure.c", "src/core/census/grpc_context.c", "src/core/census/grpc_filter.c", @@ -656,7 +656,7 @@ cc_library( "src/core/json/json_reader.c", "src/core/json/json_string.c", "src/core/json/json_writer.c", - "src/core/proto/load_balancer.pb.c", + "src/core/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_reader.c", @@ -704,13 +704,13 @@ cc_library( "src/core/transport/static_metadata.c", "src/core/transport/transport.c", "src/core/transport/transport_op_string.c", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_encode.c", "src/core/census/context.c", "src/core/census/initialize.c", "src/core/census/operation.c", "src/core/census/tracing.c", + "third_party/nanopb/pb_common.c", + "third_party/nanopb/pb_decode.c", + "third_party/nanopb/pb_encode.c", ], hdrs = [ "include/grpc/byte_buffer.h", @@ -1195,7 +1195,7 @@ objc_library( "src/core/json/json_reader.c", "src/core/json/json_string.c", "src/core/json/json_writer.c", - "src/core/proto/load_balancer.pb.c", + "src/core/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_reader.c", @@ -1243,13 +1243,13 @@ objc_library( "src/core/transport/static_metadata.c", "src/core/transport/transport.c", "src/core/transport/transport_op_string.c", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_encode.c", "src/core/census/context.c", "src/core/census/initialize.c", "src/core/census/operation.c", "src/core/census/tracing.c", + "third_party/nanopb/pb_common.c", + "third_party/nanopb/pb_decode.c", + "third_party/nanopb/pb_encode.c", ], hdrs = [ "include/grpc/grpc_security.h", @@ -1348,7 +1348,7 @@ objc_library( "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.h", @@ -1388,13 +1388,13 @@ objc_library( "src/core/transport/static_metadata.h", "src/core/transport/transport.h", "src/core/transport/transport_impl.h", + "src/core/census/aggregation.h", + "src/core/census/context.h", + "src/core/census/rpc_metric_id.h", "third_party/nanopb/pb.h", "third_party/nanopb/pb_common.h", "third_party/nanopb/pb_decode.h", "third_party/nanopb/pb_encode.h", - "src/core/census/aggregation.h", - "src/core/census/context.h", - "src/core/census/rpc_metric_id.h", ], includes = [ "include", diff --git a/Makefile b/Makefile index 59f2ad1a52..3995ae52be 100644 --- a/Makefile +++ b/Makefile @@ -1714,15 +1714,15 @@ $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc: $(Q) echo "$(GRPCXX_UNSECURE_PC_FILE)" | tr , '\n' >$@ ifeq ($(NO_PROTOC),true) -$(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.pb.cc: protoc_dep_error -$(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.grpc.pb.cc: protoc_dep_error +$(GENDIR)/src/proto/grpc/lb/v0/load_balancer.pb.cc: protoc_dep_error +$(GENDIR)/src/proto/grpc/lb/v0/load_balancer.grpc.pb.cc: protoc_dep_error else -$(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.pb.cc: src/core/client_config/lb_policies/proto/load_balancer.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) +$(GENDIR)/src/proto/grpc/lb/v0/load_balancer.pb.cc: src/proto/grpc/lb/v0/load_balancer.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[PROTOC] Generating protobuf CC file from $<" $(Q) mkdir -p `dirname $@` $(Q) $(PROTOC) --cpp_out=$(GENDIR) $< -$(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.grpc.pb.cc: src/core/client_config/lb_policies/proto/load_balancer.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) +$(GENDIR)/src/proto/grpc/lb/v0/load_balancer.grpc.pb.cc: src/proto/grpc/lb/v0/load_balancer.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" $(Q) mkdir -p `dirname $@` $(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $< @@ -2420,7 +2420,7 @@ LIBGRPC_SRC = \ src/core/json/json_reader.c \ src/core/json/json_string.c \ src/core/json/json_writer.c \ - src/core/proto/load_balancer.pb.c \ + src/core/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_reader.c \ @@ -2468,13 +2468,13 @@ LIBGRPC_SRC = \ src/core/transport/static_metadata.c \ src/core/transport/transport.c \ src/core/transport/transport_op_string.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ src/core/census/context.c \ src/core/census/initialize.c \ src/core/census/operation.c \ src/core/census/tracing.c \ + third_party/nanopb/pb_common.c \ + third_party/nanopb/pb_decode.c \ + third_party/nanopb/pb_encode.c \ PUBLIC_HEADERS_C += \ include/grpc/grpc_security.h \ @@ -2727,7 +2727,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/json/json_reader.c \ src/core/json/json_string.c \ src/core/json/json_writer.c \ - src/core/proto/load_balancer.pb.c \ + src/core/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_reader.c \ @@ -2775,13 +2775,13 @@ LIBGRPC_UNSECURE_SRC = \ src/core/transport/static_metadata.c \ src/core/transport/transport.c \ src/core/transport/transport_op_string.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ src/core/census/context.c \ src/core/census/initialize.c \ src/core/census/operation.c \ src/core/census/tracing.c \ + third_party/nanopb/pb_common.c \ + third_party/nanopb/pb_decode.c \ + third_party/nanopb/pb_encode.c \ PUBLIC_HEADERS_C += \ include/grpc/byte_buffer.h \ @@ -9596,7 +9596,7 @@ endif GRPCLB_API_TEST_SRC = \ - $(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.pb.cc $(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.grpc.pb.cc \ + $(GENDIR)/src/proto/grpc/lb/v0/load_balancer.pb.cc $(GENDIR)/src/proto/grpc/lb/v0/load_balancer.grpc.pb.cc \ test/cpp/grpclb/grpclb_api_test.cc \ GRPCLB_API_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPCLB_API_TEST_SRC)))) @@ -9628,8 +9628,10 @@ endif endif -$(OBJDIR)/$(CONFIG)/src/core/client_config/lb_policies/proto/load_balancer.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a +$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v0/load_balancer.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(OBJDIR)/$(CONFIG)/test/cpp/grpclb/grpclb_api_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a + deps_grpclb_api_test: $(GRPCLB_API_TEST_OBJS:.o=.dep) ifneq ($(NO_SECURE),true) @@ -9637,7 +9639,7 @@ ifneq ($(NO_DEPS),true) -include $(GRPCLB_API_TEST_OBJS:.o=.dep) endif endif -$(OBJDIR)/$(CONFIG)/test/cpp/grpclb/grpclb_api_test.o: $(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.pb.cc $(GENDIR)/src/core/client_config/lb_policies/proto/load_balancer.grpc.pb.cc +$(OBJDIR)/$(CONFIG)/test/cpp/grpclb/grpclb_api_test.o: $(GENDIR)/src/proto/grpc/lb/v0/load_balancer.pb.cc $(GENDIR)/src/proto/grpc/lb/v0/load_balancer.grpc.pb.cc ifeq ($(NO_SECURE),true) diff --git a/binding.gyp b/binding.gyp index ff130c04a8..ad74780399 100644 --- a/binding.gyp +++ b/binding.gyp @@ -262,7 +262,7 @@ 'src/core/json/json_reader.c', 'src/core/json/json_string.c', 'src/core/json/json_writer.c', - 'src/core/proto/load_balancer.pb.c', + 'src/core/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/surface/api_trace.c', 'src/core/surface/byte_buffer.c', 'src/core/surface/byte_buffer_reader.c', @@ -310,13 +310,13 @@ 'src/core/transport/static_metadata.c', 'src/core/transport/transport.c', 'src/core/transport/transport_op_string.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', 'src/core/census/context.c', 'src/core/census/initialize.c', 'src/core/census/operation.c', 'src/core/census/tracing.c', + 'third_party/nanopb/pb_common.c', + 'third_party/nanopb/pb_decode.c', + 'third_party/nanopb/pb_encode.c', ], "conditions": [ ['OS == "mac"', { diff --git a/build.yaml b/build.yaml index d306f94301..984537a70d 100644 --- a/build.yaml +++ b/build.yaml @@ -181,7 +181,7 @@ filegroups: - src/core/json/json_common.h - src/core/json/json_reader.h - src/core/json/json_writer.h - - src/core/proto/load_balancer.pb.h + - src/core/proto/grpc/lb/v0/load_balancer.pb.h - src/core/statistics/census_interface.h - src/core/statistics/census_rpc_stats.h - src/core/surface/api_trace.h @@ -221,10 +221,6 @@ filegroups: - src/core/transport/static_metadata.h - src/core/transport/transport.h - src/core/transport/transport_impl.h - - third_party/nanopb/pb.h - - third_party/nanopb/pb_common.h - - third_party/nanopb/pb_decode.h - - third_party/nanopb/pb_encode.h src: - src/core/census/grpc_context.c - src/core/census/grpc_filter.c @@ -305,7 +301,7 @@ filegroups: - src/core/json/json_reader.c - src/core/json/json_string.c - src/core/json/json_writer.c - - src/core/proto/load_balancer.pb.c + - src/core/proto/grpc/lb/v0/load_balancer.pb.c - src/core/surface/api_trace.c - src/core/surface/byte_buffer.c - src/core/surface/byte_buffer_reader.c @@ -353,9 +349,6 @@ filegroups: - src/core/transport/static_metadata.c - src/core/transport/transport.c - src/core/transport/transport_op_string.c - - third_party/nanopb/pb_common.c - - third_party/nanopb/pb_decode.c - - third_party/nanopb/pb_encode.c - name: grpc_test_util_base headers: - test/core/end2end/cq_verifier.h @@ -374,6 +367,16 @@ filegroups: - test/core/util/port_posix.c - test/core/util/port_windows.c - test/core/util/slice_splitter.c +- name: nanopb + headers: + - third_party/nanopb/pb.h + - third_party/nanopb/pb_common.h + - third_party/nanopb/pb_decode.h + - third_party/nanopb/pb_encode.h + src: + - third_party/nanopb/pb_common.c + - third_party/nanopb/pb_decode.c + - third_party/nanopb/pb_encode.c libs: - name: gpr build: all @@ -522,6 +525,7 @@ libs: filegroups: - grpc_base - census + - nanopb secure: true vs_packages: - grpc.dependencies.openssl @@ -568,6 +572,7 @@ libs: filegroups: - grpc_base - census + - nanopb secure: false vs_project_guid: '{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}' - name: grpc_zookeeper @@ -2041,7 +2046,7 @@ targets: build: test language: c++ src: - - src/core/client_config/lb_policies/proto/load_balancer.proto + - src/proto/grpc/lb/v0/load_balancer.proto - test/cpp/grpclb/grpclb_api_test.cc deps: - grpc++ diff --git a/gRPC.podspec b/gRPC.podspec index 20b0264a58..2b67128d58 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -231,7 +231,7 @@ Pod::Spec.new do |s| 'src/core/json/json_common.h', 'src/core/json/json_reader.h', 'src/core/json/json_writer.h', - 'src/core/proto/load_balancer.pb.h', + 'src/core/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/statistics/census_interface.h', 'src/core/statistics/census_rpc_stats.h', 'src/core/surface/api_trace.h', @@ -271,13 +271,13 @@ Pod::Spec.new do |s| 'src/core/transport/static_metadata.h', 'src/core/transport/transport.h', 'src/core/transport/transport_impl.h', + 'src/core/census/aggregation.h', + 'src/core/census/context.h', + 'src/core/census/rpc_metric_id.h', 'third_party/nanopb/pb.h', 'third_party/nanopb/pb_common.h', 'third_party/nanopb/pb_decode.h', 'third_party/nanopb/pb_encode.h', - 'src/core/census/aggregation.h', - 'src/core/census/context.h', - 'src/core/census/rpc_metric_id.h', 'include/grpc/grpc_security.h', 'include/grpc/byte_buffer.h', 'include/grpc/byte_buffer_reader.h', @@ -385,7 +385,7 @@ Pod::Spec.new do |s| 'src/core/json/json_reader.c', 'src/core/json/json_string.c', 'src/core/json/json_writer.c', - 'src/core/proto/load_balancer.pb.c', + 'src/core/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/surface/api_trace.c', 'src/core/surface/byte_buffer.c', 'src/core/surface/byte_buffer_reader.c', @@ -433,13 +433,13 @@ Pod::Spec.new do |s| 'src/core/transport/static_metadata.c', 'src/core/transport/transport.c', 'src/core/transport/transport_op_string.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', 'src/core/census/context.c', 'src/core/census/initialize.c', 'src/core/census/operation.c', - 'src/core/census/tracing.c' + 'src/core/census/tracing.c', + 'third_party/nanopb/pb_common.c', + 'third_party/nanopb/pb_decode.c', + 'third_party/nanopb/pb_encode.c' ss.private_header_files = 'src/core/profiling/timers.h', 'src/core/support/block_annotate.h', @@ -540,7 +540,7 @@ Pod::Spec.new do |s| 'src/core/json/json_common.h', 'src/core/json/json_reader.h', 'src/core/json/json_writer.h', - 'src/core/proto/load_balancer.pb.h', + 'src/core/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/statistics/census_interface.h', 'src/core/statistics/census_rpc_stats.h', 'src/core/surface/api_trace.h', @@ -580,13 +580,13 @@ Pod::Spec.new do |s| 'src/core/transport/static_metadata.h', 'src/core/transport/transport.h', 'src/core/transport/transport_impl.h', + 'src/core/census/aggregation.h', + 'src/core/census/context.h', + 'src/core/census/rpc_metric_id.h', 'third_party/nanopb/pb.h', 'third_party/nanopb/pb_common.h', 'third_party/nanopb/pb_decode.h', - 'third_party/nanopb/pb_encode.h', - 'src/core/census/aggregation.h', - 'src/core/census/context.h', - 'src/core/census/rpc_metric_id.h' + 'third_party/nanopb/pb_encode.h' ss.header_mappings_dir = '.' # This isn't officially supported in Cocoapods. We've asked for an alternative: diff --git a/src/core/client_config/lb_policies/load_balancer_api.c b/src/core/client_config/lb_policies/load_balancer_api.c index c0fd726efd..ea60944e07 100644 --- a/src/core/client_config/lb_policies/load_balancer_api.c +++ b/src/core/client_config/lb_policies/load_balancer_api.c @@ -37,7 +37,6 @@ #include - typedef struct decode_serverlist_arg { int first_pass; int i; diff --git a/src/core/client_config/lb_policies/load_balancer_api.h b/src/core/client_config/lb_policies/load_balancer_api.h index 4018a1bf87..d539c3fe3d 100644 --- a/src/core/client_config/lb_policies/load_balancer_api.h +++ b/src/core/client_config/lb_policies/load_balancer_api.h @@ -37,7 +37,7 @@ #include #include "src/core/client_config/lb_policy_factory.h" -#include "src/core/proto/load_balancer.pb.h" +#include "src/core/proto/grpc/lb/v0/load_balancer.pb.h" #ifdef __cplusplus extern "C" { @@ -56,10 +56,10 @@ typedef struct grpc_grpclb_serverlist { } grpc_grpclb_serverlist; /** Create a request for a gRPC LB service under \a lb_service_name */ -grpc_grpclb_request *grpc_grpclb_request_create(const char* lb_service_name); +grpc_grpclb_request *grpc_grpclb_request_create(const char *lb_service_name); /** Protocol Buffers v3-encode \a request */ -gpr_slice grpc_grpclb_request_encode(const grpc_grpclb_request* request); +gpr_slice grpc_grpclb_request_encode(const grpc_grpclb_request *request); /** Destroy \a request */ void grpc_grpclb_request_destroy(grpc_grpclb_request *request); diff --git a/src/core/client_config/lb_policies/proto/load_balancer.options b/src/core/client_config/lb_policies/proto/load_balancer.options deleted file mode 100644 index 6d4528f838..0000000000 --- a/src/core/client_config/lb_policies/proto/load_balancer.options +++ /dev/null @@ -1,6 +0,0 @@ -grpc.lb.v0.InitialLoadBalanceRequest.name max_size:128 -grpc.lb.v0.InitialLoadBalanceResponse.client_config max_size:64 -grpc.lb.v0.InitialLoadBalanceResponse.load_balancer_delegate max_size:64 -grpc.lb.v0.Server.ip_address max_size:46 -grpc.lb.v0.Server.load_balance_token max_size:64 -load_balancer.proto no_unions:true diff --git a/src/core/client_config/lb_policies/proto/load_balancer.proto b/src/core/client_config/lb_policies/proto/load_balancer.proto deleted file mode 100644 index 6c96e8d52c..0000000000 --- a/src/core/client_config/lb_policies/proto/load_balancer.proto +++ /dev/null @@ -1,115 +0,0 @@ -syntax = "proto3"; - -package grpc.lb.v0; - -message Duration { - - // Signed seconds of the span of time. Must be from -315,576,000,000 - // to +315,576,000,000 inclusive. - int64 seconds = 1; - - // Signed fractions of a second at nanosecond resolution of the span - // of time. Durations less than one second are represented with a 0 - // `seconds` field and a positive or negative `nanos` field. For durations - // of one second or more, a non-zero value for the `nanos` field must be - // of the same sign as the `seconds` field. Must be from -999,999,999 - // to +999,999,999 inclusive. - int32 nanos = 2; -} - -service LoadBalancer { - // Bidirectional rpc to get a list of servers. - rpc BalanceLoad(stream LoadBalanceRequest) - returns (stream LoadBalanceResponse); -} - -message LoadBalanceRequest { - oneof load_balance_request_type { - // This message should be sent on the first request to the load balancer. - InitialLoadBalanceRequest initial_request = 1; - - // The client stats should be periodically reported to the load balancer - // based on the duration defined in the InitialLoadBalanceResponse. - ClientStats client_stats = 2; - } -} - -message InitialLoadBalanceRequest { - // Name of load balanced service (IE, service.grpc.gslb.google.com) - string name = 1; -} - -// Contains client level statistics that are useful to load balancing. Each -// count should be reset to zero after reporting the stats. -message ClientStats { - // The total number of requests sent by the client since the last report. - int64 total_requests = 1; - - // The number of client rpc errors since the last report. - int64 client_rpc_errors = 2; - - // The number of dropped requests since the last report. - int64 dropped_requests = 3; -} - -message LoadBalanceResponse { - oneof load_balance_response_type { - // This message should be sent on the first response to the client. - InitialLoadBalanceResponse initial_response = 1; - - // Contains the list of servers selected by the load balancer. The client - // should send requests to these servers in the specified order. - ServerList server_list = 2; - } -} - -message InitialLoadBalanceResponse { - oneof initial_response_type { - // Contains gRPC config options like RPC deadline or flow control. - // TODO(yetianx): Change to ClientConfig after it is defined. - string client_config = 1; - - // This is an application layer redirect that indicates the client should - // use the specified server for load balancing. When this field is set in - // the response, the client should open a separate connection to the - // load_balancer_delegate and call the BalanceLoad method. - string load_balancer_delegate = 2; - } - - // This interval defines how often the client should send the client stats - // to the load balancer. Stats should only be reported when the duration is - // positive. - Duration client_stats_report_interval = 3; -} - -message ServerList { - // Contains a list of servers selected by the load balancer. The list will - // be updated when server resolutions change or as needed to balance load - // across more servers. The client should consume the server list in order - // unless instructed otherwise via the client_config. - repeated Server servers = 1; - - // Indicates the amount of time that the client should consider this server - // list as valid. It may be considered stale after waiting this interval of - // time after receiving the list. If the interval is not positive, the - // client can assume the list is valid until the next list is received. - Duration expiration_interval = 3; -} - -message Server { - // A resolved address and port for the server. The IP address string may - // either be an IPv4 or IPv6 address. - string ip_address = 1; - int32 port = 2; - - // An opaque token that is passed from the client to the server in metadata. - // The server may expect this token to indicate that the request from the - // client was load balanced. - // TODO(yetianx): Not used right now, and will be used after implementing - // load report. - bytes load_balance_token = 3; - - // Indicates whether this particular request should be dropped by the client - // when this server is chosen from the list. - bool drop_request = 4; -} diff --git a/src/core/proto/grpc/lb/v0/load_balancer.pb.c b/src/core/proto/grpc/lb/v0/load_balancer.pb.c new file mode 100644 index 0000000000..ad9a0feb93 --- /dev/null +++ b/src/core/proto/grpc/lb/v0/load_balancer.pb.c @@ -0,0 +1,118 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.3.4-dev at Mon Jan 11 11:29:01 2016. */ + +#include "src/core/proto/grpc/lb/v0/load_balancer.pb.h" + +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + +const pb_field_t grpc_lb_v0_Duration_fields[3] = { + PB_FIELD(1, INT64, OPTIONAL, STATIC, FIRST, grpc_lb_v0_Duration, seconds, + seconds, 0), + PB_FIELD(2, INT32, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Duration, nanos, + seconds, 0), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3] = { + PB_FIELD(1, MESSAGE, OPTIONAL, STATIC, FIRST, grpc_lb_v0_LoadBalanceRequest, + initial_request, initial_request, + &grpc_lb_v0_InitialLoadBalanceRequest_fields), + PB_FIELD(2, MESSAGE, OPTIONAL, STATIC, OTHER, grpc_lb_v0_LoadBalanceRequest, + client_stats, initial_request, &grpc_lb_v0_ClientStats_fields), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2] = { + PB_FIELD(1, STRING, OPTIONAL, STATIC, FIRST, + grpc_lb_v0_InitialLoadBalanceRequest, name, name, 0), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_ClientStats_fields[4] = { + PB_FIELD(1, INT64, OPTIONAL, STATIC, FIRST, grpc_lb_v0_ClientStats, + total_requests, total_requests, 0), + PB_FIELD(2, INT64, OPTIONAL, STATIC, OTHER, grpc_lb_v0_ClientStats, + client_rpc_errors, total_requests, 0), + PB_FIELD(3, INT64, OPTIONAL, STATIC, OTHER, grpc_lb_v0_ClientStats, + dropped_requests, client_rpc_errors, 0), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3] = { + PB_FIELD(1, MESSAGE, OPTIONAL, STATIC, FIRST, + grpc_lb_v0_LoadBalanceResponse, initial_response, initial_response, + &grpc_lb_v0_InitialLoadBalanceResponse_fields), + PB_FIELD(2, MESSAGE, OPTIONAL, STATIC, OTHER, + grpc_lb_v0_LoadBalanceResponse, server_list, initial_response, + &grpc_lb_v0_ServerList_fields), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4] = { + PB_FIELD(1, STRING, OPTIONAL, STATIC, FIRST, + grpc_lb_v0_InitialLoadBalanceResponse, client_config, + client_config, 0), + PB_FIELD(2, STRING, OPTIONAL, STATIC, OTHER, + grpc_lb_v0_InitialLoadBalanceResponse, load_balancer_delegate, + client_config, 0), + PB_FIELD(3, MESSAGE, OPTIONAL, STATIC, OTHER, + grpc_lb_v0_InitialLoadBalanceResponse, + client_stats_report_interval, load_balancer_delegate, + &grpc_lb_v0_Duration_fields), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_ServerList_fields[3] = { + PB_FIELD(1, MESSAGE, REPEATED, CALLBACK, FIRST, grpc_lb_v0_ServerList, + servers, servers, &grpc_lb_v0_Server_fields), + PB_FIELD(3, MESSAGE, OPTIONAL, STATIC, OTHER, grpc_lb_v0_ServerList, + expiration_interval, servers, &grpc_lb_v0_Duration_fields), + PB_LAST_FIELD}; + +const pb_field_t grpc_lb_v0_Server_fields[5] = { + PB_FIELD(1, STRING, OPTIONAL, STATIC, FIRST, grpc_lb_v0_Server, ip_address, + ip_address, 0), + PB_FIELD(2, INT32, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Server, port, + ip_address, 0), + PB_FIELD(3, BYTES, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Server, + load_balance_token, port, 0), + PB_FIELD(4, BOOL, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Server, drop_request, + load_balance_token, 0), + PB_LAST_FIELD}; + +/* Check that field information fits in pb_field_t */ +#if !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_32BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in 8 or 16 bit + * field descriptors. + */ +PB_STATIC_ASSERT( + (pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 65536 && + pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 65536 && + pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 65536 && + pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 65536 && + pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, + client_stats_report_interval) < 65536 && + pb_membersize(grpc_lb_v0_ServerList, servers) < 65536 && + pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 65536), + YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) +#endif + +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) +/* If you get an error here, it means that you need to define PB_FIELD_16BIT + * compile-time option. You can do that in pb.h or on compiler command line. + * + * The reason you need to do this is that some of your messages contain tag + * numbers or field sizes that are larger than what can fit in the default + * 8 bit descriptors. + */ +PB_STATIC_ASSERT( + (pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 256 && + pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 256 && + pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 256 && + pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 256 && + pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, + client_stats_report_interval) < 256 && + pb_membersize(grpc_lb_v0_ServerList, servers) < 256 && + pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 256), + YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) +#endif diff --git a/src/core/proto/grpc/lb/v0/load_balancer.pb.h b/src/core/proto/grpc/lb/v0/load_balancer.pb.h new file mode 100644 index 0000000000..897c8af2f7 --- /dev/null +++ b/src/core/proto/grpc/lb/v0/load_balancer.pb.h @@ -0,0 +1,189 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.3.4-dev at Mon Jan 11 11:29:01 2016. */ + +#ifndef PB_LOAD_BALANCER_PB_H_INCLUDED +#define PB_LOAD_BALANCER_PB_H_INCLUDED +#include "third_party/nanopb/pb.h" +#if PB_PROTO_HEADER_VERSION != 30 +#error Regenerate this file with the current version of nanopb generator. +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Enum definitions */ +/* Struct definitions */ +typedef struct _grpc_lb_v0_ClientStats { + bool has_total_requests; + int64_t total_requests; + bool has_client_rpc_errors; + int64_t client_rpc_errors; + bool has_dropped_requests; + int64_t dropped_requests; +} grpc_lb_v0_ClientStats; + +typedef struct _grpc_lb_v0_Duration { + bool has_seconds; + int64_t seconds; + bool has_nanos; + int32_t nanos; +} grpc_lb_v0_Duration; + +typedef struct _grpc_lb_v0_InitialLoadBalanceRequest { + bool has_name; + char name[128]; +} grpc_lb_v0_InitialLoadBalanceRequest; + +typedef PB_BYTES_ARRAY_T(64) grpc_lb_v0_Server_load_balance_token_t; +typedef struct _grpc_lb_v0_Server { + bool has_ip_address; + char ip_address[46]; + bool has_port; + int32_t port; + bool has_load_balance_token; + grpc_lb_v0_Server_load_balance_token_t load_balance_token; + bool has_drop_request; + bool drop_request; +} grpc_lb_v0_Server; + +typedef struct _grpc_lb_v0_InitialLoadBalanceResponse { + bool has_client_config; + char client_config[64]; + bool has_load_balancer_delegate; + char load_balancer_delegate[64]; + bool has_client_stats_report_interval; + grpc_lb_v0_Duration client_stats_report_interval; +} grpc_lb_v0_InitialLoadBalanceResponse; + +typedef struct _grpc_lb_v0_LoadBalanceRequest { + bool has_initial_request; + grpc_lb_v0_InitialLoadBalanceRequest initial_request; + bool has_client_stats; + grpc_lb_v0_ClientStats client_stats; +} grpc_lb_v0_LoadBalanceRequest; + +typedef struct _grpc_lb_v0_ServerList { + pb_callback_t servers; + bool has_expiration_interval; + grpc_lb_v0_Duration expiration_interval; +} grpc_lb_v0_ServerList; + +typedef struct _grpc_lb_v0_LoadBalanceResponse { + bool has_initial_response; + grpc_lb_v0_InitialLoadBalanceResponse initial_response; + bool has_server_list; + grpc_lb_v0_ServerList server_list; +} grpc_lb_v0_LoadBalanceResponse; + +/* Default values for struct fields */ + +/* Initializer values for message structs */ +#define grpc_lb_v0_Duration_init_default \ + { false, 0, false, 0 } +#define grpc_lb_v0_LoadBalanceRequest_init_default \ + { \ + false, grpc_lb_v0_InitialLoadBalanceRequest_init_default, false, \ + grpc_lb_v0_ClientStats_init_default \ + } +#define grpc_lb_v0_InitialLoadBalanceRequest_init_default \ + { false, "" } +#define grpc_lb_v0_ClientStats_init_default \ + { false, 0, false, 0, false, 0 } +#define grpc_lb_v0_LoadBalanceResponse_init_default \ + { \ + false, grpc_lb_v0_InitialLoadBalanceResponse_init_default, false, \ + grpc_lb_v0_ServerList_init_default \ + } +#define grpc_lb_v0_InitialLoadBalanceResponse_init_default \ + { false, "", false, "", false, grpc_lb_v0_Duration_init_default } +#define grpc_lb_v0_ServerList_init_default \ + { \ + { \ + { NULL } \ + , NULL \ + } \ + , false, grpc_lb_v0_Duration_init_default \ + } +#define grpc_lb_v0_Server_init_default \ + { false, "", false, 0, false, {0, {0}}, false, 0 } +#define grpc_lb_v0_Duration_init_zero \ + { false, 0, false, 0 } +#define grpc_lb_v0_LoadBalanceRequest_init_zero \ + { \ + false, grpc_lb_v0_InitialLoadBalanceRequest_init_zero, false, \ + grpc_lb_v0_ClientStats_init_zero \ + } +#define grpc_lb_v0_InitialLoadBalanceRequest_init_zero \ + { false, "" } +#define grpc_lb_v0_ClientStats_init_zero \ + { false, 0, false, 0, false, 0 } +#define grpc_lb_v0_LoadBalanceResponse_init_zero \ + { \ + false, grpc_lb_v0_InitialLoadBalanceResponse_init_zero, false, \ + grpc_lb_v0_ServerList_init_zero \ + } +#define grpc_lb_v0_InitialLoadBalanceResponse_init_zero \ + { false, "", false, "", false, grpc_lb_v0_Duration_init_zero } +#define grpc_lb_v0_ServerList_init_zero \ + { \ + { \ + { NULL } \ + , NULL \ + } \ + , false, grpc_lb_v0_Duration_init_zero \ + } +#define grpc_lb_v0_Server_init_zero \ + { false, "", false, 0, false, {0, {0}}, false, 0 } + +/* Field tags (for use in manual encoding/decoding) */ +#define grpc_lb_v0_ClientStats_total_requests_tag 1 +#define grpc_lb_v0_ClientStats_client_rpc_errors_tag 2 +#define grpc_lb_v0_ClientStats_dropped_requests_tag 3 +#define grpc_lb_v0_Duration_seconds_tag 1 +#define grpc_lb_v0_Duration_nanos_tag 2 +#define grpc_lb_v0_InitialLoadBalanceRequest_name_tag 1 +#define grpc_lb_v0_Server_ip_address_tag 1 +#define grpc_lb_v0_Server_port_tag 2 +#define grpc_lb_v0_Server_load_balance_token_tag 3 +#define grpc_lb_v0_Server_drop_request_tag 4 +#define grpc_lb_v0_InitialLoadBalanceResponse_client_config_tag 1 +#define grpc_lb_v0_InitialLoadBalanceResponse_load_balancer_delegate_tag 2 +#define grpc_lb_v0_InitialLoadBalanceResponse_client_stats_report_interval_tag 3 +#define grpc_lb_v0_LoadBalanceRequest_initial_request_tag 1 +#define grpc_lb_v0_LoadBalanceRequest_client_stats_tag 2 +#define grpc_lb_v0_ServerList_servers_tag 1 +#define grpc_lb_v0_ServerList_expiration_interval_tag 3 +#define grpc_lb_v0_LoadBalanceResponse_initial_response_tag 1 +#define grpc_lb_v0_LoadBalanceResponse_server_list_tag 2 + +/* Struct field encoding specification for nanopb */ +extern const pb_field_t grpc_lb_v0_Duration_fields[3]; +extern const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3]; +extern const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2]; +extern const pb_field_t grpc_lb_v0_ClientStats_fields[4]; +extern const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3]; +extern const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4]; +extern const pb_field_t grpc_lb_v0_ServerList_fields[3]; +extern const pb_field_t grpc_lb_v0_Server_fields[5]; + +/* Maximum encoded size of messages (where known) */ +#define grpc_lb_v0_Duration_size 22 +#define grpc_lb_v0_LoadBalanceRequest_size 169 +#define grpc_lb_v0_InitialLoadBalanceRequest_size 131 +#define grpc_lb_v0_ClientStats_size 33 +#define grpc_lb_v0_InitialLoadBalanceResponse_size 156 +#define grpc_lb_v0_Server_size 127 + +/* Message IDs (where set with "msgid" option) */ +#ifdef PB_MSGID + +#define LOAD_BALANCER_MESSAGES + +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/core/proto/load_balancer.pb.c b/src/core/proto/load_balancer.pb.c deleted file mode 100644 index 2f29748d21..0000000000 --- a/src/core/proto/load_balancer.pb.c +++ /dev/null @@ -1,87 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.4-dev at Wed Nov 11 15:38:23 2015. */ - -#include "load_balancer.pb.h" - -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t grpc_lb_v0_Duration_fields[3] = { - PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v0_Duration, seconds, seconds, 0), - PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Duration, nanos, seconds, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v0_LoadBalanceRequest, initial_request, initial_request, &grpc_lb_v0_InitialLoadBalanceRequest_fields), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_LoadBalanceRequest, client_stats, initial_request, &grpc_lb_v0_ClientStats_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_InitialLoadBalanceRequest, name, name, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_ClientStats_fields[4] = { - PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v0_ClientStats, total_requests, total_requests, 0), - PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ClientStats, client_rpc_errors, total_requests, 0), - PB_FIELD( 3, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ClientStats, dropped_requests, client_rpc_errors, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v0_LoadBalanceResponse, initial_response, initial_response, &grpc_lb_v0_InitialLoadBalanceResponse_fields), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_LoadBalanceResponse, server_list, initial_response, &grpc_lb_v0_ServerList_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_InitialLoadBalanceResponse, client_config, client_config, 0), - PB_FIELD( 2, STRING , OPTIONAL, STATIC , OTHER, grpc_lb_v0_InitialLoadBalanceResponse, load_balancer_delegate, client_config, 0), - PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval, load_balancer_delegate, &grpc_lb_v0_Duration_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_ServerList_fields[3] = { - PB_FIELD( 1, MESSAGE , REPEATED, CALLBACK, FIRST, grpc_lb_v0_ServerList, servers, servers, &grpc_lb_v0_Server_fields), - PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ServerList, expiration_interval, servers, &grpc_lb_v0_Duration_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_Server_fields[5] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_Server, ip_address, ip_address, 0), - PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, port, ip_address, 0), - PB_FIELD( 3, BYTES , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, load_balance_token, port, 0), - PB_FIELD( 4, BOOL , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, drop_request, load_balance_token, 0), - PB_LAST_FIELD -}; - - -/* Check that field information fits in pb_field_t */ -#if !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_32BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in 8 or 16 bit - * field descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 65536 && pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval) < 65536 && pb_membersize(grpc_lb_v0_ServerList, servers) < 65536 && pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) -#endif - -#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_16BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in the default - * 8 bit descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 256 && pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval) < 256 && pb_membersize(grpc_lb_v0_ServerList, servers) < 256 && pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) -#endif - - diff --git a/src/core/proto/load_balancer.pb.h b/src/core/proto/load_balancer.pb.h deleted file mode 100644 index 26404a8982..0000000000 --- a/src/core/proto/load_balancer.pb.h +++ /dev/null @@ -1,150 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.4-dev at Wed Nov 11 15:38:23 2015. */ - -#ifndef PB_LOAD_BALANCER_PB_H_INCLUDED -#define PB_LOAD_BALANCER_PB_H_INCLUDED -#include "third_party/nanopb/pb.h" -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Enum definitions */ -/* Struct definitions */ -typedef struct _grpc_lb_v0_ClientStats { - bool has_total_requests; - int64_t total_requests; - bool has_client_rpc_errors; - int64_t client_rpc_errors; - bool has_dropped_requests; - int64_t dropped_requests; -} grpc_lb_v0_ClientStats; - -typedef struct _grpc_lb_v0_Duration { - bool has_seconds; - int64_t seconds; - bool has_nanos; - int32_t nanos; -} grpc_lb_v0_Duration; - -typedef struct _grpc_lb_v0_InitialLoadBalanceRequest { - bool has_name; - char name[128]; -} grpc_lb_v0_InitialLoadBalanceRequest; - -typedef PB_BYTES_ARRAY_T(64) grpc_lb_v0_Server_load_balance_token_t; -typedef struct _grpc_lb_v0_Server { - bool has_ip_address; - char ip_address[46]; - bool has_port; - int32_t port; - bool has_load_balance_token; - grpc_lb_v0_Server_load_balance_token_t load_balance_token; - bool has_drop_request; - bool drop_request; -} grpc_lb_v0_Server; - -typedef struct _grpc_lb_v0_InitialLoadBalanceResponse { - bool has_client_config; - char client_config[64]; - bool has_load_balancer_delegate; - char load_balancer_delegate[64]; - bool has_client_stats_report_interval; - grpc_lb_v0_Duration client_stats_report_interval; -} grpc_lb_v0_InitialLoadBalanceResponse; - -typedef struct _grpc_lb_v0_LoadBalanceRequest { - bool has_initial_request; - grpc_lb_v0_InitialLoadBalanceRequest initial_request; - bool has_client_stats; - grpc_lb_v0_ClientStats client_stats; -} grpc_lb_v0_LoadBalanceRequest; - -typedef struct _grpc_lb_v0_ServerList { - pb_callback_t servers; - bool has_expiration_interval; - grpc_lb_v0_Duration expiration_interval; -} grpc_lb_v0_ServerList; - -typedef struct _grpc_lb_v0_LoadBalanceResponse { - bool has_initial_response; - grpc_lb_v0_InitialLoadBalanceResponse initial_response; - bool has_server_list; - grpc_lb_v0_ServerList server_list; -} grpc_lb_v0_LoadBalanceResponse; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define grpc_lb_v0_Duration_init_default {false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceRequest_init_default {false, grpc_lb_v0_InitialLoadBalanceRequest_init_default, false, grpc_lb_v0_ClientStats_init_default} -#define grpc_lb_v0_InitialLoadBalanceRequest_init_default {false, ""} -#define grpc_lb_v0_ClientStats_init_default {false, 0, false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceResponse_init_default {false, grpc_lb_v0_InitialLoadBalanceResponse_init_default, false, grpc_lb_v0_ServerList_init_default} -#define grpc_lb_v0_InitialLoadBalanceResponse_init_default {false, "", false, "", false, grpc_lb_v0_Duration_init_default} -#define grpc_lb_v0_ServerList_init_default {{{NULL}, NULL}, false, grpc_lb_v0_Duration_init_default} -#define grpc_lb_v0_Server_init_default {false, "", false, 0, false, {0, {0}}, false, 0} -#define grpc_lb_v0_Duration_init_zero {false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceRequest_init_zero {false, grpc_lb_v0_InitialLoadBalanceRequest_init_zero, false, grpc_lb_v0_ClientStats_init_zero} -#define grpc_lb_v0_InitialLoadBalanceRequest_init_zero {false, ""} -#define grpc_lb_v0_ClientStats_init_zero {false, 0, false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceResponse_init_zero {false, grpc_lb_v0_InitialLoadBalanceResponse_init_zero, false, grpc_lb_v0_ServerList_init_zero} -#define grpc_lb_v0_InitialLoadBalanceResponse_init_zero {false, "", false, "", false, grpc_lb_v0_Duration_init_zero} -#define grpc_lb_v0_ServerList_init_zero {{{NULL}, NULL}, false, grpc_lb_v0_Duration_init_zero} -#define grpc_lb_v0_Server_init_zero {false, "", false, 0, false, {0, {0}}, false, 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define grpc_lb_v0_ClientStats_total_requests_tag 1 -#define grpc_lb_v0_ClientStats_client_rpc_errors_tag 2 -#define grpc_lb_v0_ClientStats_dropped_requests_tag 3 -#define grpc_lb_v0_Duration_seconds_tag 1 -#define grpc_lb_v0_Duration_nanos_tag 2 -#define grpc_lb_v0_InitialLoadBalanceRequest_name_tag 1 -#define grpc_lb_v0_Server_ip_address_tag 1 -#define grpc_lb_v0_Server_port_tag 2 -#define grpc_lb_v0_Server_load_balance_token_tag 3 -#define grpc_lb_v0_Server_drop_request_tag 4 -#define grpc_lb_v0_InitialLoadBalanceResponse_client_config_tag 1 -#define grpc_lb_v0_InitialLoadBalanceResponse_load_balancer_delegate_tag 2 -#define grpc_lb_v0_InitialLoadBalanceResponse_client_stats_report_interval_tag 3 -#define grpc_lb_v0_LoadBalanceRequest_initial_request_tag 1 -#define grpc_lb_v0_LoadBalanceRequest_client_stats_tag 2 -#define grpc_lb_v0_ServerList_servers_tag 1 -#define grpc_lb_v0_ServerList_expiration_interval_tag 3 -#define grpc_lb_v0_LoadBalanceResponse_initial_response_tag 1 -#define grpc_lb_v0_LoadBalanceResponse_server_list_tag 2 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t grpc_lb_v0_Duration_fields[3]; -extern const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3]; -extern const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2]; -extern const pb_field_t grpc_lb_v0_ClientStats_fields[4]; -extern const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3]; -extern const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4]; -extern const pb_field_t grpc_lb_v0_ServerList_fields[3]; -extern const pb_field_t grpc_lb_v0_Server_fields[5]; - -/* Maximum encoded size of messages (where known) */ -#define grpc_lb_v0_Duration_size 22 -#define grpc_lb_v0_LoadBalanceRequest_size 169 -#define grpc_lb_v0_InitialLoadBalanceRequest_size 131 -#define grpc_lb_v0_ClientStats_size 33 -#define grpc_lb_v0_InitialLoadBalanceResponse_size 156 -#define grpc_lb_v0_Server_size 127 - -/* Message IDs (where set with "msgid" option) */ -#ifdef PB_MSGID - -#define LOAD_BALANCER_MESSAGES \ - - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.c b/src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.c deleted file mode 100644 index b225b09450..0000000000 --- a/src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.c +++ /dev/null @@ -1,87 +0,0 @@ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.4-dev at Wed Nov 11 15:31:24 2015. */ - -#include "load_balancer.pb.h" - -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - - - -const pb_field_t grpc_lb_v0_Duration_fields[3] = { - PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v0_Duration, seconds, seconds, 0), - PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Duration, nanos, seconds, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v0_LoadBalanceRequest, initial_request, initial_request, &grpc_lb_v0_InitialLoadBalanceRequest_fields), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_LoadBalanceRequest, client_stats, initial_request, &grpc_lb_v0_ClientStats_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_InitialLoadBalanceRequest, name, name, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_ClientStats_fields[4] = { - PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v0_ClientStats, total_requests, total_requests, 0), - PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ClientStats, client_rpc_errors, total_requests, 0), - PB_FIELD( 3, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ClientStats, dropped_requests, client_rpc_errors, 0), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3] = { - PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v0_LoadBalanceResponse, initial_response, initial_response, &grpc_lb_v0_InitialLoadBalanceResponse_fields), - PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_LoadBalanceResponse, server_list, initial_response, &grpc_lb_v0_ServerList_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_InitialLoadBalanceResponse, client_config, client_config, 0), - PB_FIELD( 2, STRING , OPTIONAL, STATIC , OTHER, grpc_lb_v0_InitialLoadBalanceResponse, load_balancer_delegate, client_config, 0), - PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval, load_balancer_delegate, &grpc_lb_v0_Duration_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_ServerList_fields[3] = { - PB_FIELD( 1, MESSAGE , REPEATED, CALLBACK, FIRST, grpc_lb_v0_ServerList, servers, servers, &grpc_lb_v0_Server_fields), - PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v0_ServerList, expiration_interval, servers, &grpc_lb_v0_Duration_fields), - PB_LAST_FIELD -}; - -const pb_field_t grpc_lb_v0_Server_fields[5] = { - PB_FIELD( 1, STRING , OPTIONAL, STATIC , FIRST, grpc_lb_v0_Server, ip_address, ip_address, 0), - PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, port, ip_address, 0), - PB_FIELD( 3, BYTES , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, load_balance_token, port, 0), - PB_FIELD( 4, BOOL , OPTIONAL, STATIC , OTHER, grpc_lb_v0_Server, drop_request, load_balance_token, 0), - PB_LAST_FIELD -}; - - -/* Check that field information fits in pb_field_t */ -#if !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_32BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in 8 or 16 bit - * field descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 65536 && pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval) < 65536 && pb_membersize(grpc_lb_v0_ServerList, servers) < 65536 && pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) -#endif - -#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_16BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in the default - * 8 bit descriptors. - */ -PB_STATIC_ASSERT((pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 256 && pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval) < 256 && pb_membersize(grpc_lb_v0_ServerList, servers) < 256 && pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) -#endif - - diff --git a/src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.h b/src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.h deleted file mode 100644 index d8196302a8..0000000000 --- a/src/core/proto/src/core/client_config/lb_policies/proto/load_balancer.pb.h +++ /dev/null @@ -1,150 +0,0 @@ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.4-dev at Wed Nov 11 15:31:24 2015. */ - -#ifndef PB_LOAD_BALANCER_PB_H_INCLUDED -#define PB_LOAD_BALANCER_PB_H_INCLUDED -#include "third_party/nanopb/pb.h" -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Enum definitions */ -/* Struct definitions */ -typedef struct _grpc_lb_v0_ClientStats { - bool has_total_requests; - int64_t total_requests; - bool has_client_rpc_errors; - int64_t client_rpc_errors; - bool has_dropped_requests; - int64_t dropped_requests; -} grpc_lb_v0_ClientStats; - -typedef struct _grpc_lb_v0_Duration { - bool has_seconds; - int64_t seconds; - bool has_nanos; - int32_t nanos; -} grpc_lb_v0_Duration; - -typedef struct _grpc_lb_v0_InitialLoadBalanceRequest { - bool has_name; - char name[128]; -} grpc_lb_v0_InitialLoadBalanceRequest; - -typedef PB_BYTES_ARRAY_T(64) grpc_lb_v0_Server_load_balance_token_t; -typedef struct _grpc_lb_v0_Server { - bool has_ip_address; - char ip_address[46]; - bool has_port; - int32_t port; - bool has_load_balance_token; - grpc_lb_v0_Server_load_balance_token_t load_balance_token; - bool has_drop_request; - bool drop_request; -} grpc_lb_v0_Server; - -typedef struct _grpc_lb_v0_InitialLoadBalanceResponse { - bool has_client_config; - char client_config[64]; - bool has_load_balancer_delegate; - char load_balancer_delegate[64]; - bool has_client_stats_report_interval; - grpc_lb_v0_Duration client_stats_report_interval; -} grpc_lb_v0_InitialLoadBalanceResponse; - -typedef struct _grpc_lb_v0_LoadBalanceRequest { - bool has_initial_request; - grpc_lb_v0_InitialLoadBalanceRequest initial_request; - bool has_client_stats; - grpc_lb_v0_ClientStats client_stats; -} grpc_lb_v0_LoadBalanceRequest; - -typedef struct _grpc_lb_v0_ServerList { - pb_callback_t servers; - bool has_expiration_interval; - grpc_lb_v0_Duration expiration_interval; -} grpc_lb_v0_ServerList; - -typedef struct _grpc_lb_v0_LoadBalanceResponse { - bool has_initial_response; - grpc_lb_v0_InitialLoadBalanceResponse initial_response; - bool has_server_list; - grpc_lb_v0_ServerList server_list; -} grpc_lb_v0_LoadBalanceResponse; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define grpc_lb_v0_Duration_init_default {false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceRequest_init_default {false, grpc_lb_v0_InitialLoadBalanceRequest_init_default, false, grpc_lb_v0_ClientStats_init_default} -#define grpc_lb_v0_InitialLoadBalanceRequest_init_default {false, ""} -#define grpc_lb_v0_ClientStats_init_default {false, 0, false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceResponse_init_default {false, grpc_lb_v0_InitialLoadBalanceResponse_init_default, false, grpc_lb_v0_ServerList_init_default} -#define grpc_lb_v0_InitialLoadBalanceResponse_init_default {false, "", false, "", false, grpc_lb_v0_Duration_init_default} -#define grpc_lb_v0_ServerList_init_default {{{NULL}, NULL}, false, grpc_lb_v0_Duration_init_default} -#define grpc_lb_v0_Server_init_default {false, "", false, 0, false, {0, {0}}, false, 0} -#define grpc_lb_v0_Duration_init_zero {false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceRequest_init_zero {false, grpc_lb_v0_InitialLoadBalanceRequest_init_zero, false, grpc_lb_v0_ClientStats_init_zero} -#define grpc_lb_v0_InitialLoadBalanceRequest_init_zero {false, ""} -#define grpc_lb_v0_ClientStats_init_zero {false, 0, false, 0, false, 0} -#define grpc_lb_v0_LoadBalanceResponse_init_zero {false, grpc_lb_v0_InitialLoadBalanceResponse_init_zero, false, grpc_lb_v0_ServerList_init_zero} -#define grpc_lb_v0_InitialLoadBalanceResponse_init_zero {false, "", false, "", false, grpc_lb_v0_Duration_init_zero} -#define grpc_lb_v0_ServerList_init_zero {{{NULL}, NULL}, false, grpc_lb_v0_Duration_init_zero} -#define grpc_lb_v0_Server_init_zero {false, "", false, 0, false, {0, {0}}, false, 0} - -/* Field tags (for use in manual encoding/decoding) */ -#define grpc_lb_v0_ClientStats_total_requests_tag 1 -#define grpc_lb_v0_ClientStats_client_rpc_errors_tag 2 -#define grpc_lb_v0_ClientStats_dropped_requests_tag 3 -#define grpc_lb_v0_Duration_seconds_tag 1 -#define grpc_lb_v0_Duration_nanos_tag 2 -#define grpc_lb_v0_InitialLoadBalanceRequest_name_tag 1 -#define grpc_lb_v0_Server_ip_address_tag 1 -#define grpc_lb_v0_Server_port_tag 2 -#define grpc_lb_v0_Server_load_balance_token_tag 3 -#define grpc_lb_v0_Server_drop_request_tag 4 -#define grpc_lb_v0_InitialLoadBalanceResponse_client_config_tag 1 -#define grpc_lb_v0_InitialLoadBalanceResponse_load_balancer_delegate_tag 2 -#define grpc_lb_v0_InitialLoadBalanceResponse_client_stats_report_interval_tag 3 -#define grpc_lb_v0_LoadBalanceRequest_initial_request_tag 1 -#define grpc_lb_v0_LoadBalanceRequest_client_stats_tag 2 -#define grpc_lb_v0_ServerList_servers_tag 1 -#define grpc_lb_v0_ServerList_expiration_interval_tag 3 -#define grpc_lb_v0_LoadBalanceResponse_initial_response_tag 1 -#define grpc_lb_v0_LoadBalanceResponse_server_list_tag 2 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t grpc_lb_v0_Duration_fields[3]; -extern const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3]; -extern const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2]; -extern const pb_field_t grpc_lb_v0_ClientStats_fields[4]; -extern const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3]; -extern const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4]; -extern const pb_field_t grpc_lb_v0_ServerList_fields[3]; -extern const pb_field_t grpc_lb_v0_Server_fields[5]; - -/* Maximum encoded size of messages (where known) */ -#define grpc_lb_v0_Duration_size 22 -#define grpc_lb_v0_LoadBalanceRequest_size 169 -#define grpc_lb_v0_InitialLoadBalanceRequest_size 131 -#define grpc_lb_v0_ClientStats_size 33 -#define grpc_lb_v0_InitialLoadBalanceResponse_size 156 -#define grpc_lb_v0_Server_size 127 - -/* Message IDs (where set with "msgid" option) */ -#ifdef PB_MSGID - -#define LOAD_BALANCER_MESSAGES \ - - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/proto/grpc/lb/v0/load_balancer.options b/src/proto/grpc/lb/v0/load_balancer.options new file mode 100644 index 0000000000..6d4528f838 --- /dev/null +++ b/src/proto/grpc/lb/v0/load_balancer.options @@ -0,0 +1,6 @@ +grpc.lb.v0.InitialLoadBalanceRequest.name max_size:128 +grpc.lb.v0.InitialLoadBalanceResponse.client_config max_size:64 +grpc.lb.v0.InitialLoadBalanceResponse.load_balancer_delegate max_size:64 +grpc.lb.v0.Server.ip_address max_size:46 +grpc.lb.v0.Server.load_balance_token max_size:64 +load_balancer.proto no_unions:true diff --git a/src/proto/grpc/lb/v0/load_balancer.proto b/src/proto/grpc/lb/v0/load_balancer.proto new file mode 100644 index 0000000000..6c96e8d52c --- /dev/null +++ b/src/proto/grpc/lb/v0/load_balancer.proto @@ -0,0 +1,115 @@ +syntax = "proto3"; + +package grpc.lb.v0; + +message Duration { + + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. + int64 seconds = 1; + + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + int32 nanos = 2; +} + +service LoadBalancer { + // Bidirectional rpc to get a list of servers. + rpc BalanceLoad(stream LoadBalanceRequest) + returns (stream LoadBalanceResponse); +} + +message LoadBalanceRequest { + oneof load_balance_request_type { + // This message should be sent on the first request to the load balancer. + InitialLoadBalanceRequest initial_request = 1; + + // The client stats should be periodically reported to the load balancer + // based on the duration defined in the InitialLoadBalanceResponse. + ClientStats client_stats = 2; + } +} + +message InitialLoadBalanceRequest { + // Name of load balanced service (IE, service.grpc.gslb.google.com) + string name = 1; +} + +// Contains client level statistics that are useful to load balancing. Each +// count should be reset to zero after reporting the stats. +message ClientStats { + // The total number of requests sent by the client since the last report. + int64 total_requests = 1; + + // The number of client rpc errors since the last report. + int64 client_rpc_errors = 2; + + // The number of dropped requests since the last report. + int64 dropped_requests = 3; +} + +message LoadBalanceResponse { + oneof load_balance_response_type { + // This message should be sent on the first response to the client. + InitialLoadBalanceResponse initial_response = 1; + + // Contains the list of servers selected by the load balancer. The client + // should send requests to these servers in the specified order. + ServerList server_list = 2; + } +} + +message InitialLoadBalanceResponse { + oneof initial_response_type { + // Contains gRPC config options like RPC deadline or flow control. + // TODO(yetianx): Change to ClientConfig after it is defined. + string client_config = 1; + + // This is an application layer redirect that indicates the client should + // use the specified server for load balancing. When this field is set in + // the response, the client should open a separate connection to the + // load_balancer_delegate and call the BalanceLoad method. + string load_balancer_delegate = 2; + } + + // This interval defines how often the client should send the client stats + // to the load balancer. Stats should only be reported when the duration is + // positive. + Duration client_stats_report_interval = 3; +} + +message ServerList { + // Contains a list of servers selected by the load balancer. The list will + // be updated when server resolutions change or as needed to balance load + // across more servers. The client should consume the server list in order + // unless instructed otherwise via the client_config. + repeated Server servers = 1; + + // Indicates the amount of time that the client should consider this server + // list as valid. It may be considered stale after waiting this interval of + // time after receiving the list. If the interval is not positive, the + // client can assume the list is valid until the next list is received. + Duration expiration_interval = 3; +} + +message Server { + // A resolved address and port for the server. The IP address string may + // either be an IPv4 or IPv6 address. + string ip_address = 1; + int32 port = 2; + + // An opaque token that is passed from the client to the server in metadata. + // The server may expect this token to indicate that the request from the + // client was load balanced. + // TODO(yetianx): Not used right now, and will be used after implementing + // load report. + bytes load_balance_token = 3; + + // Indicates whether this particular request should be dropped by the client + // when this server is chosen from the list. + bool drop_request = 4; +} diff --git a/templates/tools/run_tests/sources_and_headers.json.template b/templates/tools/run_tests/sources_and_headers.json.template index ba1c5a5ef8..6ceb3731fb 100644 --- a/templates/tools/run_tests/sources_and_headers.json.template +++ b/templates/tools/run_tests/sources_and_headers.json.template @@ -12,20 +12,27 @@ out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h']) return out - def no_protos(src): + def no_protos_filter(src): + return os.path.splitext(src)[1] != '.proto' + + def no_third_party_filter(src): + return not src.startswith('third_party/') + + def filter_srcs(srcs, filters): out = [] - for f in src: - if os.path.splitext(f)[1] != '.proto': - out.append(f) + for s in srcs: + filter_passes = (f(s) for f in filters) + if all(filter_passes): + out.append(s) return out %> ${json.dumps([{"name": tgt.name, "language": tgt.language, "src": sorted( - no_protos(tgt.src) + - tgt.get('public_headers', []) + - tgt.get('headers', [])), + filter_srcs(tgt.src, (no_protos_filter, no_third_party_filter)) + + filter_srcs(tgt.get('public_headers', []), (no_protos_filter, no_third_party_filter)) + + filter_srcs(tgt.get('headers', []), (no_third_party_filter,))), "headers": sorted( tgt.get('public_headers', []) + tgt.get('headers', []) + diff --git a/test/cpp/grpclb/grpclb_api_test.cc b/test/cpp/grpclb/grpclb_api_test.cc index 5255da3786..98a50a4303 100644 --- a/test/cpp/grpclb/grpclb_api_test.cc +++ b/test/cpp/grpclb/grpclb_api_test.cc @@ -35,7 +35,7 @@ #include #include "src/core/client_config/lb_policies/load_balancer_api.h" -#include "src/core/client_config/lb_policies/proto/load_balancer.pb.h" +#include "src/proto/grpc/lb/v0/load_balancer.pb.h" // C++ version namespace grpc { namespace { @@ -69,9 +69,9 @@ TEST_F(GrpclbTest, ParseResponse) { client_stats_report_interval->set_nanos(456); const std::string encoded_response = response.SerializeAsString(); - gpr_slice encoded_slice = gpr_slice_from_copied_string(encoded_response.c_str()); - grpc_grpclb_response* c_response = - grpc_grpclb_response_parse(encoded_slice); + gpr_slice encoded_slice = + gpr_slice_from_copied_string(encoded_response.c_str()); + grpc_grpclb_response* c_response = grpc_grpclb_response_parse(encoded_slice); EXPECT_TRUE(c_response->has_initial_response); EXPECT_TRUE(c_response->initial_response.has_client_config); EXPECT_FALSE(c_response->initial_response.has_load_balancer_delegate); @@ -101,8 +101,9 @@ TEST_F(GrpclbTest, ParseResponseServerList) { expiration_interval->set_nanos(999); const std::string encoded_response = response.SerializeAsString(); - gpr_slice encoded_slice = gpr_slice_from_copied_string(encoded_response.c_str()); - grpc_grpclb_serverlist *c_serverlist = + gpr_slice encoded_slice = + gpr_slice_from_copied_string(encoded_response.c_str()); + grpc_grpclb_serverlist* c_serverlist = grpc_grpclb_response_parse_serverlist(encoded_slice); ASSERT_EQ(c_serverlist->num_servers, 2ul); EXPECT_TRUE(c_serverlist->servers[0]->has_ip_address); diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index 20fddf14f3..1c5384d835 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -2,7 +2,7 @@ # # Example usage: # tools/codegen/core/gen_load_balancing_proto.sh \ -# src/core/client_config/lb_policies/proto/load_balancer.proto +# src/proto/grpc/lb/v0/load_balancer.proto if [ $# -eq 0 ]; then echo "Usage: $0 " @@ -26,7 +26,13 @@ pushd "$(dirname $1)" > /dev/null protoc \ --plugin=protoc-gen-nanopb="$GRPC_ROOT/third_party/nanopb/generator/protoc-gen-nanopb" \ ---nanopb_out='-L#include\ \"third_party/nanopb/pb.h\"'":$GRPC_ROOT/src/core/proto" \ +--nanopb_out='-L#include\ \"third_party/nanopb/pb.h\"'":$GRPC_ROOT/src/core/proto/grpc/lb/v0" \ "$(basename $1)" +readonly PROTO_BASENAME=$(basename $1 .proto) +sed -i "s:$PROTO_BASENAME.pb.h:src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.h:g" \ + "$GRPC_ROOT/src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.c" +clang-format -i "$GRPC_ROOT/src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.c" +clang-format -i "$GRPC_ROOT/src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.h" + popd > /dev/null diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index cca2a0c079..de1d3335a7 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -856,7 +856,7 @@ src/core/json/json.h \ src/core/json/json_common.h \ src/core/json/json_reader.h \ src/core/json/json_writer.h \ -src/core/proto/load_balancer.pb.h \ +src/core/proto/grpc/lb/v0/load_balancer.pb.h \ src/core/statistics/census_interface.h \ src/core/statistics/census_rpc_stats.h \ src/core/surface/api_trace.h \ @@ -896,13 +896,13 @@ src/core/transport/metadata_batch.h \ src/core/transport/static_metadata.h \ src/core/transport/transport.h \ src/core/transport/transport_impl.h \ +src/core/census/aggregation.h \ +src/core/census/context.h \ +src/core/census/rpc_metric_id.h \ third_party/nanopb/pb.h \ third_party/nanopb/pb_common.h \ third_party/nanopb/pb_decode.h \ third_party/nanopb/pb_encode.h \ -src/core/census/aggregation.h \ -src/core/census/context.h \ -src/core/census/rpc_metric_id.h \ src/core/httpcli/httpcli_security_connector.c \ src/core/security/base64.c \ src/core/security/client_auth_filter.c \ @@ -1003,7 +1003,7 @@ src/core/json/json.c \ src/core/json/json_reader.c \ src/core/json/json_string.c \ src/core/json/json_writer.c \ -src/core/proto/load_balancer.pb.c \ +src/core/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_reader.c \ @@ -1051,13 +1051,13 @@ src/core/transport/metadata_batch.c \ src/core/transport/static_metadata.c \ src/core/transport/transport.c \ src/core/transport/transport_op_string.c \ -third_party/nanopb/pb_common.c \ -third_party/nanopb/pb_decode.c \ -third_party/nanopb/pb_encode.c \ src/core/census/context.c \ src/core/census/initialize.c \ src/core/census/operation.c \ src/core/census/tracing.c \ +third_party/nanopb/pb_common.c \ +third_party/nanopb/pb_decode.c \ +third_party/nanopb/pb_encode.c \ include/grpc/support/alloc.h \ include/grpc/support/atm.h \ include/grpc/support/atm_gcc_atomic.h \ diff --git a/tools/run_tests/run_sanity.sh b/tools/run_tests/run_sanity.sh index 690332daae..8170cff777 100755 --- a/tools/run_tests/run_sanity.sh +++ b/tools/run_tests/run_sanity.sh @@ -44,6 +44,7 @@ cat << EOF | awk '{ print $1 }' | sort > $want_submodules 9f897b25800d2f54f5c442ef01a60721aeca6d87 third_party/boringssl (version_for_cocoapods_1.0-67-g9f897b2) 05b155ff59114735ec8cd089f669c4c3d8f59029 third_party/gflags (v2.1.0-45-g05b155f) c99458533a9b4c743ed51537e25989ea55944908 third_party/googletest (release-1.7.0) + 5497a1dfc91a86965383cdd1652e348345400435 third_party/nanopb (nanopb-0.3.3-10-g5497a1d) 8fce8933649ce09c1661ff2b5b7f6eb79badd251 third_party/protobuf (v3.0.0-alpha-4-1-g8fce893) 50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8) EOF diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 075cd0c9c2..73d1a63bf1 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -1592,8 +1592,8 @@ "grpc++" ], "headers": [ - "src/core/client_config/lb_policies/proto/load_balancer.grpc.pb.h", - "src/core/client_config/lb_policies/proto/load_balancer.pb.h" + "src/proto/grpc/lb/v0/load_balancer.grpc.pb.h", + "src/proto/grpc/lb/v0/load_balancer.pb.h" ], "language": "c++", "name": "grpclb_api_test", @@ -2947,7 +2947,7 @@ "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/security/auth_filters.h", "src/core/security/base64.h", "src/core/security/credentials.h", @@ -3178,8 +3178,8 @@ "src/core/json/json_string.c", "src/core/json/json_writer.c", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.c", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/security/auth_filters.h", "src/core/security/base64.c", "src/core/security/base64.h", @@ -3299,14 +3299,7 @@ "src/core/tsi/ssl_types.h", "src/core/tsi/transport_security.c", "src/core/tsi/transport_security.h", - "src/core/tsi/transport_security_interface.h", - "third_party/nanopb/pb.h", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_common.h", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_decode.h", - "third_party/nanopb/pb_encode.c", - "third_party/nanopb/pb_encode.h" + "src/core/tsi/transport_security_interface.h" ] }, { @@ -3476,7 +3469,7 @@ "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.h", @@ -3691,8 +3684,8 @@ "src/core/json/json_string.c", "src/core/json/json_writer.c", "src/core/json/json_writer.h", - "src/core/proto/load_balancer.pb.c", - "src/core/proto/load_balancer.pb.h", + "src/core/proto/grpc/lb/v0/load_balancer.pb.c", + "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.c", @@ -3779,14 +3772,7 @@ "src/core/transport/transport.c", "src/core/transport/transport.h", "src/core/transport/transport_impl.h", - "src/core/transport/transport_op_string.c", - "third_party/nanopb/pb.h", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_common.h", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_decode.h", - "third_party/nanopb/pb_encode.c", - "third_party/nanopb/pb_encode.h" + "src/core/transport/transport_op_string.c" ] }, { diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index 814bfe74bb..106c1b5f9f 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -363,7 +363,7 @@ - + @@ -403,13 +403,13 @@ + + + - - - @@ -612,7 +612,7 @@ - + @@ -708,12 +708,6 @@ - - - - - - @@ -722,6 +716,12 @@ + + + + + + diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 06bb887153..107f195d5c 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -301,8 +301,8 @@ src\core\json - - src\core\proto + + src\core\proto\grpc\lb\v0 src\core\surface @@ -445,15 +445,6 @@ src\core\transport - - third_party\nanopb - - - third_party\nanopb - - - third_party\nanopb - src\core\census @@ -466,6 +457,15 @@ src\core\census + + third_party\nanopb + + + third_party\nanopb + + + third_party\nanopb + @@ -758,8 +758,8 @@ src\core\json - - src\core\proto + + src\core\proto\grpc\lb\v0 src\core\statistics @@ -878,6 +878,15 @@ src\core\transport + + src\core\census + + + src\core\census + + + src\core\census + third_party\nanopb @@ -890,15 +899,6 @@ third_party\nanopb - - src\core\census - - - src\core\census - - - src\core\census - @@ -947,6 +947,15 @@ {1ff04466-0905-8a5d-d6f4-7ff2df4c13b5} + + {7c7ad0b3-bf85-5bd3-e0c8-4f5468a8e2e6} + + + {3d533dad-8100-e8a3-b7c3-1fc13a4d60da} + + + {0ffcf868-7617-5fed-b6ce-2162d9d09148} + {1d850ac6-e639-4eab-5338-4ba40272fcc9} diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index fe74addb40..8c062c797b 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -341,7 +341,7 @@ - + @@ -381,13 +381,13 @@ + + + - - - @@ -550,7 +550,7 @@ - + @@ -646,12 +646,6 @@ - - - - - - @@ -660,6 +654,12 @@ + + + + + + diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index f4be06d8e7..56d451ef29 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -241,8 +241,8 @@ src\core\json - - src\core\proto + + src\core\proto\grpc\lb\v0 src\core\surface @@ -385,15 +385,6 @@ src\core\transport - - third_party\nanopb - - - third_party\nanopb - - - third_party\nanopb - src\core\census @@ -406,6 +397,15 @@ src\core\census + + third_party\nanopb + + + third_party\nanopb + + + third_party\nanopb + @@ -653,8 +653,8 @@ src\core\json - - src\core\proto + + src\core\proto\grpc\lb\v0 src\core\statistics @@ -773,6 +773,15 @@ src\core\transport + + src\core\census + + + src\core\census + + + src\core\census + third_party\nanopb @@ -785,15 +794,6 @@ third_party\nanopb - - src\core\census - - - src\core\census - - - src\core\census - @@ -842,6 +842,15 @@ {7f4bb22a-65ba-0f8f-6387-66b1f6677a80} + + {9c2bd164-c317-8a13-564d-3b28b0fd79cf} + + + {2bad8e10-4fc5-d8b3-e026-4abbd0c25cda} + + + {4475c8ed-e01b-8906-47d0-8a504189c0d5} + {e084164c-a069-00e3-db35-4e0b1cd6f0b7} diff --git a/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj b/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj index b8f4c121db..0f57b28e96 100644 --- a/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj +++ b/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj @@ -158,13 +158,13 @@ - + - + - + - + diff --git a/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj.filters b/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj.filters index e561eaeb73..6c57b8c162 100644 --- a/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj.filters +++ b/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj.filters @@ -1,8 +1,8 @@ - - src\core\client_config\lb_policies\proto + + src\proto\grpc\lb\v0 test\cpp\grpclb @@ -13,17 +13,17 @@ {a31d21fb-c6ab-75ce-43dc-7d6f506765e6} - - {1ac58546-6910-9066-c5c0-fe8db59c641f} + + {10d49c90-8503-9b10-6678-eed983bc25d9} - - {9b998f5c-bc1b-9fc5-d21b-368485aac585} + + {8b6be783-e071-44cc-2096-f1c476012556} - - {bb3a28b9-b005-fd49-9cc3-8ee9552226c1} + + {2981699e-c196-c599-bc17-c177770f89ee} - - {b555558c-3db4-9746-b58e-40ccc1680c8a} + + {3d04774a-1c2f-e100-435e-08af5d539250} {64736e1d-eb77-664f-34ab-6cf41263d3d8} -- cgit v1.2.3 From 82a0aabb7a6a4f0852bb02cef3a5f079d386fbac Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 11 Jan 2016 15:51:03 -0800 Subject: added sanity scripts and checks --- src/core/proto/grpc/lb/v0/load_balancer.pb.c | 2 +- src/core/proto/grpc/lb/v0/load_balancer.pb.h | 2 +- tools/codegen/core/gen_load_balancing_proto.sh | 30 ++++++++---- tools/distrib/check_nanopb_output.sh | 66 ++++++++++++++++++++++++++ tools/run_tests/run_sanity.sh | 2 +- 5 files changed, 90 insertions(+), 12 deletions(-) create mode 100755 tools/distrib/check_nanopb_output.sh (limited to 'tools/codegen/core') diff --git a/src/core/proto/grpc/lb/v0/load_balancer.pb.c b/src/core/proto/grpc/lb/v0/load_balancer.pb.c index 4c1d5c3b2c..304bbb1c12 100644 --- a/src/core/proto/grpc/lb/v0/load_balancer.pb.c +++ b/src/core/proto/grpc/lb/v0/load_balancer.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.4-dev at Mon Jan 11 12:57:20 2016. */ +/* Generated by nanopb-0.3.4-dev */ #include "src/core/proto/grpc/lb/v0/load_balancer.pb.h" diff --git a/src/core/proto/grpc/lb/v0/load_balancer.pb.h b/src/core/proto/grpc/lb/v0/load_balancer.pb.h index a4c4b5f6dc..775100546a 100644 --- a/src/core/proto/grpc/lb/v0/load_balancer.pb.h +++ b/src/core/proto/grpc/lb/v0/load_balancer.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.4-dev at Mon Jan 11 12:57:20 2016. */ +/* Generated by nanopb-0.3.4-dev */ #ifndef PB_LOAD_BALANCER_PB_H_INCLUDED #define PB_LOAD_BALANCER_PB_H_INCLUDED diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index 1c5384d835..8bd8ac7742 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -4,35 +4,47 @@ # tools/codegen/core/gen_load_balancing_proto.sh \ # src/proto/grpc/lb/v0/load_balancer.proto +set -ex if [ $# -eq 0 ]; then - echo "Usage: $0 " + echo "Usage: $0 [output dir]" exit 1 fi +readonly GRPC_ROOT=$PWD + +OUTPUT_DIR="$GRPC_ROOT/src/core/proto/grpc/lb/v0" +if [ $# -eq 2 ]; then + mkdir -p "$2" + if [ $? != 0 ]; then + echo "Error creating output directory $2" + exit 2 + fi + OUTPUT_DIR="$2" +fi + readonly EXPECTED_OPTIONS_FILE_PATH="${1%.*}.options" if [[ ! -f "$1" ]]; then echo "Input proto file '$1' doesn't exist." - exit 2 + exit 3 fi if [[ ! -f "${EXPECTED_OPTIONS_FILE_PATH}" ]]; then echo "Expected nanopb options file '${EXPECTED_OPTIONS_FILE_PATH}' missing" - exit 3 + exit 4 fi -readonly GRPC_ROOT=$PWD - pushd "$(dirname $1)" > /dev/null protoc \ --plugin=protoc-gen-nanopb="$GRPC_ROOT/third_party/nanopb/generator/protoc-gen-nanopb" \ ---nanopb_out='-L#include\ \"third_party/nanopb/pb.h\"'":$GRPC_ROOT/src/core/proto/grpc/lb/v0" \ +--nanopb_out='-T -L#include\ \"third_party/nanopb/pb.h\"'":$OUTPUT_DIR" \ "$(basename $1)" readonly PROTO_BASENAME=$(basename $1 .proto) sed -i "s:$PROTO_BASENAME.pb.h:src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.h:g" \ - "$GRPC_ROOT/src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.c" -clang-format -i "$GRPC_ROOT/src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.c" -clang-format -i "$GRPC_ROOT/src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.h" + "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" + +clang-format -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" +clang-format -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" popd > /dev/null diff --git a/tools/distrib/check_nanopb_output.sh b/tools/distrib/check_nanopb_output.sh new file mode 100755 index 0000000000..d1d829d09d --- /dev/null +++ b/tools/distrib/check_nanopb_output.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# Copyright 2015-2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -ex + +readonly NANOPB_TMP_OUTPUT=$(mktemp -d) +readonly VENV_DIR=$(mktemp -d) +# create a virtualenv for nanopb's compiler +pushd $VENV_DIR +readonly VENV_NAME="nanopb-$(date '+%Y%m%d_%H%M%S_%N')" +virtualenv $VENV_NAME +. $VENV_NAME/bin/activate +popd + +# install proto3 +pip install protobuf==3.0.0b2 + +# change to root directory +cd $(dirname $0)/../.. + +# stack up and change to nanopb's proto generator directory +pushd third_party/nanopb/generator/proto +make + +# back to the root directory +popd + +# nanopb-compile the proto to a temp location +./tools/codegen/core/gen_load_balancing_proto.sh \ + src/proto/grpc/lb/v0/load_balancer.proto \ + $NANOPB_TMP_OUTPUT + +# compare outputs to checked compiled code +diff -rq $NANOPB_TMP_OUTPUT src/core/proto/grpc/lb/v0 +if [ $? != 0 ]; then + echo "Outputs differ: $NANOPB_TMP_OUTPUT vs src/core/proto/grpc/lb/v0" + exit 1 +fi +deactivate diff --git a/tools/run_tests/run_sanity.sh b/tools/run_tests/run_sanity.sh index 8170cff777..ac7d3cd22a 100755 --- a/tools/run_tests/run_sanity.sh +++ b/tools/run_tests/run_sanity.sh @@ -61,4 +61,4 @@ fi ./tools/buildgen/generate_projects.sh ./tools/distrib/check_copyright.py ./tools/distrib/clang_format_code.sh - +./tools/distrib/check_nanopb_output.sh -- cgit v1.2.3 From 0892fa6aa63915bf7d6cc7d949d73321f4bc0146 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 12 Jan 2016 16:22:34 -0800 Subject: Added copyright message to generated nanopb code --- .../client_config/lb_policies/load_balancer_api.c | 2 +- .../client_config/lb_policies/load_balancer_api.h | 2 +- test/cpp/grpclb/grpclb_api_test.cc | 2 +- tools/codegen/core/gen_load_balancing_proto.sh | 46 ++++++++++++++++++++++ 4 files changed, 49 insertions(+), 3 deletions(-) (limited to 'tools/codegen/core') diff --git a/src/core/client_config/lb_policies/load_balancer_api.c b/src/core/client_config/lb_policies/load_balancer_api.c index ea60944e07..a6b5785fe4 100644 --- a/src/core/client_config/lb_policies/load_balancer_api.c +++ b/src/core/client_config/lb_policies/load_balancer_api.c @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/core/client_config/lb_policies/load_balancer_api.h b/src/core/client_config/lb_policies/load_balancer_api.h index d539c3fe3d..4dbe1d6c22 100644 --- a/src/core/client_config/lb_policies/load_balancer_api.h +++ b/src/core/client_config/lb_policies/load_balancer_api.h @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/test/cpp/grpclb/grpclb_api_test.cc b/test/cpp/grpclb/grpclb_api_test.cc index 98a50a4303..bd4885fb4c 100644 --- a/test/cpp/grpclb/grpclb_api_test.cc +++ b/test/cpp/grpclb/grpclb_api_test.cc @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index 8bd8ac7742..60a685849f 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -4,6 +4,45 @@ # tools/codegen/core/gen_load_balancing_proto.sh \ # src/proto/grpc/lb/v0/load_balancer.proto +read -r -d '' COPYRIGHT <<'EOF' +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +EOF + +COPYRIGHT_FILE=$(mktemp) +echo "$COPYRIGHT" > $COPYRIGHT_FILE + set -ex if [ $# -eq 0 ]; then echo "Usage: $0 [output dir]" @@ -44,6 +83,13 @@ readonly PROTO_BASENAME=$(basename $1 .proto) sed -i "s:$PROTO_BASENAME.pb.h:src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.h:g" \ "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" +# prepend copyright +TMPFILE=$(mktemp) +cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" > $TMPFILE +mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" +cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" > $TMPFILE +mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" + clang-format -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" clang-format -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" -- cgit v1.2.3 From 3f8e7345352d543511c3e5e890761847743b0ce6 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 12 Jan 2016 16:26:09 -0800 Subject: Added missing copyrights --- src/core/proto/grpc/lb/v0/load_balancer.pb.c | 32 ++++++++++++++++ src/core/proto/grpc/lb/v0/load_balancer.pb.h | 52 ++++++++++++++++++-------- src/proto/grpc/lb/v0/load_balancer.proto | 29 ++++++++++++++ tools/codegen/core/gen_load_balancing_proto.sh | 35 ++++++++++++++++- 4 files changed, 130 insertions(+), 18 deletions(-) (limited to 'tools/codegen/core') diff --git a/src/core/proto/grpc/lb/v0/load_balancer.pb.c b/src/core/proto/grpc/lb/v0/load_balancer.pb.c index 304bbb1c12..bbb6fa8224 100644 --- a/src/core/proto/grpc/lb/v0/load_balancer.pb.c +++ b/src/core/proto/grpc/lb/v0/load_balancer.pb.c @@ -1,3 +1,35 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ /* Automatically generated nanopb constant definitions */ /* Generated by nanopb-0.3.4-dev */ diff --git a/src/core/proto/grpc/lb/v0/load_balancer.pb.h b/src/core/proto/grpc/lb/v0/load_balancer.pb.h index 775100546a..8a90405c61 100644 --- a/src/core/proto/grpc/lb/v0/load_balancer.pb.h +++ b/src/core/proto/grpc/lb/v0/load_balancer.pb.h @@ -1,3 +1,35 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ /* Automatically generated nanopb header */ /* Generated by nanopb-0.3.4-dev */ @@ -97,14 +129,8 @@ typedef struct _grpc_lb_v0_LoadBalanceResponse { } #define grpc_lb_v0_InitialLoadBalanceResponse_init_default \ { false, "", false, "", false, grpc_lb_v0_Duration_init_default } -#define grpc_lb_v0_ServerList_init_default \ - { \ - { \ - { NULL } \ - , NULL \ - } \ - , false, grpc_lb_v0_Duration_init_default \ - } +#define grpc_lb_v0_ServerList_init_default \ + { {{NULL}, NULL}, false, grpc_lb_v0_Duration_init_default } #define grpc_lb_v0_Server_init_default \ { false, "", false, 0, false, {0, {0}}, false, 0 } #define grpc_lb_v0_Duration_init_zero \ @@ -125,14 +151,8 @@ typedef struct _grpc_lb_v0_LoadBalanceResponse { } #define grpc_lb_v0_InitialLoadBalanceResponse_init_zero \ { false, "", false, "", false, grpc_lb_v0_Duration_init_zero } -#define grpc_lb_v0_ServerList_init_zero \ - { \ - { \ - { NULL } \ - , NULL \ - } \ - , false, grpc_lb_v0_Duration_init_zero \ - } +#define grpc_lb_v0_ServerList_init_zero \ + { {{NULL}, NULL}, false, grpc_lb_v0_Duration_init_zero } #define grpc_lb_v0_Server_init_zero \ { false, "", false, 0, false, {0, {0}}, false, 0 } diff --git a/src/proto/grpc/lb/v0/load_balancer.proto b/src/proto/grpc/lb/v0/load_balancer.proto index 6c96e8d52c..e88a4f8c4a 100644 --- a/src/proto/grpc/lb/v0/load_balancer.proto +++ b/src/proto/grpc/lb/v0/load_balancer.proto @@ -1,3 +1,32 @@ +// Copyright 2016, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + syntax = "proto3"; package grpc.lb.v0; diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index 60a685849f..31f1b89696 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -1,4 +1,34 @@ #!/bin/bash + +# Copyright 2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # # Example usage: # tools/codegen/core/gen_load_balancing_proto.sh \ @@ -7,7 +37,7 @@ read -r -d '' COPYRIGHT <<'EOF' /* * - * Copyright 2016, Google Inc. + * Copyright , Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,8 +70,9 @@ read -r -d '' COPYRIGHT <<'EOF' EOF +CURRENT_YEAR=$(date +%Y) COPYRIGHT_FILE=$(mktemp) -echo "$COPYRIGHT" > $COPYRIGHT_FILE +echo "${COPYRIGHT//$CURRENT_YEAR}" > $COPYRIGHT_FILE set -ex if [ $# -eq 0 ]; then -- cgit v1.2.3 From d2565bb169d052d5baec9b43e126b44676d53178 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 13 Jan 2016 10:07:14 -0800 Subject: Fixed formatting and updated gen script to use concrete version of clang-format --- src/core/proto/grpc/lb/v0/load_balancer.pb.h | 20 ++++++++++++++++---- tools/codegen/core/gen_load_balancing_proto.sh | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'tools/codegen/core') diff --git a/src/core/proto/grpc/lb/v0/load_balancer.pb.h b/src/core/proto/grpc/lb/v0/load_balancer.pb.h index 8a90405c61..ac83665839 100644 --- a/src/core/proto/grpc/lb/v0/load_balancer.pb.h +++ b/src/core/proto/grpc/lb/v0/load_balancer.pb.h @@ -129,8 +129,14 @@ typedef struct _grpc_lb_v0_LoadBalanceResponse { } #define grpc_lb_v0_InitialLoadBalanceResponse_init_default \ { false, "", false, "", false, grpc_lb_v0_Duration_init_default } -#define grpc_lb_v0_ServerList_init_default \ - { {{NULL}, NULL}, false, grpc_lb_v0_Duration_init_default } +#define grpc_lb_v0_ServerList_init_default \ + { \ + { \ + { NULL } \ + , NULL \ + } \ + , false, grpc_lb_v0_Duration_init_default \ + } #define grpc_lb_v0_Server_init_default \ { false, "", false, 0, false, {0, {0}}, false, 0 } #define grpc_lb_v0_Duration_init_zero \ @@ -151,8 +157,14 @@ typedef struct _grpc_lb_v0_LoadBalanceResponse { } #define grpc_lb_v0_InitialLoadBalanceResponse_init_zero \ { false, "", false, "", false, grpc_lb_v0_Duration_init_zero } -#define grpc_lb_v0_ServerList_init_zero \ - { {{NULL}, NULL}, false, grpc_lb_v0_Duration_init_zero } +#define grpc_lb_v0_ServerList_init_zero \ + { \ + { \ + { NULL } \ + , NULL \ + } \ + , false, grpc_lb_v0_Duration_init_zero \ + } #define grpc_lb_v0_Server_init_zero \ { false, "", false, 0, false, {0, {0}}, false, 0 } diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index 31f1b89696..bdad68a7f8 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -121,7 +121,7 @@ mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" > $TMPFILE mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" -clang-format -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" -clang-format -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" +clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" +clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" popd > /dev/null -- cgit v1.2.3 From d053ded310bda65ad1fdacd507cd85d46fb7f34c Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 15 Jan 2016 14:36:08 -0800 Subject: copyriiiights, fuuuuu --- src/core/census/initialize.c | 2 +- tools/codegen/core/gen_load_balancing_proto.sh | 4 ++-- tools/jenkins/build_interop_stress_image.sh | 2 +- tools/jenkins/grpc_interop_stress_cxx/Dockerfile | 2 +- tools/jenkins/grpc_interop_stress_cxx/build_interop_stress.sh | 2 +- tools/jenkins/run_interop_stress.sh | 2 +- tools/run_tests/run_stress_tests.py | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tools/codegen/core') diff --git a/src/core/census/initialize.c b/src/core/census/initialize.c index 989708d42c..b7af714e0b 100644 --- a/src/core/census/initialize.c +++ b/src/core/census/initialize.c @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index bdad68a7f8..31f1b89696 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -121,7 +121,7 @@ mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" > $TMPFILE mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" -clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" -clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" +clang-format -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" +clang-format -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" popd > /dev/null diff --git a/tools/jenkins/build_interop_stress_image.sh b/tools/jenkins/build_interop_stress_image.sh index 6b22dce6c0..395eaa32d9 100755 --- a/tools/jenkins/build_interop_stress_image.sh +++ b/tools/jenkins/build_interop_stress_image.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/tools/jenkins/grpc_interop_stress_cxx/Dockerfile b/tools/jenkins/grpc_interop_stress_cxx/Dockerfile index 1fa1907533..58a8c32e34 100644 --- a/tools/jenkins/grpc_interop_stress_cxx/Dockerfile +++ b/tools/jenkins/grpc_interop_stress_cxx/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/tools/jenkins/grpc_interop_stress_cxx/build_interop_stress.sh b/tools/jenkins/grpc_interop_stress_cxx/build_interop_stress.sh index 01f9a9c02e..6ed3ccb3fa 100755 --- a/tools/jenkins/grpc_interop_stress_cxx/build_interop_stress.sh +++ b/tools/jenkins/grpc_interop_stress_cxx/build_interop_stress.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/tools/jenkins/run_interop_stress.sh b/tools/jenkins/run_interop_stress.sh index 22d81db8bc..8166f34e05 100755 --- a/tools/jenkins/run_interop_stress.sh +++ b/tools/jenkins/run_interop_stress.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/tools/run_tests/run_stress_tests.py b/tools/run_tests/run_stress_tests.py index b01a07af90..193ff2e53a 100755 --- a/tools/run_tests/run_stress_tests.py +++ b/tools/run_tests/run_stress_tests.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without -- cgit v1.2.3 From 5220a75912fe0cb2ddfe3ee34dd8a7023382d705 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 19 Jan 2016 22:07:51 -0800 Subject: have lb gen script use docker for clang formatting --- tools/codegen/core/gen_load_balancing_proto.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'tools/codegen/core') diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index b0befc7e04..87c05f5fe8 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -70,8 +70,8 @@ read -r -d '' COPYRIGHT <<'EOF' EOF -apt-get update -qq -apt-get install -y clang-format-3.6 +# build clang-format docker image +docker build -t grpc_clang_format tools/dockerfile/grpc_clang_format CURRENT_YEAR=$(date +%Y) COPYRIGHT_FILE=$(mktemp) @@ -124,7 +124,15 @@ mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" > $TMPFILE mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" -clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" -clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" -i "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" +docker run --rm=true \ + -v ${HOST_GIT_ROOT:-`pwd`}:/local-code \ + -t grpc_clang_format \ + clang-format-3.6 \ + -style="{BasedOnStyle: Google, Language: Cpp}" \ + -i "/local-code/src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.c" && \ + clang-format-3.6 \ + -style="{BasedOnStyle: Google, Language: Cpp}" \ + -i "/local-code/src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.h" + popd > /dev/null -- cgit v1.2.3 From e5af172eea5d5b97d72443520912f14f704209a7 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 20 Jan 2016 09:45:34 -0800 Subject: Updated scripts to use docker for clang-formatting --- tools/codegen/core/gen_load_balancing_proto.sh | 12 ++---------- tools/distrib/check_nanopb_output.sh | 3 +++ 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'tools/codegen/core') diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index 87c05f5fe8..2d902ab315 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -124,15 +124,7 @@ mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" > $TMPFILE mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" -docker run --rm=true \ - -v ${HOST_GIT_ROOT:-`pwd`}:/local-code \ - -t grpc_clang_format \ - clang-format-3.6 \ - -style="{BasedOnStyle: Google, Language: Cpp}" \ - -i "/local-code/src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.c" && \ - clang-format-3.6 \ - -style="{BasedOnStyle: Google, Language: Cpp}" \ - -i "/local-code/src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.h" - +docker run -v $OUTPUT_DIR:/local -t grpc_clang_format \ + bash -c 'clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" -i /local/load_balancer.pb.*' popd > /dev/null diff --git a/tools/distrib/check_nanopb_output.sh b/tools/distrib/check_nanopb_output.sh index 9831e09014..21179c606b 100755 --- a/tools/distrib/check_nanopb_output.sh +++ b/tools/distrib/check_nanopb_output.sh @@ -45,6 +45,9 @@ pip install protobuf==3.0.0b2 # change to root directory cd $(dirname $0)/../.. +# build clang-format docker image +docker build -t grpc_clang_format tools/dockerfile/grpc_clang_format + # install protoc version 3 pushd third_party/protobuf apt-get install -y autoconf automake libtool curl -- cgit v1.2.3 From 41098d3a83b3c38f82a7bb83d8829c96d6ad6169 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 21 Jan 2016 11:29:28 -0800 Subject: docker rm true --- tools/codegen/core/gen_load_balancing_proto.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/codegen/core') diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index 2d902ab315..4505eec502 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -124,7 +124,7 @@ mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" > $TMPFILE mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" -docker run -v $OUTPUT_DIR:/local -t grpc_clang_format \ +docker run --rm=true -v $OUTPUT_DIR:/local -t grpc_clang_format \ bash -c 'clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" -i /local/load_balancer.pb.*' popd > /dev/null -- cgit v1.2.3 From 610107cc3dced9fd39b24f9d6185e376b3375150 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 21 Jan 2016 14:26:31 -0800 Subject: nth attempt to make clang-format work --- tools/codegen/core/gen_load_balancing_proto.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'tools/codegen/core') diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index 4505eec502..45c3282b3c 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -120,11 +120,18 @@ sed -i "s:$PROTO_BASENAME.pb.h:src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.h:g" # prepend copyright TMPFILE=$(mktemp) cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" > $TMPFILE -mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" +mv -v $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" > $TMPFILE -mv $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" +mv -v $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" -docker run --rm=true -v $OUTPUT_DIR:/local -t grpc_clang_format \ - bash -c 'clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" -i /local/load_balancer.pb.*' +ls -l $OUTPUT_DIR + +docker run --rm=false -v $OUTPUT_DIR:/lol -t grpc_clang_format \ + ls -l / +docker run --rm=true -v $OUTPUT_DIR:/lol -t grpc_clang_format \ + ls -l /lol + +# clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" \ +# -i /local/load_balancer.pb.c /local/load_balancer.pb.h popd > /dev/null -- cgit v1.2.3 From a4c9218889bdc1c90146d3ca179f2afc4d3c32f2 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 29 Jan 2016 11:27:26 -0800 Subject: fixed mounting gen dir for docker --- tools/codegen/core/gen_load_balancing_proto.sh | 11 +++++------ tools/distrib/check_nanopb_output.sh | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'tools/codegen/core') diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index 45c3282b3c..6918899d84 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -126,12 +126,11 @@ mv -v $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" ls -l $OUTPUT_DIR -docker run --rm=false -v $OUTPUT_DIR:/lol -t grpc_clang_format \ - ls -l / -docker run --rm=true -v $OUTPUT_DIR:/lol -t grpc_clang_format \ - ls -l /lol - +readonly MOUNTPOINT='/protos' +docker run --rm=true -v ${HOST_GIT_ROOT}:$MOUNTPOINT -t grpc_clang_format \ + ls -l $MOUNTPOINT +#docker run --rm=true -v $OUTPUT_DIR:$MOUNTPOINT -t grpc_clang_format \ # clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" \ -# -i /local/load_balancer.pb.c /local/load_balancer.pb.h +# -i $MOUNTPOINT/load_balancer.pb.c $MOUNTPOINT/load_balancer.pb.h popd > /dev/null diff --git a/tools/distrib/check_nanopb_output.sh b/tools/distrib/check_nanopb_output.sh index d6d34e3c40..6135800ac8 100755 --- a/tools/distrib/check_nanopb_output.sh +++ b/tools/distrib/check_nanopb_output.sh @@ -30,9 +30,9 @@ set -ex -apt-get install -y autoconf automake libtool curl virtualenv +apt-get install -y autoconf automake libtool curl python-virtualenv -readonly NANOPB_TMP_OUTPUT=$(mktemp -d) +readonly NANOPB_TMP_OUTPUT="${HOST_GIT_ROOT}/gens/src/proto/grpc/lb/v0" readonly VENV_DIR=$(mktemp -d) # create a virtualenv for nanopb's compiler pushd $VENV_DIR -- cgit v1.2.3 From 079a1799914af56b2f86fa63f5da0dd7a2ca5581 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 8 Feb 2016 16:51:17 -0800 Subject: Change the census metadata keys. Both census keys must be binary keys because of the encoding. --- src/core/transport/static_metadata.c | 159 +++++++++++++++++++++--------- src/core/transport/static_metadata.h | 70 +++++-------- tools/codegen/core/gen_static_metadata.py | 4 +- 3 files changed, 139 insertions(+), 94 deletions(-) (limited to 'tools/codegen/core') diff --git a/src/core/transport/static_metadata.c b/src/core/transport/static_metadata.c index 233e5c0d92..41375167b1 100644 --- a/src/core/transport/static_metadata.c +++ b/src/core/transport/static_metadata.c @@ -1,22 +1,21 @@ /* - * * Copyright 2015-2016, Google Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -28,18 +27,15 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * */ /* * WARNING: Auto-generated code. - * - * To make changes to this file, change - *tools/codegen/core/gen_static_metadata.py, + * + * To make changes to this file, change tools/codegen/core/gen_static_metadata.py, * and then re-run it. - * - * See metadata.h for an explanation of the interface here, and metadata.c for - *an + * + * See metadata.h for an explanation of the interface here, and metadata.c for an * explanation of what's going on. */ @@ -48,42 +44,107 @@ grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT]; grpc_mdelem grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT]; -uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 7, 5, 2, 4, 8, 6, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +gpr_uintptr grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,7,5,2,4,8,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +}; -const uint8_t grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT * 2] = - {11, 35, 10, 35, 12, 35, 12, 49, 13, 35, 14, 35, 15, 35, 16, 35, 17, 35, - 19, 35, 20, 35, 21, 35, 24, 35, 25, 35, 26, 35, 27, 35, 28, 35, 29, 35, - 30, 18, 30, 35, 31, 35, 32, 35, 36, 35, 37, 35, 38, 35, 39, 35, 42, 33, - 42, 34, 42, 48, 42, 53, 42, 54, 42, 55, 42, 56, 43, 33, 43, 48, 43, 53, - 46, 0, 46, 1, 46, 2, 50, 35, 57, 35, 58, 35, 59, 35, 60, 35, 61, 35, - 62, 35, 63, 35, 64, 35, 65, 35, 66, 40, 66, 68, 67, 78, 67, 79, 69, 35, - 70, 35, 71, 35, 72, 35, 73, 35, 74, 35, 75, 41, 75, 51, 75, 52, 76, 35, - 77, 35, 80, 3, 80, 4, 80, 5, 80, 6, 80, 7, 80, 8, 80, 9, 81, 35, - 82, 83, 84, 35, 85, 35, 86, 35, 87, 35, 88, 35}; +const gpr_uint8 grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT*2] = { +11,35,10,35,12,35,12,49,13,35,14,35,15,35,16,35,17,35,19,35,20,35,21,35,24,35,25,35,26,35,27,35,28,35,29,35,30,18,30,35,31,35,32,35,36,35,37,35,38,35,39,35,42,33,42,34,42,48,42,53,42,54,42,55,42,56,43,33,43,48,43,53,46,0,46,1,46,2,50,35,57,35,58,35,59,35,60,35,61,35,62,35,63,35,64,35,65,35,66,40,66,68,67,78,67,79,69,35,70,35,71,35,72,35,73,35,74,35,75,41,75,51,75,52,76,35,77,35,80,3,80,4,80,5,80,6,80,7,80,8,80,9,81,35,82,83,84,35,85,35,86,35,87,35,88,35 +}; const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT] = { - "0", "1", "2", "200", "204", "206", "304", "400", "404", "500", "accept", - "accept-charset", "accept-encoding", "accept-language", "accept-ranges", - "access-control-allow-origin", "age", "allow", "application/grpc", - ":authority", "authorization", "cache-control", "census", "census-bin", - "content-disposition", "content-encoding", "content-language", - "content-length", "content-location", "content-range", "content-type", - "cookie", "date", "deflate", "deflate,gzip", "", "etag", "expect", - "expires", "from", "GET", "grpc", "grpc-accept-encoding", "grpc-encoding", - "grpc-internal-encoding-request", "grpc-message", "grpc-status", - "grpc-timeout", "gzip", "gzip, deflate", "host", "http", "https", - "identity", "identity,deflate", "identity,deflate,gzip", "identity,gzip", - "if-match", "if-modified-since", "if-none-match", "if-range", - "if-unmodified-since", "last-modified", "link", "location", "max-forwards", - ":method", ":path", "POST", "proxy-authenticate", "proxy-authorization", - "range", "referer", "refresh", "retry-after", ":scheme", "server", - "set-cookie", "/", "/index.html", ":status", "strict-transport-security", - "te", "trailers", "transfer-encoding", "user-agent", "vary", "via", - "www-authenticate"}; + "0", + "1", + "2", + "200", + "204", + "206", + "304", + "400", + "404", + "500", + "accept", + "accept-charset", + "accept-encoding", + "accept-language", + "accept-ranges", + "access-control-allow-origin", + "age", + "allow", + "application/grpc", + ":authority", + "authorization", + "cache-control", + "census-bin", + "census-binary-bin", + "content-disposition", + "content-encoding", + "content-language", + "content-length", + "content-location", + "content-range", + "content-type", + "cookie", + "date", + "deflate", + "deflate,gzip", + "", + "etag", + "expect", + "expires", + "from", + "GET", + "grpc", + "grpc-accept-encoding", + "grpc-encoding", + "grpc-internal-encoding-request", + "grpc-message", + "grpc-status", + "grpc-timeout", + "gzip", + "gzip, deflate", + "host", + "http", + "https", + "identity", + "identity,deflate", + "identity,deflate,gzip", + "identity,gzip", + "if-match", + "if-modified-since", + "if-none-match", + "if-range", + "if-unmodified-since", + "last-modified", + "link", + "location", + "max-forwards", + ":method", + ":path", + "POST", + "proxy-authenticate", + "proxy-authorization", + "range", + "referer", + "refresh", + "retry-after", + ":scheme", + "server", + "set-cookie", + "/", + "/index.html", + ":status", + "strict-transport-security", + "te", + "trailers", + "transfer-encoding", + "user-agent", + "vary", + "via", + "www-authenticate" +}; + +const gpr_uint8 grpc_static_accept_encoding_metadata[8] = { +0,29,26,30,28,32,27,31 +}; -const uint8_t grpc_static_accept_encoding_metadata[8] = {0, 29, 26, 30, - 28, 32, 27, 31}; diff --git a/src/core/transport/static_metadata.h b/src/core/transport/static_metadata.h index 3803a0488b..c60351cc7c 100644 --- a/src/core/transport/static_metadata.h +++ b/src/core/transport/static_metadata.h @@ -1,22 +1,21 @@ /* - * * Copyright 2015-2016, Google Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. - * * Neither the name of Google Inc. nor the names of its + * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -28,18 +27,15 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * */ /* * WARNING: Auto-generated code. - * - * To make changes to this file, change - * tools/codegen/core/gen_static_metadata.py, + * + * To make changes to this file, change tools/codegen/core/gen_static_metadata.py, * and then re-run it. - * - * See metadata.h for an explanation of the interface here, and metadata.c for - * an + * + * See metadata.h for an explanation of the interface here, and metadata.c for an * explanation of what's going on. */ @@ -94,10 +90,10 @@ extern grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT]; #define GRPC_MDSTR_AUTHORIZATION (&grpc_static_mdstr_table[20]) /* "cache-control" */ #define GRPC_MDSTR_CACHE_CONTROL (&grpc_static_mdstr_table[21]) -/* "census" */ -#define GRPC_MDSTR_CENSUS (&grpc_static_mdstr_table[22]) /* "census-bin" */ -#define GRPC_MDSTR_CENSUS_BIN (&grpc_static_mdstr_table[23]) +#define GRPC_MDSTR_CENSUS_BIN (&grpc_static_mdstr_table[22]) +/* "census-binary-bin" */ +#define GRPC_MDSTR_CENSUS_BINARY_BIN (&grpc_static_mdstr_table[23]) /* "content-disposition" */ #define GRPC_MDSTR_CONTENT_DISPOSITION (&grpc_static_mdstr_table[24]) /* "content-encoding" */ @@ -161,8 +157,7 @@ extern grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT]; /* "identity,deflate" */ #define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (&grpc_static_mdstr_table[54]) /* "identity,deflate,gzip" */ -#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \ - (&grpc_static_mdstr_table[55]) +#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP (&grpc_static_mdstr_table[55]) /* "identity,gzip" */ #define GRPC_MDSTR_IDENTITY_COMMA_GZIP (&grpc_static_mdstr_table[56]) /* "if-match" */ @@ -232,7 +227,7 @@ extern grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT]; #define GRPC_STATIC_MDELEM_COUNT 78 extern grpc_mdelem grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT]; -extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; +extern gpr_uintptr grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "accept-charset": "" */ #define GRPC_MDELEM_ACCEPT_CHARSET_EMPTY (&grpc_static_mdelem_table[0]) /* "accept": "" */ @@ -240,15 +235,13 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "accept-encoding": "" */ #define GRPC_MDELEM_ACCEPT_ENCODING_EMPTY (&grpc_static_mdelem_table[2]) /* "accept-encoding": "gzip, deflate" */ -#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP_COMMA_DEFLATE \ - (&grpc_static_mdelem_table[3]) +#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP_COMMA_DEFLATE (&grpc_static_mdelem_table[3]) /* "accept-language": "" */ #define GRPC_MDELEM_ACCEPT_LANGUAGE_EMPTY (&grpc_static_mdelem_table[4]) /* "accept-ranges": "" */ #define GRPC_MDELEM_ACCEPT_RANGES_EMPTY (&grpc_static_mdelem_table[5]) /* "access-control-allow-origin": "" */ -#define GRPC_MDELEM_ACCESS_CONTROL_ALLOW_ORIGIN_EMPTY \ - (&grpc_static_mdelem_table[6]) +#define GRPC_MDELEM_ACCESS_CONTROL_ALLOW_ORIGIN_EMPTY (&grpc_static_mdelem_table[6]) /* "age": "" */ #define GRPC_MDELEM_AGE_EMPTY (&grpc_static_mdelem_table[7]) /* "allow": "" */ @@ -272,8 +265,7 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "content-range": "" */ #define GRPC_MDELEM_CONTENT_RANGE_EMPTY (&grpc_static_mdelem_table[17]) /* "content-type": "application/grpc" */ -#define GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC \ - (&grpc_static_mdelem_table[18]) +#define GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC (&grpc_static_mdelem_table[18]) /* "content-type": "" */ #define GRPC_MDELEM_CONTENT_TYPE_EMPTY (&grpc_static_mdelem_table[19]) /* "cookie": "" */ @@ -291,22 +283,17 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "grpc-accept-encoding": "deflate" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE (&grpc_static_mdelem_table[26]) /* "grpc-accept-encoding": "deflate,gzip" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP \ - (&grpc_static_mdelem_table[27]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP (&grpc_static_mdelem_table[27]) /* "grpc-accept-encoding": "gzip" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_GZIP (&grpc_static_mdelem_table[28]) /* "grpc-accept-encoding": "identity" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY \ - (&grpc_static_mdelem_table[29]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY (&grpc_static_mdelem_table[29]) /* "grpc-accept-encoding": "identity,deflate" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE \ - (&grpc_static_mdelem_table[30]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE (&grpc_static_mdelem_table[30]) /* "grpc-accept-encoding": "identity,deflate,gzip" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \ - (&grpc_static_mdelem_table[31]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP (&grpc_static_mdelem_table[31]) /* "grpc-accept-encoding": "identity,gzip" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \ - (&grpc_static_mdelem_table[32]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP (&grpc_static_mdelem_table[32]) /* "grpc-encoding": "deflate" */ #define GRPC_MDELEM_GRPC_ENCODING_DEFLATE (&grpc_static_mdelem_table[33]) /* "grpc-encoding": "gzip" */ @@ -384,8 +371,7 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* ":status": "500" */ #define GRPC_MDELEM_STATUS_500 (&grpc_static_mdelem_table[70]) /* "strict-transport-security": "" */ -#define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY \ - (&grpc_static_mdelem_table[71]) +#define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY (&grpc_static_mdelem_table[71]) /* "te": "trailers" */ #define GRPC_MDELEM_TE_TRAILERS (&grpc_static_mdelem_table[72]) /* "transfer-encoding": "" */ @@ -399,10 +385,8 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "www-authenticate": "" */ #define GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY (&grpc_static_mdelem_table[77]) -extern const uint8_t - grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT * 2]; +extern const gpr_uint8 grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT*2]; extern const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT]; -extern const uint8_t grpc_static_accept_encoding_metadata[8]; -#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) \ - (&grpc_static_mdelem_table[grpc_static_accept_encoding_metadata[(algs)]]) +extern const gpr_uint8 grpc_static_accept_encoding_metadata[8]; +#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) (&grpc_static_mdelem_table[grpc_static_accept_encoding_metadata[(algs)]]) #endif /* GRPC_INTERNAL_CORE_TRANSPORT_STATIC_METADATA_H */ diff --git a/tools/codegen/core/gen_static_metadata.py b/tools/codegen/core/gen_static_metadata.py index 3e47d7f6d5..e6ae00e611 100755 --- a/tools/codegen/core/gen_static_metadata.py +++ b/tools/codegen/core/gen_static_metadata.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2.7 -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -50,8 +50,8 @@ CONFIG = [ 'host', 'grpc-message', 'grpc-status', - 'census', 'census-bin', + 'census-binary-bin', '', ('grpc-status', '0'), ('grpc-status', '1'), -- cgit v1.2.3 From 9508a42096762eef3665f046cc4f370874fd9f7c Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 29 Jan 2016 15:13:14 -0800 Subject: trying to fix docker once again... --- tools/codegen/core/gen_load_balancing_proto.sh | 11 ++++------- tools/distrib/check_nanopb_output.sh | 2 +- tools/jenkins/build_docker_and_run_tests.sh | 6 +++++- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'tools/codegen/core') diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh index 6918899d84..114dd9d70d 100755 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ b/tools/codegen/core/gen_load_balancing_proto.sh @@ -124,13 +124,10 @@ mv -v $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" > $TMPFILE mv -v $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" -ls -l $OUTPUT_DIR - readonly MOUNTPOINT='/protos' -docker run --rm=true -v ${HOST_GIT_ROOT}:$MOUNTPOINT -t grpc_clang_format \ - ls -l $MOUNTPOINT -#docker run --rm=true -v $OUTPUT_DIR:$MOUNTPOINT -t grpc_clang_format \ -# clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" \ -# -i $MOUNTPOINT/load_balancer.pb.c $MOUNTPOINT/load_balancer.pb.h +docker run --rm=true -v ${HOST_GIT_ROOT}/gens/src/proto/grpc/lb/v0:$MOUNTPOINT \ + -t grpc_clang_format \ + clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" \ + -i $MOUNTPOINT/load_balancer.pb.c $MOUNTPOINT/load_balancer.pb.h popd > /dev/null diff --git a/tools/distrib/check_nanopb_output.sh b/tools/distrib/check_nanopb_output.sh index 6135800ac8..78d3a734e9 100755 --- a/tools/distrib/check_nanopb_output.sh +++ b/tools/distrib/check_nanopb_output.sh @@ -32,7 +32,7 @@ set -ex apt-get install -y autoconf automake libtool curl python-virtualenv -readonly NANOPB_TMP_OUTPUT="${HOST_GIT_ROOT}/gens/src/proto/grpc/lb/v0" +readonly NANOPB_TMP_OUTPUT="${LOCAL_GIT_ROOT}/gens/src/proto/grpc/lb/v0" readonly VENV_DIR=$(mktemp -d) # create a virtualenv for nanopb's compiler pushd $VENV_DIR diff --git a/tools/jenkins/build_docker_and_run_tests.sh b/tools/jenkins/build_docker_and_run_tests.sh index 58163bb583..3366198a3c 100755 --- a/tools/jenkins/build_docker_and_run_tests.sh +++ b/tools/jenkins/build_docker_and_run_tests.sh @@ -60,6 +60,9 @@ docker build -t $DOCKER_IMAGE_NAME $DOCKERFILE_DIR # Choose random name for docker container CONTAINER_NAME="run_tests_$(uuidgen)" +# Git root as seen by the docker instance +docker_instance_git_root=/var/local/jenkins/grpc + # Run tests inside docker docker run \ -e "RUN_TESTS_COMMAND=$RUN_TESTS_COMMAND" \ @@ -69,9 +72,10 @@ docker run \ -e XDG_CACHE_HOME=/tmp/xdg-cache-home \ -e THIS_IS_REALLY_NEEDED='see https://github.com/docker/docker/issues/14203 for why docker is awful' \ -e HOST_GIT_ROOT=$git_root \ + -e LOCAL_GIT_ROOT=$docker_instance_git_root \ -e "BUILD_ID=$BUILD_ID" \ -i $TTY_FLAG \ - -v "$git_root:/var/local/jenkins/grpc" \ + -v "$git_root:$docker_instance_git_root" \ -v /tmp/ccache:/tmp/ccache \ -v /tmp/npm-cache:/tmp/npm-cache \ -v /tmp/xdg-cache-home:/tmp/xdg-cache-home \ -- cgit v1.2.3 From c35e2c582fcb075b973856b3c09c1e91de4b7eae Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 11 Feb 2016 15:45:03 -0800 Subject: Revert "Proto API for LB request/responses" --- .gitmodules | 3 - BUILD | 33 --- Makefile | 76 ------- binding.gyp | 5 - build.yaml | 27 --- gRPC.podspec | 21 +- grpc.gemspec | 11 - package.json | 11 - .../client_config/lb_policies/load_balancer_api.c | 163 --------------- .../client_config/lb_policies/load_balancer_api.h | 85 -------- src/core/proto/grpc/lb/v0/load_balancer.pb.c | 150 -------------- src/core/proto/grpc/lb/v0/load_balancer.pb.h | 221 --------------------- src/proto/grpc/lb/v0/load_balancer.options | 6 - src/proto/grpc/lb/v0/load_balancer.proto | 144 -------------- src/python/grpcio/grpc_core_dependencies.py | 5 - .../run_tests/sources_and_headers.json.template | 21 +- test/cpp/grpclb/grpclb_api_test.cc | 133 ------------- third_party/nanopb | 1 - tools/codegen/core/gen_load_balancing_proto.sh | 133 ------------- tools/distrib/check_nanopb_output.sh | 86 -------- tools/doxygen/Doxyfile.core.internal | 11 - tools/jenkins/build_docker_and_run_tests.sh | 6 +- tools/run_tests/sanity/check_submodules.sh | 1 - tools/run_tests/sanity/sanity_tests.yaml | 1 - tools/run_tests/sources_and_headers.json | 41 +--- tools/run_tests/tests.json | 20 -- vsprojects/vcxproj/grpc/grpc.vcxproj | 16 -- vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 51 ----- .../vcxproj/grpc_unsecure/grpc_unsecure.vcxproj | 16 -- .../grpc_unsecure/grpc_unsecure.vcxproj.filters | 51 ----- .../test/grpclb_api_test/grpclb_api_test.vcxproj | 209 ------------------- .../grpclb_api_test.vcxproj.filters | 39 ---- 32 files changed, 12 insertions(+), 1785 deletions(-) delete mode 100644 src/core/client_config/lb_policies/load_balancer_api.c delete mode 100644 src/core/client_config/lb_policies/load_balancer_api.h delete mode 100644 src/core/proto/grpc/lb/v0/load_balancer.pb.c delete mode 100644 src/core/proto/grpc/lb/v0/load_balancer.pb.h delete mode 100644 src/proto/grpc/lb/v0/load_balancer.options delete mode 100644 src/proto/grpc/lb/v0/load_balancer.proto delete mode 100644 test/cpp/grpclb/grpclb_api_test.cc delete mode 160000 third_party/nanopb delete mode 100755 tools/codegen/core/gen_load_balancing_proto.sh delete mode 100755 tools/distrib/check_nanopb_output.sh delete mode 100644 vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj delete mode 100644 vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj.filters (limited to 'tools/codegen/core') diff --git a/.gitmodules b/.gitmodules index c37d0abdf0..008bc5fae8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -14,6 +14,3 @@ [submodule "third_party/boringssl"] path = third_party/boringssl url = https://boringssl.googlesource.com/boringssl -[submodule "third_party/nanopb"] - path = third_party/nanopb - url = https://github.com/nanopb/nanopb.git diff --git a/BUILD b/BUILD index 31e0f3aacc..72d5caa8d4 100644 --- a/BUILD +++ b/BUILD @@ -182,7 +182,6 @@ cc_library( "src/core/client_config/client_config.h", "src/core/client_config/connector.h", "src/core/client_config/initial_connect_string.h", - "src/core/client_config/lb_policies/load_balancer_api.h", "src/core/client_config/lb_policies/pick_first.h", "src/core/client_config/lb_policies/round_robin.h", "src/core/client_config/lb_policy.h", @@ -243,7 +242,6 @@ cc_library( "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.h", @@ -285,10 +283,6 @@ cc_library( "src/core/transport/transport_impl.h", "src/core/census/aggregation.h", "src/core/census/rpc_metric_id.h", - "third_party/nanopb/pb.h", - "third_party/nanopb/pb_common.h", - "third_party/nanopb/pb_decode.h", - "third_party/nanopb/pb_encode.h", "src/core/httpcli/httpcli_security_connector.c", "src/core/security/base64.c", "src/core/security/client_auth_filter.c", @@ -325,7 +319,6 @@ cc_library( "src/core/client_config/connector.c", "src/core/client_config/default_initial_connect_string.c", "src/core/client_config/initial_connect_string.c", - "src/core/client_config/lb_policies/load_balancer_api.c", "src/core/client_config/lb_policies/pick_first.c", "src/core/client_config/lb_policies/round_robin.c", "src/core/client_config/lb_policy.c", @@ -389,7 +382,6 @@ cc_library( "src/core/json/json_reader.c", "src/core/json/json_string.c", "src/core/json/json_writer.c", - "src/core/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/surface/alarm.c", "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", @@ -444,9 +436,6 @@ cc_library( "src/core/census/operation.c", "src/core/census/placeholders.c", "src/core/census/tracing.c", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_encode.c", ], hdrs = [ "include/grpc/grpc_security.h", @@ -495,7 +484,6 @@ cc_library( "src/core/client_config/client_config.h", "src/core/client_config/connector.h", "src/core/client_config/initial_connect_string.h", - "src/core/client_config/lb_policies/load_balancer_api.h", "src/core/client_config/lb_policies/pick_first.h", "src/core/client_config/lb_policies/round_robin.h", "src/core/client_config/lb_policy.h", @@ -556,7 +544,6 @@ cc_library( "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.h", @@ -598,10 +585,6 @@ cc_library( "src/core/transport/transport_impl.h", "src/core/census/aggregation.h", "src/core/census/rpc_metric_id.h", - "third_party/nanopb/pb.h", - "third_party/nanopb/pb_common.h", - "third_party/nanopb/pb_decode.h", - "third_party/nanopb/pb_encode.h", "src/core/surface/init_unsecure.c", "src/core/census/grpc_context.c", "src/core/census/grpc_filter.c", @@ -618,7 +601,6 @@ cc_library( "src/core/client_config/connector.c", "src/core/client_config/default_initial_connect_string.c", "src/core/client_config/initial_connect_string.c", - "src/core/client_config/lb_policies/load_balancer_api.c", "src/core/client_config/lb_policies/pick_first.c", "src/core/client_config/lb_policies/round_robin.c", "src/core/client_config/lb_policy.c", @@ -682,7 +664,6 @@ cc_library( "src/core/json/json_reader.c", "src/core/json/json_string.c", "src/core/json/json_writer.c", - "src/core/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/surface/alarm.c", "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", @@ -737,9 +718,6 @@ cc_library( "src/core/census/operation.c", "src/core/census/placeholders.c", "src/core/census/tracing.c", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_encode.c", ], hdrs = [ "include/grpc/byte_buffer.h", @@ -1303,7 +1281,6 @@ objc_library( "src/core/client_config/connector.c", "src/core/client_config/default_initial_connect_string.c", "src/core/client_config/initial_connect_string.c", - "src/core/client_config/lb_policies/load_balancer_api.c", "src/core/client_config/lb_policies/pick_first.c", "src/core/client_config/lb_policies/round_robin.c", "src/core/client_config/lb_policy.c", @@ -1367,7 +1344,6 @@ objc_library( "src/core/json/json_reader.c", "src/core/json/json_string.c", "src/core/json/json_writer.c", - "src/core/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/surface/alarm.c", "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", @@ -1422,9 +1398,6 @@ objc_library( "src/core/census/operation.c", "src/core/census/placeholders.c", "src/core/census/tracing.c", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_encode.c", ], hdrs = [ "include/grpc/grpc_security.h", @@ -1468,7 +1441,6 @@ objc_library( "src/core/client_config/client_config.h", "src/core/client_config/connector.h", "src/core/client_config/initial_connect_string.h", - "src/core/client_config/lb_policies/load_balancer_api.h", "src/core/client_config/lb_policies/pick_first.h", "src/core/client_config/lb_policies/round_robin.h", "src/core/client_config/lb_policy.h", @@ -1529,7 +1501,6 @@ objc_library( "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.h", @@ -1571,10 +1542,6 @@ objc_library( "src/core/transport/transport_impl.h", "src/core/census/aggregation.h", "src/core/census/rpc_metric_id.h", - "third_party/nanopb/pb.h", - "third_party/nanopb/pb_common.h", - "third_party/nanopb/pb_decode.h", - "third_party/nanopb/pb_encode.h", ], includes = [ "include", diff --git a/Makefile b/Makefile index 01bbb2cb3c..3c215b35b6 100644 --- a/Makefile +++ b/Makefile @@ -940,7 +940,6 @@ grpc_csharp_plugin: $(BINDIR)/$(CONFIG)/grpc_csharp_plugin grpc_objective_c_plugin: $(BINDIR)/$(CONFIG)/grpc_objective_c_plugin grpc_python_plugin: $(BINDIR)/$(CONFIG)/grpc_python_plugin grpc_ruby_plugin: $(BINDIR)/$(CONFIG)/grpc_ruby_plugin -grpclb_api_test: $(BINDIR)/$(CONFIG)/grpclb_api_test hybrid_end2end_test: $(BINDIR)/$(CONFIG)/hybrid_end2end_test interop_client: $(BINDIR)/$(CONFIG)/interop_client interop_server: $(BINDIR)/$(CONFIG)/interop_server @@ -1284,7 +1283,6 @@ buildtests_cxx: buildtests_zookeeper privatelibs_cxx \ $(BINDIR)/$(CONFIG)/generic_async_streaming_ping_pong_test \ $(BINDIR)/$(CONFIG)/generic_end2end_test \ $(BINDIR)/$(CONFIG)/grpc_cli \ - $(BINDIR)/$(CONFIG)/grpclb_api_test \ $(BINDIR)/$(CONFIG)/hybrid_end2end_test \ $(BINDIR)/$(CONFIG)/interop_client \ $(BINDIR)/$(CONFIG)/interop_server \ @@ -1593,8 +1591,6 @@ test_cxx: test_zookeeper buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/generic_async_streaming_ping_pong_test || ( echo test generic_async_streaming_ping_pong_test failed ; exit 1 ) $(E) "[RUN] Testing generic_end2end_test" $(Q) $(BINDIR)/$(CONFIG)/generic_end2end_test || ( echo test generic_end2end_test failed ; exit 1 ) - $(E) "[RUN] Testing grpclb_api_test" - $(Q) $(BINDIR)/$(CONFIG)/grpclb_api_test || ( echo test grpclb_api_test failed ; exit 1 ) $(E) "[RUN] Testing hybrid_end2end_test" $(Q) $(BINDIR)/$(CONFIG)/hybrid_end2end_test || ( echo test hybrid_end2end_test failed ; exit 1 ) $(E) "[RUN] Testing interop_test" @@ -1744,21 +1740,6 @@ $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc: $(Q) mkdir -p $(@D) $(Q) echo "$(GRPCXX_UNSECURE_PC_FILE)" | tr , '\n' >$@ -ifeq ($(NO_PROTOC),true) -$(GENDIR)/src/proto/grpc/lb/v0/load_balancer.pb.cc: protoc_dep_error -$(GENDIR)/src/proto/grpc/lb/v0/load_balancer.grpc.pb.cc: protoc_dep_error -else -$(GENDIR)/src/proto/grpc/lb/v0/load_balancer.pb.cc: src/proto/grpc/lb/v0/load_balancer.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) - $(E) "[PROTOC] Generating protobuf CC file from $<" - $(Q) mkdir -p `dirname $@` - $(Q) $(PROTOC) --cpp_out=$(GENDIR) $< - -$(GENDIR)/src/proto/grpc/lb/v0/load_balancer.grpc.pb.cc: src/proto/grpc/lb/v0/load_balancer.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) - $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" - $(Q) mkdir -p `dirname $@` - $(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $< -endif - ifeq ($(NO_PROTOC),true) $(GENDIR)/src/proto/grpc/testing/control.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc: protoc_dep_error @@ -2367,7 +2348,6 @@ LIBGRPC_SRC = \ src/core/client_config/connector.c \ src/core/client_config/default_initial_connect_string.c \ src/core/client_config/initial_connect_string.c \ - src/core/client_config/lb_policies/load_balancer_api.c \ src/core/client_config/lb_policies/pick_first.c \ src/core/client_config/lb_policies/round_robin.c \ src/core/client_config/lb_policy.c \ @@ -2431,7 +2411,6 @@ LIBGRPC_SRC = \ src/core/json/json_reader.c \ src/core/json/json_string.c \ src/core/json/json_writer.c \ - src/core/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/surface/alarm.c \ src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ @@ -2486,9 +2465,6 @@ LIBGRPC_SRC = \ src/core/census/operation.c \ src/core/census/placeholders.c \ src/core/census/tracing.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ PUBLIC_HEADERS_C += \ include/grpc/grpc_security.h \ @@ -2656,7 +2632,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/client_config/connector.c \ src/core/client_config/default_initial_connect_string.c \ src/core/client_config/initial_connect_string.c \ - src/core/client_config/lb_policies/load_balancer_api.c \ src/core/client_config/lb_policies/pick_first.c \ src/core/client_config/lb_policies/round_robin.c \ src/core/client_config/lb_policy.c \ @@ -2720,7 +2695,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/json/json_reader.c \ src/core/json/json_string.c \ src/core/json/json_writer.c \ - src/core/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/surface/alarm.c \ src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ @@ -2775,9 +2749,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/census/operation.c \ src/core/census/placeholders.c \ src/core/census/tracing.c \ - third_party/nanopb/pb_common.c \ - third_party/nanopb/pb_decode.c \ - third_party/nanopb/pb_encode.c \ PUBLIC_HEADERS_C += \ include/grpc/byte_buffer.h \ @@ -9699,53 +9670,6 @@ ifneq ($(NO_DEPS),true) endif -GRPCLB_API_TEST_SRC = \ - $(GENDIR)/src/proto/grpc/lb/v0/load_balancer.pb.cc $(GENDIR)/src/proto/grpc/lb/v0/load_balancer.grpc.pb.cc \ - test/cpp/grpclb/grpclb_api_test.cc \ - -GRPCLB_API_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPCLB_API_TEST_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/grpclb_api_test: openssl_dep_error - -else - - - - -ifeq ($(NO_PROTOBUF),true) - -# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+. - -$(BINDIR)/$(CONFIG)/grpclb_api_test: protobuf_dep_error - -else - -$(BINDIR)/$(CONFIG)/grpclb_api_test: $(PROTOBUF_DEP) $(GRPCLB_API_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a - $(E) "[LD] Linking $@" - $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(GRPCLB_API_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/grpclb_api_test - -endif - -endif - -$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v0/load_balancer.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a - -$(OBJDIR)/$(CONFIG)/test/cpp/grpclb/grpclb_api_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a - -deps_grpclb_api_test: $(GRPCLB_API_TEST_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(GRPCLB_API_TEST_OBJS:.o=.dep) -endif -endif -$(OBJDIR)/$(CONFIG)/test/cpp/grpclb/grpclb_api_test.o: $(GENDIR)/src/proto/grpc/lb/v0/load_balancer.pb.cc $(GENDIR)/src/proto/grpc/lb/v0/load_balancer.grpc.pb.cc - - HYBRID_END2END_TEST_SRC = \ test/cpp/end2end/hybrid_end2end_test.cc \ diff --git a/binding.gyp b/binding.gyp index f7a21e56cd..3659bfcf13 100644 --- a/binding.gyp +++ b/binding.gyp @@ -591,7 +591,6 @@ 'src/core/client_config/connector.c', 'src/core/client_config/default_initial_connect_string.c', 'src/core/client_config/initial_connect_string.c', - 'src/core/client_config/lb_policies/load_balancer_api.c', 'src/core/client_config/lb_policies/pick_first.c', 'src/core/client_config/lb_policies/round_robin.c', 'src/core/client_config/lb_policy.c', @@ -655,7 +654,6 @@ 'src/core/json/json_reader.c', 'src/core/json/json_string.c', 'src/core/json/json_writer.c', - 'src/core/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/surface/alarm.c', 'src/core/surface/api_trace.c', 'src/core/surface/byte_buffer.c', @@ -710,9 +708,6 @@ 'src/core/census/operation.c', 'src/core/census/placeholders.c', 'src/core/census/tracing.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', ], "conditions": [ ['OS == "mac"', { diff --git a/build.yaml b/build.yaml index ffa16675d8..7f33ef3f0e 100644 --- a/build.yaml +++ b/build.yaml @@ -258,7 +258,6 @@ filegroups: - src/core/client_config/client_config.h - src/core/client_config/connector.h - src/core/client_config/initial_connect_string.h - - src/core/client_config/lb_policies/load_balancer_api.h - src/core/client_config/lb_policies/pick_first.h - src/core/client_config/lb_policies/round_robin.h - src/core/client_config/lb_policy.h @@ -319,7 +318,6 @@ filegroups: - src/core/json/json_common.h - src/core/json/json_reader.h - src/core/json/json_writer.h - - src/core/proto/grpc/lb/v0/load_balancer.pb.h - src/core/statistics/census_interface.h - src/core/statistics/census_rpc_stats.h - src/core/surface/api_trace.h @@ -375,7 +373,6 @@ filegroups: - src/core/client_config/connector.c - src/core/client_config/default_initial_connect_string.c - src/core/client_config/initial_connect_string.c - - src/core/client_config/lb_policies/load_balancer_api.c - src/core/client_config/lb_policies/pick_first.c - src/core/client_config/lb_policies/round_robin.c - src/core/client_config/lb_policy.c @@ -439,7 +436,6 @@ filegroups: - src/core/json/json_reader.c - src/core/json/json_string.c - src/core/json/json_writer.c - - src/core/proto/grpc/lb/v0/load_balancer.pb.c - src/core/surface/alarm.c - src/core/surface/api_trace.c - src/core/surface/byte_buffer.c @@ -515,16 +511,6 @@ filegroups: - test/core/util/port_posix.c - test/core/util/port_windows.c - test/core/util/slice_splitter.c -- name: nanopb - headers: - - third_party/nanopb/pb.h - - third_party/nanopb/pb_common.h - - third_party/nanopb/pb_decode.h - - third_party/nanopb/pb_encode.h - src: - - third_party/nanopb/pb_common.c - - third_party/nanopb/pb_decode.c - - third_party/nanopb/pb_encode.c libs: - name: gpr build: all @@ -596,7 +582,6 @@ libs: - grpc_codegen - grpc_base - census - - nanopb secure: true vs_packages: - grpc.dependencies.openssl @@ -645,7 +630,6 @@ libs: - grpc_base - grpc_codegen - census - - nanopb secure: false vs_project_guid: '{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}' - name: grpc_zookeeper @@ -2190,17 +2174,6 @@ targets: secure: false vs_config_type: Application vs_project_guid: '{069E9D05-B78B-4751-9252-D21EBAE7DE8E}' -- name: grpclb_api_test - build: test - language: c++ - src: - - src/proto/grpc/lb/v0/load_balancer.proto - - test/cpp/grpclb/grpclb_api_test.cc - deps: - - grpc++_test_util - - grpc_test_util - - grpc++ - - grpc - name: hybrid_end2end_test build: test language: c++ diff --git a/gRPC.podspec b/gRPC.podspec index 05e3802b77..5b4d24e482 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -186,7 +186,6 @@ Pod::Spec.new do |s| 'src/core/client_config/client_config.h', 'src/core/client_config/connector.h', 'src/core/client_config/initial_connect_string.h', - 'src/core/client_config/lb_policies/load_balancer_api.h', 'src/core/client_config/lb_policies/pick_first.h', 'src/core/client_config/lb_policies/round_robin.h', 'src/core/client_config/lb_policy.h', @@ -247,7 +246,6 @@ Pod::Spec.new do |s| 'src/core/json/json_common.h', 'src/core/json/json_reader.h', 'src/core/json/json_writer.h', - 'src/core/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/statistics/census_interface.h', 'src/core/statistics/census_rpc_stats.h', 'src/core/surface/api_trace.h', @@ -289,10 +287,6 @@ Pod::Spec.new do |s| 'src/core/transport/transport_impl.h', 'src/core/census/aggregation.h', 'src/core/census/rpc_metric_id.h', - 'third_party/nanopb/pb.h', - 'third_party/nanopb/pb_common.h', - 'third_party/nanopb/pb_decode.h', - 'third_party/nanopb/pb_encode.h', 'include/grpc/grpc_security.h', 'include/grpc/impl/codegen/byte_buffer.h', 'include/grpc/impl/codegen/compression_types.h', @@ -342,7 +336,6 @@ Pod::Spec.new do |s| 'src/core/client_config/connector.c', 'src/core/client_config/default_initial_connect_string.c', 'src/core/client_config/initial_connect_string.c', - 'src/core/client_config/lb_policies/load_balancer_api.c', 'src/core/client_config/lb_policies/pick_first.c', 'src/core/client_config/lb_policies/round_robin.c', 'src/core/client_config/lb_policy.c', @@ -406,7 +399,6 @@ Pod::Spec.new do |s| 'src/core/json/json_reader.c', 'src/core/json/json_string.c', 'src/core/json/json_writer.c', - 'src/core/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/surface/alarm.c', 'src/core/surface/api_trace.c', 'src/core/surface/byte_buffer.c', @@ -460,10 +452,7 @@ Pod::Spec.new do |s| 'src/core/census/initialize.c', 'src/core/census/operation.c', 'src/core/census/placeholders.c', - 'src/core/census/tracing.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c' + 'src/core/census/tracing.c' ss.private_header_files = 'src/core/profiling/timers.h', 'src/core/support/block_annotate.h', @@ -503,7 +492,6 @@ Pod::Spec.new do |s| 'src/core/client_config/client_config.h', 'src/core/client_config/connector.h', 'src/core/client_config/initial_connect_string.h', - 'src/core/client_config/lb_policies/load_balancer_api.h', 'src/core/client_config/lb_policies/pick_first.h', 'src/core/client_config/lb_policies/round_robin.h', 'src/core/client_config/lb_policy.h', @@ -564,7 +552,6 @@ Pod::Spec.new do |s| 'src/core/json/json_common.h', 'src/core/json/json_reader.h', 'src/core/json/json_writer.h', - 'src/core/proto/grpc/lb/v0/load_balancer.pb.h', 'src/core/statistics/census_interface.h', 'src/core/statistics/census_rpc_stats.h', 'src/core/surface/api_trace.h', @@ -605,11 +592,7 @@ Pod::Spec.new do |s| 'src/core/transport/transport.h', 'src/core/transport/transport_impl.h', 'src/core/census/aggregation.h', - 'src/core/census/rpc_metric_id.h', - 'third_party/nanopb/pb.h', - 'third_party/nanopb/pb_common.h', - 'third_party/nanopb/pb_decode.h', - 'third_party/nanopb/pb_encode.h' + 'src/core/census/rpc_metric_id.h' ss.header_mappings_dir = '.' # This isn't officially supported in Cocoapods. We've asked for an alternative: diff --git a/grpc.gemspec b/grpc.gemspec index 1ef26761b7..9e4683f41c 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -182,7 +182,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/client_config/client_config.h ) s.files += %w( src/core/client_config/connector.h ) s.files += %w( src/core/client_config/initial_connect_string.h ) - s.files += %w( src/core/client_config/lb_policies/load_balancer_api.h ) s.files += %w( src/core/client_config/lb_policies/pick_first.h ) s.files += %w( src/core/client_config/lb_policies/round_robin.h ) s.files += %w( src/core/client_config/lb_policy.h ) @@ -243,7 +242,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/json/json_common.h ) s.files += %w( src/core/json/json_reader.h ) s.files += %w( src/core/json/json_writer.h ) - s.files += %w( src/core/proto/grpc/lb/v0/load_balancer.pb.h ) s.files += %w( src/core/statistics/census_interface.h ) s.files += %w( src/core/statistics/census_rpc_stats.h ) s.files += %w( src/core/surface/api_trace.h ) @@ -285,10 +283,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/transport/transport_impl.h ) s.files += %w( src/core/census/aggregation.h ) s.files += %w( src/core/census/rpc_metric_id.h ) - s.files += %w( third_party/nanopb/pb.h ) - s.files += %w( third_party/nanopb/pb_common.h ) - s.files += %w( third_party/nanopb/pb_decode.h ) - s.files += %w( third_party/nanopb/pb_encode.h ) s.files += %w( src/core/httpcli/httpcli_security_connector.c ) s.files += %w( src/core/security/base64.c ) s.files += %w( src/core/security/client_auth_filter.c ) @@ -325,7 +319,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/client_config/connector.c ) s.files += %w( src/core/client_config/default_initial_connect_string.c ) s.files += %w( src/core/client_config/initial_connect_string.c ) - s.files += %w( src/core/client_config/lb_policies/load_balancer_api.c ) s.files += %w( src/core/client_config/lb_policies/pick_first.c ) s.files += %w( src/core/client_config/lb_policies/round_robin.c ) s.files += %w( src/core/client_config/lb_policy.c ) @@ -389,7 +382,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/json/json_reader.c ) s.files += %w( src/core/json/json_string.c ) s.files += %w( src/core/json/json_writer.c ) - s.files += %w( src/core/proto/grpc/lb/v0/load_balancer.pb.c ) s.files += %w( src/core/surface/alarm.c ) s.files += %w( src/core/surface/api_trace.c ) s.files += %w( src/core/surface/byte_buffer.c ) @@ -444,9 +436,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/census/operation.c ) s.files += %w( src/core/census/placeholders.c ) s.files += %w( src/core/census/tracing.c ) - s.files += %w( third_party/nanopb/pb_common.c ) - s.files += %w( third_party/nanopb/pb_decode.c ) - s.files += %w( third_party/nanopb/pb_encode.c ) s.files += %w( third_party/boringssl/crypto/aes/internal.h ) s.files += %w( third_party/boringssl/crypto/asn1/asn1_locl.h ) s.files += %w( third_party/boringssl/crypto/bio/internal.h ) diff --git a/package.json b/package.json index b8f8c0a256..1b79ecf92d 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,6 @@ "src/core/client_config/client_config.h", "src/core/client_config/connector.h", "src/core/client_config/initial_connect_string.h", - "src/core/client_config/lb_policies/load_balancer_api.h", "src/core/client_config/lb_policies/pick_first.h", "src/core/client_config/lb_policies/round_robin.h", "src/core/client_config/lb_policy.h", @@ -189,7 +188,6 @@ "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.h", @@ -231,10 +229,6 @@ "src/core/transport/transport_impl.h", "src/core/census/aggregation.h", "src/core/census/rpc_metric_id.h", - "third_party/nanopb/pb.h", - "third_party/nanopb/pb_common.h", - "third_party/nanopb/pb_decode.h", - "third_party/nanopb/pb_encode.h", "src/core/httpcli/httpcli_security_connector.c", "src/core/security/base64.c", "src/core/security/client_auth_filter.c", @@ -271,7 +265,6 @@ "src/core/client_config/connector.c", "src/core/client_config/default_initial_connect_string.c", "src/core/client_config/initial_connect_string.c", - "src/core/client_config/lb_policies/load_balancer_api.c", "src/core/client_config/lb_policies/pick_first.c", "src/core/client_config/lb_policies/round_robin.c", "src/core/client_config/lb_policy.c", @@ -335,7 +328,6 @@ "src/core/json/json_reader.c", "src/core/json/json_string.c", "src/core/json/json_writer.c", - "src/core/proto/grpc/lb/v0/load_balancer.pb.c", "src/core/surface/alarm.c", "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", @@ -390,9 +382,6 @@ "src/core/census/operation.c", "src/core/census/placeholders.c", "src/core/census/tracing.c", - "third_party/nanopb/pb_common.c", - "third_party/nanopb/pb_decode.c", - "third_party/nanopb/pb_encode.c", "third_party/zlib/crc32.h", "third_party/zlib/deflate.h", "third_party/zlib/gzguts.h", diff --git a/src/core/client_config/lb_policies/load_balancer_api.c b/src/core/client_config/lb_policies/load_balancer_api.c deleted file mode 100644 index a6b5785fe4..0000000000 --- a/src/core/client_config/lb_policies/load_balancer_api.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - * - * Copyright 2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "src/core/client_config/lb_policies/load_balancer_api.h" -#include "third_party/nanopb/pb_decode.h" -#include "third_party/nanopb/pb_encode.h" - -#include - -typedef struct decode_serverlist_arg { - int first_pass; - int i; - size_t num_servers; - grpc_grpclb_server **servers; -} decode_serverlist_arg; - -/* invoked once for every Server in ServerList */ -static bool decode_serverlist(pb_istream_t *stream, const pb_field_t *field, - void **arg) { - decode_serverlist_arg *dec_arg = *arg; - if (dec_arg->first_pass != 0) { /* first pass */ - grpc_grpclb_server server; - if (!pb_decode(stream, grpc_lb_v0_Server_fields, &server)) { - return false; - } - dec_arg->num_servers++; - } else { /* second pass */ - grpc_grpclb_server *server = gpr_malloc(sizeof(grpc_grpclb_server)); - GPR_ASSERT(dec_arg->num_servers > 0); - if (dec_arg->i == 0) { /* first iteration of second pass */ - dec_arg->servers = - gpr_malloc(sizeof(grpc_grpclb_server *) * dec_arg->num_servers); - } - if (!pb_decode(stream, grpc_lb_v0_Server_fields, server)) { - return false; - } - dec_arg->servers[dec_arg->i++] = server; - } - - return true; -} - -grpc_grpclb_request *grpc_grpclb_request_create(const char *lb_service_name) { - grpc_grpclb_request *req = gpr_malloc(sizeof(grpc_grpclb_request)); - - req->has_client_stats = 0; /* TODO(dgq): add support for stats once defined */ - req->has_initial_request = 1; - req->initial_request.has_name = 1; - strncpy(req->initial_request.name, lb_service_name, - GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH); - return req; -} - -gpr_slice grpc_grpclb_request_encode(const grpc_grpclb_request *request) { - size_t encoded_length; - pb_ostream_t sizestream; - pb_ostream_t outputstream; - gpr_slice slice; - memset(&sizestream, 0, sizeof(pb_ostream_t)); - pb_encode(&sizestream, grpc_lb_v0_LoadBalanceRequest_fields, request); - encoded_length = sizestream.bytes_written; - - slice = gpr_slice_malloc(encoded_length); - outputstream = - pb_ostream_from_buffer(GPR_SLICE_START_PTR(slice), encoded_length); - GPR_ASSERT(pb_encode(&outputstream, grpc_lb_v0_LoadBalanceRequest_fields, - request) != 0); - return slice; -} - -void grpc_grpclb_request_destroy(grpc_grpclb_request *request) { - gpr_free(request); -} - -grpc_grpclb_response *grpc_grpclb_response_parse(gpr_slice encoded_response) { - bool status; - pb_istream_t stream = - pb_istream_from_buffer(GPR_SLICE_START_PTR(encoded_response), - GPR_SLICE_LENGTH(encoded_response)); - grpc_grpclb_response *res = gpr_malloc(sizeof(grpc_grpclb_response)); - memset(res, 0, sizeof(*res)); - status = pb_decode(&stream, grpc_lb_v0_LoadBalanceResponse_fields, res); - GPR_ASSERT(status == true); - return res; -} - -grpc_grpclb_serverlist *grpc_grpclb_response_parse_serverlist( - gpr_slice encoded_response) { - grpc_grpclb_serverlist *sl = gpr_malloc(sizeof(grpc_grpclb_serverlist)); - bool status; - decode_serverlist_arg arg; - pb_istream_t stream = - pb_istream_from_buffer(GPR_SLICE_START_PTR(encoded_response), - GPR_SLICE_LENGTH(encoded_response)); - pb_istream_t stream_at_start = stream; - grpc_grpclb_response *res = gpr_malloc(sizeof(grpc_grpclb_response)); - memset(res, 0, sizeof(*res)); - memset(&arg, 0, sizeof(decode_serverlist_arg)); - - res->server_list.servers.funcs.decode = decode_serverlist; - res->server_list.servers.arg = &arg; - arg.first_pass = 1; - status = pb_decode(&stream, grpc_lb_v0_LoadBalanceResponse_fields, res); - GPR_ASSERT(status == true); - GPR_ASSERT(arg.num_servers > 0); - - arg.first_pass = 0; - status = - pb_decode(&stream_at_start, grpc_lb_v0_LoadBalanceResponse_fields, res); - GPR_ASSERT(status == true); - GPR_ASSERT(arg.servers != NULL); - - sl->num_servers = arg.num_servers; - sl->servers = arg.servers; - if (res->server_list.has_expiration_interval) { - sl->expiration_interval = res->server_list.expiration_interval; - } - grpc_grpclb_response_destroy(res); - return sl; -} - -void grpc_grpclb_destroy_serverlist(grpc_grpclb_serverlist *serverlist) { - size_t i; - for (i = 0; i < serverlist->num_servers; i++) { - gpr_free(serverlist->servers[i]); - } - gpr_free(serverlist->servers); - gpr_free(serverlist); -} - -void grpc_grpclb_response_destroy(grpc_grpclb_response *response) { - gpr_free(response); -} diff --git a/src/core/client_config/lb_policies/load_balancer_api.h b/src/core/client_config/lb_policies/load_balancer_api.h deleted file mode 100644 index 4dbe1d6c22..0000000000 --- a/src/core/client_config/lb_policies/load_balancer_api.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * - * Copyright 2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPC_INTERNAL_CORE_CLIENT_CONFIG_LB_POLICIES_LOAD_BALANCER_API_H -#define GRPC_INTERNAL_CORE_CLIENT_CONFIG_LB_POLICIES_LOAD_BALANCER_API_H - -#include - -#include "src/core/client_config/lb_policy_factory.h" -#include "src/core/proto/grpc/lb/v0/load_balancer.pb.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH 128 - -typedef grpc_lb_v0_LoadBalanceRequest grpc_grpclb_request; -typedef grpc_lb_v0_LoadBalanceResponse grpc_grpclb_response; -typedef grpc_lb_v0_Server grpc_grpclb_server; -typedef grpc_lb_v0_Duration grpc_grpclb_duration; -typedef struct grpc_grpclb_serverlist { - grpc_grpclb_server **servers; - size_t num_servers; - grpc_grpclb_duration expiration_interval; -} grpc_grpclb_serverlist; - -/** Create a request for a gRPC LB service under \a lb_service_name */ -grpc_grpclb_request *grpc_grpclb_request_create(const char *lb_service_name); - -/** Protocol Buffers v3-encode \a request */ -gpr_slice grpc_grpclb_request_encode(const grpc_grpclb_request *request); - -/** Destroy \a request */ -void grpc_grpclb_request_destroy(grpc_grpclb_request *request); - -/** Parse (ie, decode) the bytes in \a encoded_response as a \a - * grpc_grpclb_response */ -grpc_grpclb_response *grpc_grpclb_response_parse(gpr_slice encoded_response); - -/** Destroy \a serverlist */ -void grpc_grpclb_destroy_serverlist(grpc_grpclb_serverlist *serverlist); - -/** Parse the list of servers from an encoded \a grpc_grpclb_response */ -grpc_grpclb_serverlist *grpc_grpclb_response_parse_serverlist( - gpr_slice encoded_response); - -/** Destroy \a response */ -void grpc_grpclb_response_destroy(grpc_grpclb_response *response); - -#ifdef __cplusplus -} -#endif - -#endif /* GRPC_INTERNAL_CORE_CLIENT_CONFIG_LB_POLICIES_LOAD_BALANCER_API_H */ diff --git a/src/core/proto/grpc/lb/v0/load_balancer.pb.c b/src/core/proto/grpc/lb/v0/load_balancer.pb.c deleted file mode 100644 index bbb6fa8224..0000000000 --- a/src/core/proto/grpc/lb/v0/load_balancer.pb.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * - * Copyright 2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.4-dev */ - -#include "src/core/proto/grpc/lb/v0/load_balancer.pb.h" - -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -const pb_field_t grpc_lb_v0_Duration_fields[3] = { - PB_FIELD(1, INT64, OPTIONAL, STATIC, FIRST, grpc_lb_v0_Duration, seconds, - seconds, 0), - PB_FIELD(2, INT32, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Duration, nanos, - seconds, 0), - PB_LAST_FIELD}; - -const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3] = { - PB_FIELD(1, MESSAGE, OPTIONAL, STATIC, FIRST, grpc_lb_v0_LoadBalanceRequest, - initial_request, initial_request, - &grpc_lb_v0_InitialLoadBalanceRequest_fields), - PB_FIELD(2, MESSAGE, OPTIONAL, STATIC, OTHER, grpc_lb_v0_LoadBalanceRequest, - client_stats, initial_request, &grpc_lb_v0_ClientStats_fields), - PB_LAST_FIELD}; - -const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2] = { - PB_FIELD(1, STRING, OPTIONAL, STATIC, FIRST, - grpc_lb_v0_InitialLoadBalanceRequest, name, name, 0), - PB_LAST_FIELD}; - -const pb_field_t grpc_lb_v0_ClientStats_fields[4] = { - PB_FIELD(1, INT64, OPTIONAL, STATIC, FIRST, grpc_lb_v0_ClientStats, - total_requests, total_requests, 0), - PB_FIELD(2, INT64, OPTIONAL, STATIC, OTHER, grpc_lb_v0_ClientStats, - client_rpc_errors, total_requests, 0), - PB_FIELD(3, INT64, OPTIONAL, STATIC, OTHER, grpc_lb_v0_ClientStats, - dropped_requests, client_rpc_errors, 0), - PB_LAST_FIELD}; - -const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3] = { - PB_FIELD(1, MESSAGE, OPTIONAL, STATIC, FIRST, - grpc_lb_v0_LoadBalanceResponse, initial_response, initial_response, - &grpc_lb_v0_InitialLoadBalanceResponse_fields), - PB_FIELD(2, MESSAGE, OPTIONAL, STATIC, OTHER, - grpc_lb_v0_LoadBalanceResponse, server_list, initial_response, - &grpc_lb_v0_ServerList_fields), - PB_LAST_FIELD}; - -const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4] = { - PB_FIELD(1, STRING, OPTIONAL, STATIC, FIRST, - grpc_lb_v0_InitialLoadBalanceResponse, client_config, - client_config, 0), - PB_FIELD(2, STRING, OPTIONAL, STATIC, OTHER, - grpc_lb_v0_InitialLoadBalanceResponse, load_balancer_delegate, - client_config, 0), - PB_FIELD(3, MESSAGE, OPTIONAL, STATIC, OTHER, - grpc_lb_v0_InitialLoadBalanceResponse, - client_stats_report_interval, load_balancer_delegate, - &grpc_lb_v0_Duration_fields), - PB_LAST_FIELD}; - -const pb_field_t grpc_lb_v0_ServerList_fields[3] = { - PB_FIELD(1, MESSAGE, REPEATED, CALLBACK, FIRST, grpc_lb_v0_ServerList, - servers, servers, &grpc_lb_v0_Server_fields), - PB_FIELD(3, MESSAGE, OPTIONAL, STATIC, OTHER, grpc_lb_v0_ServerList, - expiration_interval, servers, &grpc_lb_v0_Duration_fields), - PB_LAST_FIELD}; - -const pb_field_t grpc_lb_v0_Server_fields[5] = { - PB_FIELD(1, STRING, OPTIONAL, STATIC, FIRST, grpc_lb_v0_Server, ip_address, - ip_address, 0), - PB_FIELD(2, INT32, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Server, port, - ip_address, 0), - PB_FIELD(3, BYTES, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Server, - load_balance_token, port, 0), - PB_FIELD(4, BOOL, OPTIONAL, STATIC, OTHER, grpc_lb_v0_Server, drop_request, - load_balance_token, 0), - PB_LAST_FIELD}; - -/* Check that field information fits in pb_field_t */ -#if !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_32BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in 8 or 16 bit - * field descriptors. - */ -PB_STATIC_ASSERT( - (pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 65536 && - pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 65536 && - pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 65536 && - pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 65536 && - pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, - client_stats_report_interval) < 65536 && - pb_membersize(grpc_lb_v0_ServerList, servers) < 65536 && - pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 65536), - YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) -#endif - -#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) -/* If you get an error here, it means that you need to define PB_FIELD_16BIT - * compile-time option. You can do that in pb.h or on compiler command line. - * - * The reason you need to do this is that some of your messages contain tag - * numbers or field sizes that are larger than what can fit in the default - * 8 bit descriptors. - */ -PB_STATIC_ASSERT( - (pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 256 && - pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 256 && - pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 256 && - pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 256 && - pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, - client_stats_report_interval) < 256 && - pb_membersize(grpc_lb_v0_ServerList, servers) < 256 && - pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 256), - YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server) -#endif diff --git a/src/core/proto/grpc/lb/v0/load_balancer.pb.h b/src/core/proto/grpc/lb/v0/load_balancer.pb.h deleted file mode 100644 index ac83665839..0000000000 --- a/src/core/proto/grpc/lb/v0/load_balancer.pb.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - * - * Copyright 2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.4-dev */ - -#ifndef PB_LOAD_BALANCER_PB_H_INCLUDED -#define PB_LOAD_BALANCER_PB_H_INCLUDED -#include "third_party/nanopb/pb.h" -#if PB_PROTO_HEADER_VERSION != 30 -#error Regenerate this file with the current version of nanopb generator. -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Enum definitions */ -/* Struct definitions */ -typedef struct _grpc_lb_v0_ClientStats { - bool has_total_requests; - int64_t total_requests; - bool has_client_rpc_errors; - int64_t client_rpc_errors; - bool has_dropped_requests; - int64_t dropped_requests; -} grpc_lb_v0_ClientStats; - -typedef struct _grpc_lb_v0_Duration { - bool has_seconds; - int64_t seconds; - bool has_nanos; - int32_t nanos; -} grpc_lb_v0_Duration; - -typedef struct _grpc_lb_v0_InitialLoadBalanceRequest { - bool has_name; - char name[128]; -} grpc_lb_v0_InitialLoadBalanceRequest; - -typedef PB_BYTES_ARRAY_T(64) grpc_lb_v0_Server_load_balance_token_t; -typedef struct _grpc_lb_v0_Server { - bool has_ip_address; - char ip_address[46]; - bool has_port; - int32_t port; - bool has_load_balance_token; - grpc_lb_v0_Server_load_balance_token_t load_balance_token; - bool has_drop_request; - bool drop_request; -} grpc_lb_v0_Server; - -typedef struct _grpc_lb_v0_InitialLoadBalanceResponse { - bool has_client_config; - char client_config[64]; - bool has_load_balancer_delegate; - char load_balancer_delegate[64]; - bool has_client_stats_report_interval; - grpc_lb_v0_Duration client_stats_report_interval; -} grpc_lb_v0_InitialLoadBalanceResponse; - -typedef struct _grpc_lb_v0_LoadBalanceRequest { - bool has_initial_request; - grpc_lb_v0_InitialLoadBalanceRequest initial_request; - bool has_client_stats; - grpc_lb_v0_ClientStats client_stats; -} grpc_lb_v0_LoadBalanceRequest; - -typedef struct _grpc_lb_v0_ServerList { - pb_callback_t servers; - bool has_expiration_interval; - grpc_lb_v0_Duration expiration_interval; -} grpc_lb_v0_ServerList; - -typedef struct _grpc_lb_v0_LoadBalanceResponse { - bool has_initial_response; - grpc_lb_v0_InitialLoadBalanceResponse initial_response; - bool has_server_list; - grpc_lb_v0_ServerList server_list; -} grpc_lb_v0_LoadBalanceResponse; - -/* Default values for struct fields */ - -/* Initializer values for message structs */ -#define grpc_lb_v0_Duration_init_default \ - { false, 0, false, 0 } -#define grpc_lb_v0_LoadBalanceRequest_init_default \ - { \ - false, grpc_lb_v0_InitialLoadBalanceRequest_init_default, false, \ - grpc_lb_v0_ClientStats_init_default \ - } -#define grpc_lb_v0_InitialLoadBalanceRequest_init_default \ - { false, "" } -#define grpc_lb_v0_ClientStats_init_default \ - { false, 0, false, 0, false, 0 } -#define grpc_lb_v0_LoadBalanceResponse_init_default \ - { \ - false, grpc_lb_v0_InitialLoadBalanceResponse_init_default, false, \ - grpc_lb_v0_ServerList_init_default \ - } -#define grpc_lb_v0_InitialLoadBalanceResponse_init_default \ - { false, "", false, "", false, grpc_lb_v0_Duration_init_default } -#define grpc_lb_v0_ServerList_init_default \ - { \ - { \ - { NULL } \ - , NULL \ - } \ - , false, grpc_lb_v0_Duration_init_default \ - } -#define grpc_lb_v0_Server_init_default \ - { false, "", false, 0, false, {0, {0}}, false, 0 } -#define grpc_lb_v0_Duration_init_zero \ - { false, 0, false, 0 } -#define grpc_lb_v0_LoadBalanceRequest_init_zero \ - { \ - false, grpc_lb_v0_InitialLoadBalanceRequest_init_zero, false, \ - grpc_lb_v0_ClientStats_init_zero \ - } -#define grpc_lb_v0_InitialLoadBalanceRequest_init_zero \ - { false, "" } -#define grpc_lb_v0_ClientStats_init_zero \ - { false, 0, false, 0, false, 0 } -#define grpc_lb_v0_LoadBalanceResponse_init_zero \ - { \ - false, grpc_lb_v0_InitialLoadBalanceResponse_init_zero, false, \ - grpc_lb_v0_ServerList_init_zero \ - } -#define grpc_lb_v0_InitialLoadBalanceResponse_init_zero \ - { false, "", false, "", false, grpc_lb_v0_Duration_init_zero } -#define grpc_lb_v0_ServerList_init_zero \ - { \ - { \ - { NULL } \ - , NULL \ - } \ - , false, grpc_lb_v0_Duration_init_zero \ - } -#define grpc_lb_v0_Server_init_zero \ - { false, "", false, 0, false, {0, {0}}, false, 0 } - -/* Field tags (for use in manual encoding/decoding) */ -#define grpc_lb_v0_ClientStats_total_requests_tag 1 -#define grpc_lb_v0_ClientStats_client_rpc_errors_tag 2 -#define grpc_lb_v0_ClientStats_dropped_requests_tag 3 -#define grpc_lb_v0_Duration_seconds_tag 1 -#define grpc_lb_v0_Duration_nanos_tag 2 -#define grpc_lb_v0_InitialLoadBalanceRequest_name_tag 1 -#define grpc_lb_v0_Server_ip_address_tag 1 -#define grpc_lb_v0_Server_port_tag 2 -#define grpc_lb_v0_Server_load_balance_token_tag 3 -#define grpc_lb_v0_Server_drop_request_tag 4 -#define grpc_lb_v0_InitialLoadBalanceResponse_client_config_tag 1 -#define grpc_lb_v0_InitialLoadBalanceResponse_load_balancer_delegate_tag 2 -#define grpc_lb_v0_InitialLoadBalanceResponse_client_stats_report_interval_tag 3 -#define grpc_lb_v0_LoadBalanceRequest_initial_request_tag 1 -#define grpc_lb_v0_LoadBalanceRequest_client_stats_tag 2 -#define grpc_lb_v0_ServerList_servers_tag 1 -#define grpc_lb_v0_ServerList_expiration_interval_tag 3 -#define grpc_lb_v0_LoadBalanceResponse_initial_response_tag 1 -#define grpc_lb_v0_LoadBalanceResponse_server_list_tag 2 - -/* Struct field encoding specification for nanopb */ -extern const pb_field_t grpc_lb_v0_Duration_fields[3]; -extern const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3]; -extern const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2]; -extern const pb_field_t grpc_lb_v0_ClientStats_fields[4]; -extern const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3]; -extern const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4]; -extern const pb_field_t grpc_lb_v0_ServerList_fields[3]; -extern const pb_field_t grpc_lb_v0_Server_fields[5]; - -/* Maximum encoded size of messages (where known) */ -#define grpc_lb_v0_Duration_size 22 -#define grpc_lb_v0_LoadBalanceRequest_size 169 -#define grpc_lb_v0_InitialLoadBalanceRequest_size 131 -#define grpc_lb_v0_ClientStats_size 33 -#define grpc_lb_v0_InitialLoadBalanceResponse_size 156 -#define grpc_lb_v0_Server_size 127 - -/* Message IDs (where set with "msgid" option) */ -#ifdef PB_MSGID - -#define LOAD_BALANCER_MESSAGES - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif diff --git a/src/proto/grpc/lb/v0/load_balancer.options b/src/proto/grpc/lb/v0/load_balancer.options deleted file mode 100644 index 6d4528f838..0000000000 --- a/src/proto/grpc/lb/v0/load_balancer.options +++ /dev/null @@ -1,6 +0,0 @@ -grpc.lb.v0.InitialLoadBalanceRequest.name max_size:128 -grpc.lb.v0.InitialLoadBalanceResponse.client_config max_size:64 -grpc.lb.v0.InitialLoadBalanceResponse.load_balancer_delegate max_size:64 -grpc.lb.v0.Server.ip_address max_size:46 -grpc.lb.v0.Server.load_balance_token max_size:64 -load_balancer.proto no_unions:true diff --git a/src/proto/grpc/lb/v0/load_balancer.proto b/src/proto/grpc/lb/v0/load_balancer.proto deleted file mode 100644 index e88a4f8c4a..0000000000 --- a/src/proto/grpc/lb/v0/load_balancer.proto +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2016, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package grpc.lb.v0; - -message Duration { - - // Signed seconds of the span of time. Must be from -315,576,000,000 - // to +315,576,000,000 inclusive. - int64 seconds = 1; - - // Signed fractions of a second at nanosecond resolution of the span - // of time. Durations less than one second are represented with a 0 - // `seconds` field and a positive or negative `nanos` field. For durations - // of one second or more, a non-zero value for the `nanos` field must be - // of the same sign as the `seconds` field. Must be from -999,999,999 - // to +999,999,999 inclusive. - int32 nanos = 2; -} - -service LoadBalancer { - // Bidirectional rpc to get a list of servers. - rpc BalanceLoad(stream LoadBalanceRequest) - returns (stream LoadBalanceResponse); -} - -message LoadBalanceRequest { - oneof load_balance_request_type { - // This message should be sent on the first request to the load balancer. - InitialLoadBalanceRequest initial_request = 1; - - // The client stats should be periodically reported to the load balancer - // based on the duration defined in the InitialLoadBalanceResponse. - ClientStats client_stats = 2; - } -} - -message InitialLoadBalanceRequest { - // Name of load balanced service (IE, service.grpc.gslb.google.com) - string name = 1; -} - -// Contains client level statistics that are useful to load balancing. Each -// count should be reset to zero after reporting the stats. -message ClientStats { - // The total number of requests sent by the client since the last report. - int64 total_requests = 1; - - // The number of client rpc errors since the last report. - int64 client_rpc_errors = 2; - - // The number of dropped requests since the last report. - int64 dropped_requests = 3; -} - -message LoadBalanceResponse { - oneof load_balance_response_type { - // This message should be sent on the first response to the client. - InitialLoadBalanceResponse initial_response = 1; - - // Contains the list of servers selected by the load balancer. The client - // should send requests to these servers in the specified order. - ServerList server_list = 2; - } -} - -message InitialLoadBalanceResponse { - oneof initial_response_type { - // Contains gRPC config options like RPC deadline or flow control. - // TODO(yetianx): Change to ClientConfig after it is defined. - string client_config = 1; - - // This is an application layer redirect that indicates the client should - // use the specified server for load balancing. When this field is set in - // the response, the client should open a separate connection to the - // load_balancer_delegate and call the BalanceLoad method. - string load_balancer_delegate = 2; - } - - // This interval defines how often the client should send the client stats - // to the load balancer. Stats should only be reported when the duration is - // positive. - Duration client_stats_report_interval = 3; -} - -message ServerList { - // Contains a list of servers selected by the load balancer. The list will - // be updated when server resolutions change or as needed to balance load - // across more servers. The client should consume the server list in order - // unless instructed otherwise via the client_config. - repeated Server servers = 1; - - // Indicates the amount of time that the client should consider this server - // list as valid. It may be considered stale after waiting this interval of - // time after receiving the list. If the interval is not positive, the - // client can assume the list is valid until the next list is received. - Duration expiration_interval = 3; -} - -message Server { - // A resolved address and port for the server. The IP address string may - // either be an IPv4 or IPv6 address. - string ip_address = 1; - int32 port = 2; - - // An opaque token that is passed from the client to the server in metadata. - // The server may expect this token to indicate that the request from the - // client was load balanced. - // TODO(yetianx): Not used right now, and will be used after implementing - // load report. - bytes load_balance_token = 3; - - // Indicates whether this particular request should be dropped by the client - // when this server is chosen from the list. - bool drop_request = 4; -} diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 60af862305..8e90f7a61d 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -109,7 +109,6 @@ CORE_SOURCE_FILES = [ 'src/core/client_config/connector.c', 'src/core/client_config/default_initial_connect_string.c', 'src/core/client_config/initial_connect_string.c', - 'src/core/client_config/lb_policies/load_balancer_api.c', 'src/core/client_config/lb_policies/pick_first.c', 'src/core/client_config/lb_policies/round_robin.c', 'src/core/client_config/lb_policy.c', @@ -173,7 +172,6 @@ CORE_SOURCE_FILES = [ 'src/core/json/json_reader.c', 'src/core/json/json_string.c', 'src/core/json/json_writer.c', - 'src/core/proto/grpc/lb/v0/load_balancer.pb.c', 'src/core/surface/alarm.c', 'src/core/surface/api_trace.c', 'src/core/surface/byte_buffer.c', @@ -228,9 +226,6 @@ CORE_SOURCE_FILES = [ 'src/core/census/operation.c', 'src/core/census/placeholders.c', 'src/core/census/tracing.c', - 'third_party/nanopb/pb_common.c', - 'third_party/nanopb/pb_decode.c', - 'third_party/nanopb/pb_encode.c', 'src/boringssl/err_data.c', 'third_party/boringssl/crypto/aes/aes.c', 'third_party/boringssl/crypto/aes/mode_wrappers.c', diff --git a/templates/tools/run_tests/sources_and_headers.json.template b/templates/tools/run_tests/sources_and_headers.json.template index 78363ff1fa..04802772af 100644 --- a/templates/tools/run_tests/sources_and_headers.json.template +++ b/templates/tools/run_tests/sources_and_headers.json.template @@ -12,27 +12,20 @@ out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h']) return out - def no_protos_filter(src): - return os.path.splitext(src)[1] != '.proto' - - def no_third_party_filter(src): - return not src.startswith('third_party/') - - def filter_srcs(srcs, filters): + def no_protos(src): out = [] - for s in srcs: - filter_passes = (f(s) for f in filters) - if all(filter_passes): - out.append(s) + for f in src: + if os.path.splitext(f)[1] != '.proto': + out.append(f) return out %> ${json.dumps([{"name": tgt.name, "language": tgt.language, "src": sorted( - filter_srcs(tgt.src, (no_protos_filter, no_third_party_filter)) + - filter_srcs(tgt.get('public_headers', []), (no_protos_filter, no_third_party_filter)) + - filter_srcs(tgt.get('headers', []), (no_third_party_filter,))), + no_protos(tgt.src) + + tgt.get('public_headers', []) + + tgt.get('headers', [])), "headers": sorted( tgt.get('public_headers', []) + tgt.get('headers', []) + diff --git a/test/cpp/grpclb/grpclb_api_test.cc b/test/cpp/grpclb/grpclb_api_test.cc deleted file mode 100644 index bd4885fb4c..0000000000 --- a/test/cpp/grpclb/grpclb_api_test.cc +++ /dev/null @@ -1,133 +0,0 @@ -/* - * - * Copyright 2016, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include -#include - -#include "src/core/client_config/lb_policies/load_balancer_api.h" -#include "src/proto/grpc/lb/v0/load_balancer.pb.h" // C++ version - -namespace grpc { -namespace { - -using grpc::lb::v0::LoadBalanceRequest; -using grpc::lb::v0::LoadBalanceResponse; - -class GrpclbTest : public ::testing::Test {}; - -TEST_F(GrpclbTest, CreateRequest) { - const std::string service_name = "AServiceName"; - LoadBalanceRequest request; - grpc_grpclb_request* c_req = grpc_grpclb_request_create(service_name.c_str()); - gpr_slice slice = grpc_grpclb_request_encode(c_req); - const int num_bytes_written = GPR_SLICE_LENGTH(slice); - EXPECT_GT(num_bytes_written, 0); - request.ParseFromArray(GPR_SLICE_START_PTR(slice), num_bytes_written); - EXPECT_EQ(request.initial_request().name(), service_name); - gpr_slice_unref(slice); - grpc_grpclb_request_destroy(c_req); -} - -TEST_F(GrpclbTest, ParseResponse) { - LoadBalanceResponse response; - const std::string client_config_str = "I'm a client config"; - auto* initial_response = response.mutable_initial_response(); - initial_response->set_client_config(client_config_str); - auto* client_stats_report_interval = - initial_response->mutable_client_stats_report_interval(); - client_stats_report_interval->set_seconds(123); - client_stats_report_interval->set_nanos(456); - - const std::string encoded_response = response.SerializeAsString(); - gpr_slice encoded_slice = - gpr_slice_from_copied_string(encoded_response.c_str()); - grpc_grpclb_response* c_response = grpc_grpclb_response_parse(encoded_slice); - EXPECT_TRUE(c_response->has_initial_response); - EXPECT_TRUE(c_response->initial_response.has_client_config); - EXPECT_FALSE(c_response->initial_response.has_load_balancer_delegate); - EXPECT_TRUE(strcmp(c_response->initial_response.client_config, - client_config_str.c_str()) == 0); - EXPECT_EQ(c_response->initial_response.client_stats_report_interval.seconds, - 123); - EXPECT_EQ(c_response->initial_response.client_stats_report_interval.nanos, - 456); - gpr_slice_unref(encoded_slice); - grpc_grpclb_response_destroy(c_response); -} - -TEST_F(GrpclbTest, ParseResponseServerList) { - LoadBalanceResponse response; - auto* serverlist = response.mutable_server_list(); - auto* server = serverlist->add_servers(); - server->set_ip_address("127.0.0.1"); - server->set_port(12345); - server->set_drop_request(true); - server = response.mutable_server_list()->add_servers(); - server->set_ip_address("10.0.0.1"); - server->set_port(54321); - server->set_drop_request(false); - auto* expiration_interval = serverlist->mutable_expiration_interval(); - expiration_interval->set_seconds(888); - expiration_interval->set_nanos(999); - - const std::string encoded_response = response.SerializeAsString(); - gpr_slice encoded_slice = - gpr_slice_from_copied_string(encoded_response.c_str()); - grpc_grpclb_serverlist* c_serverlist = - grpc_grpclb_response_parse_serverlist(encoded_slice); - ASSERT_EQ(c_serverlist->num_servers, 2ul); - EXPECT_TRUE(c_serverlist->servers[0]->has_ip_address); - EXPECT_TRUE(strcmp(c_serverlist->servers[0]->ip_address, "127.0.0.1") == 0); - EXPECT_EQ(c_serverlist->servers[0]->port, 12345); - EXPECT_TRUE(c_serverlist->servers[0]->drop_request); - EXPECT_TRUE(c_serverlist->servers[1]->has_ip_address); - EXPECT_TRUE(strcmp(c_serverlist->servers[1]->ip_address, "10.0.0.1") == 0); - EXPECT_EQ(c_serverlist->servers[1]->port, 54321); - EXPECT_FALSE(c_serverlist->servers[1]->drop_request); - - EXPECT_TRUE(c_serverlist->expiration_interval.has_seconds); - EXPECT_EQ(c_serverlist->expiration_interval.seconds, 888); - EXPECT_TRUE(c_serverlist->expiration_interval.has_nanos); - EXPECT_EQ(c_serverlist->expiration_interval.nanos, 999); - - gpr_slice_unref(encoded_slice); - grpc_grpclb_destroy_serverlist(c_serverlist); -} - -} // namespace -} // namespace grpc - -int main(int argc, char** argv) { - ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/third_party/nanopb b/third_party/nanopb deleted file mode 160000 index 5497a1dfc9..0000000000 --- a/third_party/nanopb +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5497a1dfc91a86965383cdd1652e348345400435 diff --git a/tools/codegen/core/gen_load_balancing_proto.sh b/tools/codegen/core/gen_load_balancing_proto.sh deleted file mode 100755 index 114dd9d70d..0000000000 --- a/tools/codegen/core/gen_load_balancing_proto.sh +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/bash - -# Copyright 2016, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# -# Example usage: -# tools/codegen/core/gen_load_balancing_proto.sh \ -# src/proto/grpc/lb/v0/load_balancer.proto - -read -r -d '' COPYRIGHT <<'EOF' -/* - * - * Copyright , Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -EOF - -# build clang-format docker image -docker build -t grpc_clang_format tools/dockerfile/grpc_clang_format - -CURRENT_YEAR=$(date +%Y) -COPYRIGHT_FILE=$(mktemp) -echo "${COPYRIGHT//$CURRENT_YEAR}" > $COPYRIGHT_FILE - -set -ex -if [ $# -eq 0 ]; then - echo "Usage: $0 [output dir]" - exit 1 -fi - -readonly GRPC_ROOT=$PWD - -OUTPUT_DIR="$GRPC_ROOT/src/core/proto/grpc/lb/v0" -if [ $# -eq 2 ]; then - mkdir -p "$2" - if [ $? != 0 ]; then - echo "Error creating output directory $2" - exit 2 - fi - OUTPUT_DIR="$2" -fi - -readonly EXPECTED_OPTIONS_FILE_PATH="${1%.*}.options" - -if [[ ! -f "$1" ]]; then - echo "Input proto file '$1' doesn't exist." - exit 3 -fi -if [[ ! -f "${EXPECTED_OPTIONS_FILE_PATH}" ]]; then - echo "Expected nanopb options file '${EXPECTED_OPTIONS_FILE_PATH}' missing" - exit 4 -fi - -pushd "$(dirname $1)" > /dev/null - -protoc \ ---plugin=protoc-gen-nanopb="$GRPC_ROOT/third_party/nanopb/generator/protoc-gen-nanopb" \ ---nanopb_out='-T -L#include\ \"third_party/nanopb/pb.h\"'":$OUTPUT_DIR" \ -"$(basename $1)" - -readonly PROTO_BASENAME=$(basename $1 .proto) -sed -i "s:$PROTO_BASENAME.pb.h:src/core/proto/grpc/lb/v0/$PROTO_BASENAME.pb.h:g" \ - "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" - -# prepend copyright -TMPFILE=$(mktemp) -cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" > $TMPFILE -mv -v $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.c" -cat $COPYRIGHT_FILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" > $TMPFILE -mv -v $TMPFILE "$OUTPUT_DIR/$PROTO_BASENAME.pb.h" - -readonly MOUNTPOINT='/protos' -docker run --rm=true -v ${HOST_GIT_ROOT}/gens/src/proto/grpc/lb/v0:$MOUNTPOINT \ - -t grpc_clang_format \ - clang-format-3.6 -style="{BasedOnStyle: Google, Language: Cpp}" \ - -i $MOUNTPOINT/load_balancer.pb.c $MOUNTPOINT/load_balancer.pb.h - -popd > /dev/null diff --git a/tools/distrib/check_nanopb_output.sh b/tools/distrib/check_nanopb_output.sh deleted file mode 100755 index 78d3a734e9..0000000000 --- a/tools/distrib/check_nanopb_output.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -# Copyright 2015-2016, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -set -ex - -apt-get install -y autoconf automake libtool curl python-virtualenv - -readonly NANOPB_TMP_OUTPUT="${LOCAL_GIT_ROOT}/gens/src/proto/grpc/lb/v0" -readonly VENV_DIR=$(mktemp -d) -# create a virtualenv for nanopb's compiler -pushd $VENV_DIR -readonly VENV_NAME="nanopb-$(date '+%Y%m%d_%H%M%S_%N')" -virtualenv $VENV_NAME -. $VENV_NAME/bin/activate -popd - -# install proto3 -pip install protobuf==3.0.0b2 - -# change to root directory -cd $(dirname $0)/../.. - -# build clang-format docker image -docker build -t grpc_clang_format tools/dockerfile/grpc_clang_format - -# install protoc version 3 -pushd third_party/protobuf -./autogen.sh -./configure -make -make install -ldconfig -popd - -if [ ! -x "/usr/local/bin/protoc" ]; then - echo "Error: protoc not found in path" - exit 1 -fi -readonly PROTOC_PATH='/usr/local/bin' -# stack up and change to nanopb's proto generator directory -pushd third_party/nanopb/generator/proto -PATH="$PROTOC_PATH:$PATH" make - -# back to the root directory -popd - - -# nanopb-compile the proto to a temp location -PATH="$PROTOC_PATH:$PATH" ./tools/codegen/core/gen_load_balancing_proto.sh \ - src/proto/grpc/lb/v0/load_balancer.proto \ - $NANOPB_TMP_OUTPUT - -# compare outputs to checked compiled code -diff -rq $NANOPB_TMP_OUTPUT src/core/proto/grpc/lb/v0 -if [ $? != 0 ]; then - echo "Outputs differ: $NANOPB_TMP_OUTPUT vs src/core/proto/grpc/lb/v0" - exit 1 -fi -deactivate diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index c6f1b6ae7c..b626843233 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -801,7 +801,6 @@ src/core/channel/subchannel_call_holder.h \ src/core/client_config/client_config.h \ src/core/client_config/connector.h \ src/core/client_config/initial_connect_string.h \ -src/core/client_config/lb_policies/load_balancer_api.h \ src/core/client_config/lb_policies/pick_first.h \ src/core/client_config/lb_policies/round_robin.h \ src/core/client_config/lb_policy.h \ @@ -862,7 +861,6 @@ src/core/json/json.h \ src/core/json/json_common.h \ src/core/json/json_reader.h \ src/core/json/json_writer.h \ -src/core/proto/grpc/lb/v0/load_balancer.pb.h \ src/core/statistics/census_interface.h \ src/core/statistics/census_rpc_stats.h \ src/core/surface/api_trace.h \ @@ -904,10 +902,6 @@ src/core/transport/transport.h \ src/core/transport/transport_impl.h \ src/core/census/aggregation.h \ src/core/census/rpc_metric_id.h \ -third_party/nanopb/pb.h \ -third_party/nanopb/pb_common.h \ -third_party/nanopb/pb_decode.h \ -third_party/nanopb/pb_encode.h \ src/core/httpcli/httpcli_security_connector.c \ src/core/security/base64.c \ src/core/security/client_auth_filter.c \ @@ -944,7 +938,6 @@ src/core/client_config/client_config.c \ src/core/client_config/connector.c \ src/core/client_config/default_initial_connect_string.c \ src/core/client_config/initial_connect_string.c \ -src/core/client_config/lb_policies/load_balancer_api.c \ src/core/client_config/lb_policies/pick_first.c \ src/core/client_config/lb_policies/round_robin.c \ src/core/client_config/lb_policy.c \ @@ -1008,7 +1001,6 @@ src/core/json/json.c \ src/core/json/json_reader.c \ src/core/json/json_string.c \ src/core/json/json_writer.c \ -src/core/proto/grpc/lb/v0/load_balancer.pb.c \ src/core/surface/alarm.c \ src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ @@ -1063,9 +1055,6 @@ src/core/census/initialize.c \ src/core/census/operation.c \ src/core/census/placeholders.c \ src/core/census/tracing.c \ -third_party/nanopb/pb_common.c \ -third_party/nanopb/pb_decode.c \ -third_party/nanopb/pb_encode.c \ include/grpc/support/alloc.h \ include/grpc/support/atm.h \ include/grpc/support/atm_gcc_atomic.h \ diff --git a/tools/jenkins/build_docker_and_run_tests.sh b/tools/jenkins/build_docker_and_run_tests.sh index daa29b2f94..e2ac7518f0 100755 --- a/tools/jenkins/build_docker_and_run_tests.sh +++ b/tools/jenkins/build_docker_and_run_tests.sh @@ -60,9 +60,6 @@ docker build -t $DOCKER_IMAGE_NAME $DOCKERFILE_DIR # Choose random name for docker container CONTAINER_NAME="run_tests_$(uuidgen)" -# Git root as seen by the docker instance -docker_instance_git_root=/var/local/jenkins/grpc - # Run tests inside docker docker run \ -e "RUN_TESTS_COMMAND=$RUN_TESTS_COMMAND" \ @@ -72,10 +69,9 @@ docker run \ -e XDG_CACHE_HOME=/tmp/xdg-cache-home \ -e THIS_IS_REALLY_NEEDED='see https://github.com/docker/docker/issues/14203 for why docker is awful' \ -e HOST_GIT_ROOT=$git_root \ - -e LOCAL_GIT_ROOT=$docker_instance_git_root \ -e "BUILD_ID=$BUILD_ID" \ -i $TTY_FLAG \ - -v "$git_root:$docker_instance_git_root" \ + -v "$git_root:/var/local/jenkins/grpc" \ -v /tmp/ccache:/tmp/ccache \ -v /tmp/npm-cache:/tmp/npm-cache \ -v /tmp/xdg-cache-home:/tmp/xdg-cache-home \ diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index c08b382638..f49230e49a 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -44,7 +44,6 @@ cat << EOF | awk '{ print $1 }' | sort > $want_submodules 9f897b25800d2f54f5c442ef01a60721aeca6d87 third_party/boringssl (version_for_cocoapods_1.0-67-g9f897b2) 05b155ff59114735ec8cd089f669c4c3d8f59029 third_party/gflags (v2.1.0-45-g05b155f) c99458533a9b4c743ed51537e25989ea55944908 third_party/googletest (release-1.7.0) - 5497a1dfc91a86965383cdd1652e348345400435 third_party/nanopb (nanopb-0.3.3-10-g5497a1d) d5fb408ddc281ffcadeb08699e65bb694656d0bd third_party/protobuf (v3.0.0-beta-2) 50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8) EOF diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml index 1fc0525e02..809e6ce645 100644 --- a/tools/run_tests/sanity/sanity_tests.yaml +++ b/tools/run_tests/sanity/sanity_tests.yaml @@ -7,4 +7,3 @@ - script: tools/distrib/check_copyright.py - script: tools/distrib/clang_format_code.sh - script: tools/distrib/check_trailing_newlines.sh -- script: tools/distrib/check_nanopb_output.sh diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 76fa3d0776..6538ddc37e 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -1644,23 +1644,6 @@ "src/compiler/ruby_plugin.cc" ] }, - { - "deps": [ - "grpc", - "grpc++", - "grpc++_test_util", - "grpc_test_util" - ], - "headers": [ - "src/proto/grpc/lb/v0/load_balancer.grpc.pb.h", - "src/proto/grpc/lb/v0/load_balancer.pb.h" - ], - "language": "c++", - "name": "grpclb_api_test", - "src": [ - "test/cpp/grpclb/grpclb_api_test.cc" - ] - }, { "deps": [ "gpr", @@ -3000,7 +2983,6 @@ "src/core/client_config/client_config.h", "src/core/client_config/connector.h", "src/core/client_config/initial_connect_string.h", - "src/core/client_config/lb_policies/load_balancer_api.h", "src/core/client_config/lb_policies/pick_first.h", "src/core/client_config/lb_policies/round_robin.h", "src/core/client_config/lb_policy.h", @@ -3061,7 +3043,6 @@ "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/security/auth_filters.h", "src/core/security/base64.h", "src/core/security/credentials.h", @@ -3114,11 +3095,7 @@ "src/core/tsi/ssl_transport_security.h", "src/core/tsi/ssl_types.h", "src/core/tsi/transport_security.h", - "src/core/tsi/transport_security_interface.h", - "third_party/nanopb/pb.h", - "third_party/nanopb/pb_common.h", - "third_party/nanopb/pb_decode.h", - "third_party/nanopb/pb_encode.h" + "src/core/tsi/transport_security_interface.h" ], "language": "c", "name": "grpc", @@ -3172,8 +3149,6 @@ "src/core/client_config/default_initial_connect_string.c", "src/core/client_config/initial_connect_string.c", "src/core/client_config/initial_connect_string.h", - "src/core/client_config/lb_policies/load_balancer_api.c", - "src/core/client_config/lb_policies/load_balancer_api.h", "src/core/client_config/lb_policies/pick_first.c", "src/core/client_config/lb_policies/pick_first.h", "src/core/client_config/lb_policies/round_robin.c", @@ -3298,8 +3273,6 @@ "src/core/json/json_string.c", "src/core/json/json_writer.c", "src/core/json/json_writer.h", - "src/core/proto/grpc/lb/v0/load_balancer.pb.c", - "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/security/auth_filters.h", "src/core/security/base64.c", "src/core/security/base64.h", @@ -3535,7 +3508,6 @@ "src/core/client_config/client_config.h", "src/core/client_config/connector.h", "src/core/client_config/initial_connect_string.h", - "src/core/client_config/lb_policies/load_balancer_api.h", "src/core/client_config/lb_policies/pick_first.h", "src/core/client_config/lb_policies/round_robin.h", "src/core/client_config/lb_policy.h", @@ -3596,7 +3568,6 @@ "src/core/json/json_common.h", "src/core/json/json_reader.h", "src/core/json/json_writer.h", - "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.h", @@ -3635,11 +3606,7 @@ "src/core/transport/metadata_batch.h", "src/core/transport/static_metadata.h", "src/core/transport/transport.h", - "src/core/transport/transport_impl.h", - "third_party/nanopb/pb.h", - "third_party/nanopb/pb_common.h", - "third_party/nanopb/pb_decode.h", - "third_party/nanopb/pb_encode.h" + "src/core/transport/transport_impl.h" ], "language": "c", "name": "grpc_unsecure", @@ -3692,8 +3659,6 @@ "src/core/client_config/default_initial_connect_string.c", "src/core/client_config/initial_connect_string.c", "src/core/client_config/initial_connect_string.h", - "src/core/client_config/lb_policies/load_balancer_api.c", - "src/core/client_config/lb_policies/load_balancer_api.h", "src/core/client_config/lb_policies/pick_first.c", "src/core/client_config/lb_policies/pick_first.h", "src/core/client_config/lb_policies/round_robin.c", @@ -3817,8 +3782,6 @@ "src/core/json/json_string.c", "src/core/json/json_writer.c", "src/core/json/json_writer.h", - "src/core/proto/grpc/lb/v0/load_balancer.pb.c", - "src/core/proto/grpc/lb/v0/load_balancer.pb.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/alarm.c", diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 3b9bce1ec3..2c73c40d1f 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -2019,26 +2019,6 @@ "windows" ] }, - { - "args": [], - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "flaky": false, - "language": "c++", - "name": "grpclb_api_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ] - }, { "args": [], "ci_platforms": [ diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index 4e1155f84b..76975322be 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -310,7 +310,6 @@ - @@ -371,7 +370,6 @@ - @@ -413,10 +411,6 @@ - - - - @@ -491,8 +485,6 @@ - - @@ -619,8 +611,6 @@ - - @@ -729,12 +719,6 @@ - - - - - - diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index e0cfd8295b..4660572f97 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -109,9 +109,6 @@ src\core\client_config - - src\core\client_config\lb_policies - src\core\client_config\lb_policies @@ -301,9 +298,6 @@ src\core\json - - src\core\proto\grpc\lb\v0 - src\core\surface @@ -466,15 +460,6 @@ src\core\census - - third_party\nanopb - - - third_party\nanopb - - - third_party\nanopb - @@ -602,9 +587,6 @@ src\core\client_config - - src\core\client_config\lb_policies - src\core\client_config\lb_policies @@ -785,9 +767,6 @@ src\core\json - - src\core\proto\grpc\lb\v0 - src\core\statistics @@ -911,18 +890,6 @@ src\core\census - - third_party\nanopb - - - third_party\nanopb - - - third_party\nanopb - - - third_party\nanopb - @@ -974,18 +941,6 @@ {e665cc0e-b994-d7c5-cc18-2007392019f0} - - {1ff04466-0905-8a5d-d6f4-7ff2df4c13b5} - - - {7c7ad0b3-bf85-5bd3-e0c8-4f5468a8e2e6} - - - {3d533dad-8100-e8a3-b7c3-1fc13a4d60da} - - - {0ffcf868-7617-5fed-b6ce-2162d9d09148} - {1d850ac6-e639-4eab-5338-4ba40272fcc9} @@ -1004,12 +959,6 @@ {0b0f9ab1-efa4-7f03-e446-6fb9b5227e84} - - {aaab30a4-2a15-732e-c141-3fbc0f0f5a7a} - - - {93d6596d-330c-1d27-6f84-3c840e57869e} - diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index 3820d89968..541000af40 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -286,7 +286,6 @@ - @@ -347,7 +346,6 @@ - @@ -389,10 +387,6 @@ - - - - @@ -427,8 +421,6 @@ - - @@ -555,8 +547,6 @@ - - @@ -665,12 +655,6 @@ - - - - - - diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index c4c957d36b..48814f997e 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -49,9 +49,6 @@ src\core\client_config - - src\core\client_config\lb_policies - src\core\client_config\lb_policies @@ -241,9 +238,6 @@ src\core\json - - src\core\proto\grpc\lb\v0 - src\core\surface @@ -406,15 +400,6 @@ src\core\census - - third_party\nanopb - - - third_party\nanopb - - - third_party\nanopb - @@ -497,9 +482,6 @@ src\core\client_config - - src\core\client_config\lb_policies - src\core\client_config\lb_policies @@ -680,9 +662,6 @@ src\core\json - - src\core\proto\grpc\lb\v0 - src\core\statistics @@ -806,18 +785,6 @@ src\core\census - - third_party\nanopb - - - third_party\nanopb - - - third_party\nanopb - - - third_party\nanopb - @@ -869,18 +836,6 @@ {443ffc61-1bea-2477-6e54-1ddf8c139264} - - {7f4bb22a-65ba-0f8f-6387-66b1f6677a80} - - - {9c2bd164-c317-8a13-564d-3b28b0fd79cf} - - - {2bad8e10-4fc5-d8b3-e026-4abbd0c25cda} - - - {4475c8ed-e01b-8906-47d0-8a504189c0d5} - {e084164c-a069-00e3-db35-4e0b1cd6f0b7} @@ -893,12 +848,6 @@ {5fcd6206-f774-9ae6-4b85-305d6a723843} - - {025c051e-8eba-125b-67f9-173f95176eb2} - - - {6511f77d-f28c-80e0-0889-8975e688e344} - diff --git a/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj b/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj deleted file mode 100644 index 1509ece9f9..0000000000 --- a/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {990AF023-17D7-8DBF-EB6E-14C7C016C77E} - true - $(SolutionDir)IntDir\$(MSBuildProjectName)\ - - - - v100 - - - v110 - - - v120 - - - v140 - - - Application - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - - - grpclb_api_test - static - Debug - static - Debug - - - grpclb_api_test - static - Release - static - Release - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDebug - true - None - false - - - Console - true - false - - - - - - NotUsing - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDebug - true - None - false - - - Console - true - false - - - - - - NotUsing - Level3 - MaxSpeed - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - true - true - MultiThreaded - true - None - false - - - Console - true - false - true - true - - - - - - NotUsing - Level3 - MaxSpeed - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - true - true - MultiThreaded - true - None - false - - - Console - true - false - true - true - - - - - - - - - - - - - - - - - - {0BE77741-552A-929B-A497-4EF7ECE17A64} - - - {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} - - - {C187A093-A0FE-489D-A40A-6E33DE0F9FEB} - - - {29D16885-7228-4C31-81ED-5F9187C7F2A9} - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - diff --git a/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj.filters b/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj.filters deleted file mode 100644 index 6c57b8c162..0000000000 --- a/vsprojects/vcxproj/test/grpclb_api_test/grpclb_api_test.vcxproj.filters +++ /dev/null @@ -1,39 +0,0 @@ - - - - - src\proto\grpc\lb\v0 - - - test\cpp\grpclb - - - - - - {a31d21fb-c6ab-75ce-43dc-7d6f506765e6} - - - {10d49c90-8503-9b10-6678-eed983bc25d9} - - - {8b6be783-e071-44cc-2096-f1c476012556} - - - {2981699e-c196-c599-bc17-c177770f89ee} - - - {3d04774a-1c2f-e100-435e-08af5d539250} - - - {64736e1d-eb77-664f-34ab-6cf41263d3d8} - - - {c86e9cb1-bed4-3697-40f2-9ecff6297fa5} - - - {6b5ba83a-6cf2-5a7b-0ab8-62de31882705} - - - - -- cgit v1.2.3