From b4d5c7cee42154b0e24006287a93022ec605def0 Mon Sep 17 00:00:00 2001 From: Moiz Haidry Date: Mon, 8 Oct 2018 10:10:31 -0700 Subject: Benchmark test for callback unary gRPC Every thread intitiates multiple RPCs. The Callback of the unary RPC then issues a new RPC and this goes until the benchmark shuts down. For shutdown the main thread waits on a conditional variable. After shutdown the callbacks increment a rpcs done variable and once the the rpcs done equate the the total number of outstanding rpcs, the last callback performing the increment operation also issues a signal to wake up the main thread. The mainthread process to join the other threads and perform cleanup --- src/proto/grpc/testing/control.proto | 1 + 1 file changed, 1 insertion(+) (limited to 'src/proto') diff --git a/src/proto/grpc/testing/control.proto b/src/proto/grpc/testing/control.proto index a4a9c8fe57..4cfdc2cafb 100644 --- a/src/proto/grpc/testing/control.proto +++ b/src/proto/grpc/testing/control.proto @@ -25,6 +25,7 @@ enum ClientType { SYNC_CLIENT = 0; ASYNC_CLIENT = 1; OTHER_CLIENT = 2; // used for some language-specific variants + CALLBACK_CLIENT = 3; } enum ServerType { -- cgit v1.2.3 From 873e0757cb841288d48514b0fe2e50b870171f61 Mon Sep 17 00:00:00 2001 From: Naresh Date: Tue, 9 Oct 2018 17:04:11 +0000 Subject: Bazel rules for Python grpcio_health_checking Add Bazel rules for building and testing grpcio_health_checking. An unofficial fork for rules_protobuf is used for now as it incorporates a change (#196 by duduko on the upstream repo pubref/rules_protobuf) which allows the protoc compiler to compile generated protos too. This was not merged because the change was failing for golang, but works as expected for Python. This is needed because grpcio_health_checking fetches it's proto file from a different directory (previously achived through setup.py) and thus needs to be moved to the required location within bazel-genfiles using a genrule. --- WORKSPACE | 5 ++-- src/proto/grpc/health/v1/BUILD | 8 ++++++ .../grpc_health/v1/BUILD.bazel | 33 ++++++++++++++++++++++ .../grpcio_tests/tests/health_check/BUILD.bazel | 15 ++++++++++ 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel create mode 100644 src/python/grpcio_tests/tests/health_check/BUILD.bazel (limited to 'src/proto') diff --git a/WORKSPACE b/WORKSPACE index 9a0c41977f..a547c24cbe 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -34,10 +34,11 @@ pip_import( load("@grpc_python_dependencies//:requirements.bzl", "pip_install") pip_install() +# NOTE(https://github.com/pubref/rules_protobuf/pull/196): Switch to upstream repo after this gets merged. git_repository( name="org_pubref_rules_protobuf", - remote="https://github.com/pubref/rules_protobuf", - tag="v0.8.2", + remote="https://github.com/ghostwriternr/rules_protobuf", + tag="v0.8.2.1-alpha", ) load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_repositories") diff --git a/src/proto/grpc/health/v1/BUILD b/src/proto/grpc/health/v1/BUILD index d234842883..97642985c9 100644 --- a/src/proto/grpc/health/v1/BUILD +++ b/src/proto/grpc/health/v1/BUILD @@ -22,3 +22,11 @@ grpc_proto_library( name = "health_proto", srcs = ["health.proto"], ) + +filegroup( + name = "health_proto_file", + srcs = [ + "health.proto", + ], +) + diff --git a/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel b/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel new file mode 100644 index 0000000000..ce3121fa90 --- /dev/null +++ b/src/python/grpcio_health_checking/grpc_health/v1/BUILD.bazel @@ -0,0 +1,33 @@ +load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") + +package(default_visibility = ["//visibility:public"]) + +genrule( + name = "mv_health_proto", + srcs = [ + "//src/proto/grpc/health/v1:health_proto_file", + ], + outs = ["health.proto",], + cmd = "cp $< $@", +) + +py_proto_library( + name = "py_health_proto", + protos = [":mv_health_proto",], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], +) + +py_library( + name = "grpc_health", + srcs = ["health.py",], + deps = [ + ":py_health_proto", + "//src/python/grpcio/grpc:grpcio", + ], + imports=["../../",], +) + diff --git a/src/python/grpcio_tests/tests/health_check/BUILD.bazel b/src/python/grpcio_tests/tests/health_check/BUILD.bazel new file mode 100644 index 0000000000..19e1e1b2e1 --- /dev/null +++ b/src/python/grpcio_tests/tests/health_check/BUILD.bazel @@ -0,0 +1,15 @@ +package(default_visibility = ["//visibility:public"]) + +py_test( + name = "health_servicer_test", + srcs = ["_health_servicer_test.py"], + main = "_health_servicer_test.py", + size = "small", + deps = [ + "//src/python/grpcio/grpc:grpcio", + "//src/python/grpcio_health_checking/grpc_health/v1:grpc_health", + "//src/python/grpcio_tests/tests/unit:test_common", + ], + imports = ["../../",], +) + -- cgit v1.2.3 From 9172775bc82b071acb81f08e81e7d7706a9dee3f Mon Sep 17 00:00:00 2001 From: Naresh Date: Thu, 11 Oct 2018 08:43:34 +0000 Subject: Bazel rules for gRPC Python interop tests Add interop tests for gRPC Python. py_proto_library rules are added to src/proto/grpc/testing/BUILD since grpc_proto_library is not compatible with py_* rules. 'requests' python module is added to requirements.bazel.txt as it is a dependency for google-auth. Previously, this was installed through tools/run_tests/helper_scripts/build_python.sh before running tests. --- requirements.bazel.txt | 1 + src/proto/grpc/testing/BUILD | 34 ++++++++ src/python/grpcio_tests/tests/interop/BUILD.bazel | 97 ++++++++++++++++++++++ .../tests/interop/credentials/BUILD.bazel | 9 ++ 4 files changed, 141 insertions(+) create mode 100644 src/python/grpcio_tests/tests/interop/BUILD.bazel create mode 100644 src/python/grpcio_tests/tests/interop/credentials/BUILD.bazel (limited to 'src/proto') diff --git a/requirements.bazel.txt b/requirements.bazel.txt index 16f31f9e94..efbf5314af 100644 --- a/requirements.bazel.txt +++ b/requirements.bazel.txt @@ -8,3 +8,4 @@ wheel>=0.29 futures>=2.2.0 google-auth>=1.0.0 oauth2client==4.1.0 +requests>=2.14.2 diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD index 16721ff2ed..7048911b9a 100644 --- a/src/proto/grpc/testing/BUILD +++ b/src/proto/grpc/testing/BUILD @@ -15,6 +15,8 @@ licenses(["notice"]) # Apache v2 load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package") +load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") grpc_package(name = "testing", visibility = "public") @@ -58,12 +60,30 @@ grpc_proto_library( has_services = False, ) +py_proto_library( + name = "py_empty_proto", + protos = ["empty.proto",], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], +) + grpc_proto_library( name = "messages_proto", srcs = ["messages.proto"], has_services = False, ) +py_proto_library( + name = "py_messages_proto", + protos = ["messages.proto",], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], +) + grpc_proto_library( name = "metrics_proto", srcs = ["metrics.proto"], @@ -116,3 +136,17 @@ grpc_proto_library( "messages_proto", ], ) + +py_proto_library( + name = "py_test_proto", + protos = ["test.proto",], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], + proto_deps = [ + ":py_empty_proto", + ":py_messages_proto", + ] +) + diff --git a/src/python/grpcio_tests/tests/interop/BUILD.bazel b/src/python/grpcio_tests/tests/interop/BUILD.bazel new file mode 100644 index 0000000000..a39f30d32a --- /dev/null +++ b/src/python/grpcio_tests/tests/interop/BUILD.bazel @@ -0,0 +1,97 @@ +load("@grpc_python_dependencies//:requirements.bzl", "requirement") + +package(default_visibility = ["//visibility:public"]) + +py_library( + name = "_intraop_test_case", + srcs = ["_intraop_test_case.py"], + deps = [ + ":methods", + ], + imports=["../../",], +) + +py_library( + name = "client", + srcs = ["client.py"], + deps = [ + "//src/python/grpcio/grpc:grpcio", + ":methods", + ":resources", + "//src/proto/grpc/testing:py_test_proto", + requirement('google-auth'), + ], + imports=["../../",], +) + +py_library( + name = "methods", + srcs = ["methods.py"], + deps = [ + "//src/python/grpcio/grpc:grpcio", + "//src/proto/grpc/testing:py_empty_proto", + "//src/proto/grpc/testing:py_messages_proto", + "//src/proto/grpc/testing:py_test_proto", + requirement('google-auth'), + requirement('requests'), + requirement('enum34'), + ], + imports=["../../",], +) + +py_library( + name = "resources", + srcs = ["resources.py"], + data = [ + "//src/python/grpcio_tests/tests/interop/credentials", + ], +) + +py_library( + name = "server", + srcs = ["server.py"], + deps = [ + "//src/python/grpcio/grpc:grpcio", + ":methods", + ":resources", + "//src/python/grpcio_tests/tests/unit:test_common", + "//src/proto/grpc/testing:py_test_proto", + ], + imports=["../../",], +) + +py_test( + name="_insecure_intraop_test", + size="small", + srcs=["_insecure_intraop_test.py",], + main="_insecure_intraop_test.py", + deps=[ + "//src/python/grpcio/grpc:grpcio", + ":_intraop_test_case", + ":methods", + ":server", + "//src/python/grpcio_tests/tests/unit:test_common", + "//src/proto/grpc/testing:py_test_proto", + ], + imports=["../../",], + data=[ + "//src/python/grpcio_tests/tests/unit/credentials", + ], +) + +py_test( + name="_secure_intraop_test", + size="small", + srcs=["_secure_intraop_test.py",], + main="_secure_intraop_test.py", + deps=[ + "//src/python/grpcio/grpc:grpcio", + ":_intraop_test_case", + ":methods", + ":server", + "//src/python/grpcio_tests/tests/unit:test_common", + "//src/proto/grpc/testing:py_test_proto", + ], + imports=["../../",], +) + diff --git a/src/python/grpcio_tests/tests/interop/credentials/BUILD.bazel b/src/python/grpcio_tests/tests/interop/credentials/BUILD.bazel new file mode 100644 index 0000000000..bc2b997292 --- /dev/null +++ b/src/python/grpcio_tests/tests/interop/credentials/BUILD.bazel @@ -0,0 +1,9 @@ +package(default_visibility = ["//visibility:public"]) + +filegroup( + name="credentials", + srcs=glob([ + "**", + ]), +) + -- cgit v1.2.3 From 2e78e516ad8cb45cff705581625f85e5033b4e5b Mon Sep 17 00:00:00 2001 From: Naresh Date: Thu, 11 Oct 2018 09:14:58 +0000 Subject: Bazel rules for Python grpcio_reflection --- src/proto/grpc/reflection/v1alpha/BUILD | 8 +++++ src/proto/grpc/testing/BUILD | 11 +++++++ src/proto/grpc/testing/proto2/BUILD.bazel | 30 +++++++++++++++++++ .../grpc_reflection/v1alpha/BUILD.bazel | 34 ++++++++++++++++++++++ .../grpcio_tests/tests/reflection/BUILD.bazel | 21 +++++++++++++ 5 files changed, 104 insertions(+) create mode 100644 src/proto/grpc/testing/proto2/BUILD.bazel create mode 100644 src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel create mode 100644 src/python/grpcio_tests/tests/reflection/BUILD.bazel (limited to 'src/proto') diff --git a/src/proto/grpc/reflection/v1alpha/BUILD b/src/proto/grpc/reflection/v1alpha/BUILD index 4605418447..4d919d029e 100644 --- a/src/proto/grpc/reflection/v1alpha/BUILD +++ b/src/proto/grpc/reflection/v1alpha/BUILD @@ -22,3 +22,11 @@ grpc_proto_library( name = "reflection_proto", srcs = ["reflection.proto"], ) + +filegroup( + name = "reflection_proto_file", + srcs = [ + "reflection.proto", + ], +) + diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD index 16721ff2ed..7d68f87d3b 100644 --- a/src/proto/grpc/testing/BUILD +++ b/src/proto/grpc/testing/BUILD @@ -15,6 +15,8 @@ licenses(["notice"]) # Apache v2 load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package") +load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") grpc_package(name = "testing", visibility = "public") @@ -58,6 +60,15 @@ grpc_proto_library( has_services = False, ) +py_proto_library( + name = "py_empty_proto", + protos = ["empty.proto",], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], +) + grpc_proto_library( name = "messages_proto", srcs = ["messages.proto"], diff --git a/src/proto/grpc/testing/proto2/BUILD.bazel b/src/proto/grpc/testing/proto2/BUILD.bazel new file mode 100644 index 0000000000..c4c4f004ef --- /dev/null +++ b/src/proto/grpc/testing/proto2/BUILD.bazel @@ -0,0 +1,30 @@ +load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") + +package(default_visibility = ["//visibility:public"]) + +py_proto_library( + name = "empty2_proto", + protos = [ + "empty2.proto", + ], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], +) + +py_proto_library( + name = "empty2_extensions_proto", + protos = [ + "empty2_extensions.proto", + ], + proto_deps = [ + ":empty2_proto", + ], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], +) + diff --git a/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel b/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel new file mode 100644 index 0000000000..3a2ba26371 --- /dev/null +++ b/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel @@ -0,0 +1,34 @@ +load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") + +package(default_visibility = ["//visibility:public"]) + +genrule( + name = "mv_reflection_proto", + srcs = [ + "//src/proto/grpc/reflection/v1alpha:reflection_proto_file", + ], + outs = ["reflection.proto",], + cmd = "cp $< $@", +) + +py_proto_library( + name = "py_reflection_proto", + protos = [":mv_reflection_proto",], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], +) + +py_library( + name = "grpc_reflection", + srcs = ["reflection.py",], + deps = [ + ":py_reflection_proto", + "//src/python/grpcio/grpc:grpcio", + requirement('protobuf'), + ], + imports=["../../",], +) + diff --git a/src/python/grpcio_tests/tests/reflection/BUILD.bazel b/src/python/grpcio_tests/tests/reflection/BUILD.bazel new file mode 100644 index 0000000000..c0efb0b7ce --- /dev/null +++ b/src/python/grpcio_tests/tests/reflection/BUILD.bazel @@ -0,0 +1,21 @@ +load("@grpc_python_dependencies//:requirements.bzl", "requirement") + +package(default_visibility = ["//visibility:public"]) + +py_test( + name="_reflection_servicer_test", + size="small", + timeout="moderate", + srcs=["_reflection_servicer_test.py",], + main="_reflection_servicer_test.py", + deps=[ + "//src/python/grpcio/grpc:grpcio", + "//src/python/grpcio_reflection/grpc_reflection/v1alpha:grpc_reflection", + "//src/python/grpcio_tests/tests/unit:test_common", + "//src/proto/grpc/testing:py_empty_proto", + "//src/proto/grpc/testing/proto2:empty2_extensions_proto", + requirement('protobuf'), + ], + imports=["../../",], +) + -- cgit v1.2.3 From 079e25016751169a2aebb1b03ef735d4f63e1d70 Mon Sep 17 00:00:00 2001 From: Naresh Date: Fri, 12 Oct 2018 16:05:07 +0000 Subject: Rename BUILD files to Bazel convention --- src/proto/grpc/reflection/v1alpha/BUILD | 32 ------ src/proto/grpc/reflection/v1alpha/BUILD.bazel | 32 ++++++ src/proto/grpc/testing/BUILD | 152 -------------------------- src/proto/grpc/testing/BUILD.bazel | 152 ++++++++++++++++++++++++++ 4 files changed, 184 insertions(+), 184 deletions(-) delete mode 100644 src/proto/grpc/reflection/v1alpha/BUILD create mode 100644 src/proto/grpc/reflection/v1alpha/BUILD.bazel delete mode 100644 src/proto/grpc/testing/BUILD create mode 100644 src/proto/grpc/testing/BUILD.bazel (limited to 'src/proto') diff --git a/src/proto/grpc/reflection/v1alpha/BUILD b/src/proto/grpc/reflection/v1alpha/BUILD deleted file mode 100644 index 4d919d029e..0000000000 --- a/src/proto/grpc/reflection/v1alpha/BUILD +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -licenses(["notice"]) # Apache v2 - -load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package") - -grpc_package(name = "reflection", visibility = "public") - -grpc_proto_library( - name = "reflection_proto", - srcs = ["reflection.proto"], -) - -filegroup( - name = "reflection_proto_file", - srcs = [ - "reflection.proto", - ], -) - diff --git a/src/proto/grpc/reflection/v1alpha/BUILD.bazel b/src/proto/grpc/reflection/v1alpha/BUILD.bazel new file mode 100644 index 0000000000..4d919d029e --- /dev/null +++ b/src/proto/grpc/reflection/v1alpha/BUILD.bazel @@ -0,0 +1,32 @@ +# Copyright 2017 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache v2 + +load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package") + +grpc_package(name = "reflection", visibility = "public") + +grpc_proto_library( + name = "reflection_proto", + srcs = ["reflection.proto"], +) + +filegroup( + name = "reflection_proto_file", + srcs = [ + "reflection.proto", + ], +) + diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD deleted file mode 100644 index 7048911b9a..0000000000 --- a/src/proto/grpc/testing/BUILD +++ /dev/null @@ -1,152 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -licenses(["notice"]) # Apache v2 - -load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package") -load("@grpc_python_dependencies//:requirements.bzl", "requirement") -load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") - -grpc_package(name = "testing", visibility = "public") - -exports_files([ - "echo.proto", - "echo_messages.proto", -]) - -grpc_proto_library( - name = "compiler_test_proto", - srcs = ["compiler_test.proto"], - generate_mocks = True, -) - -grpc_proto_library( - name = "control_proto", - srcs = ["control.proto"], - has_services = False, - deps = [ - "payloads_proto", - "stats_proto", - ], -) - -grpc_proto_library( - name = "echo_messages_proto", - srcs = ["echo_messages.proto"], - has_services = False, -) - -grpc_proto_library( - name = "echo_proto", - srcs = ["echo.proto"], - deps = ["echo_messages_proto"], - generate_mocks = True, -) - -grpc_proto_library( - name = "empty_proto", - srcs = ["empty.proto"], - has_services = False, -) - -py_proto_library( - name = "py_empty_proto", - protos = ["empty.proto",], - with_grpc = True, - deps = [ - requirement('protobuf'), - ], -) - -grpc_proto_library( - name = "messages_proto", - srcs = ["messages.proto"], - has_services = False, -) - -py_proto_library( - name = "py_messages_proto", - protos = ["messages.proto",], - with_grpc = True, - deps = [ - requirement('protobuf'), - ], -) - -grpc_proto_library( - name = "metrics_proto", - srcs = ["metrics.proto"], -) - -grpc_proto_library( - name = "payloads_proto", - srcs = ["payloads.proto"], - has_services = False, -) - -grpc_proto_library( - name = "benchmark_service_proto", - srcs = ["benchmark_service.proto"], - deps = [ - "messages_proto", - ], -) - -grpc_proto_library( - name = "report_qps_scenario_service_proto", - srcs = ["report_qps_scenario_service.proto"], - deps = [ - "control_proto", - ], -) - -grpc_proto_library( - name = "worker_service_proto", - srcs = ["worker_service.proto"], - deps = [ - "control_proto", - ], -) - -grpc_proto_library( - name = "stats_proto", - srcs = ["stats.proto"], - has_services = False, - deps = [ - "//src/proto/grpc/core:stats_proto", - ] -) - -grpc_proto_library( - name = "test_proto", - srcs = ["test.proto"], - deps = [ - "empty_proto", - "messages_proto", - ], -) - -py_proto_library( - name = "py_test_proto", - protos = ["test.proto",], - with_grpc = True, - deps = [ - requirement('protobuf'), - ], - proto_deps = [ - ":py_empty_proto", - ":py_messages_proto", - ] -) - diff --git a/src/proto/grpc/testing/BUILD.bazel b/src/proto/grpc/testing/BUILD.bazel new file mode 100644 index 0000000000..7048911b9a --- /dev/null +++ b/src/proto/grpc/testing/BUILD.bazel @@ -0,0 +1,152 @@ +# Copyright 2017 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache v2 + +load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package") +load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") + +grpc_package(name = "testing", visibility = "public") + +exports_files([ + "echo.proto", + "echo_messages.proto", +]) + +grpc_proto_library( + name = "compiler_test_proto", + srcs = ["compiler_test.proto"], + generate_mocks = True, +) + +grpc_proto_library( + name = "control_proto", + srcs = ["control.proto"], + has_services = False, + deps = [ + "payloads_proto", + "stats_proto", + ], +) + +grpc_proto_library( + name = "echo_messages_proto", + srcs = ["echo_messages.proto"], + has_services = False, +) + +grpc_proto_library( + name = "echo_proto", + srcs = ["echo.proto"], + deps = ["echo_messages_proto"], + generate_mocks = True, +) + +grpc_proto_library( + name = "empty_proto", + srcs = ["empty.proto"], + has_services = False, +) + +py_proto_library( + name = "py_empty_proto", + protos = ["empty.proto",], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], +) + +grpc_proto_library( + name = "messages_proto", + srcs = ["messages.proto"], + has_services = False, +) + +py_proto_library( + name = "py_messages_proto", + protos = ["messages.proto",], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], +) + +grpc_proto_library( + name = "metrics_proto", + srcs = ["metrics.proto"], +) + +grpc_proto_library( + name = "payloads_proto", + srcs = ["payloads.proto"], + has_services = False, +) + +grpc_proto_library( + name = "benchmark_service_proto", + srcs = ["benchmark_service.proto"], + deps = [ + "messages_proto", + ], +) + +grpc_proto_library( + name = "report_qps_scenario_service_proto", + srcs = ["report_qps_scenario_service.proto"], + deps = [ + "control_proto", + ], +) + +grpc_proto_library( + name = "worker_service_proto", + srcs = ["worker_service.proto"], + deps = [ + "control_proto", + ], +) + +grpc_proto_library( + name = "stats_proto", + srcs = ["stats.proto"], + has_services = False, + deps = [ + "//src/proto/grpc/core:stats_proto", + ] +) + +grpc_proto_library( + name = "test_proto", + srcs = ["test.proto"], + deps = [ + "empty_proto", + "messages_proto", + ], +) + +py_proto_library( + name = "py_test_proto", + protos = ["test.proto",], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], + proto_deps = [ + ":py_empty_proto", + ":py_messages_proto", + ] +) + -- cgit v1.2.3 From c992454355c2c7cb30166df1ffe8a743d4bce9ab Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Fri, 12 Oct 2018 12:11:52 -0700 Subject: Revert "Rename BUILD files to Bazel convention" This reverts commit 079e25016751169a2aebb1b03ef735d4f63e1d70. --- src/proto/grpc/reflection/v1alpha/BUILD | 32 ++++++ src/proto/grpc/reflection/v1alpha/BUILD.bazel | 32 ------ src/proto/grpc/testing/BUILD | 152 ++++++++++++++++++++++++++ src/proto/grpc/testing/BUILD.bazel | 152 -------------------------- 4 files changed, 184 insertions(+), 184 deletions(-) create mode 100644 src/proto/grpc/reflection/v1alpha/BUILD delete mode 100644 src/proto/grpc/reflection/v1alpha/BUILD.bazel create mode 100644 src/proto/grpc/testing/BUILD delete mode 100644 src/proto/grpc/testing/BUILD.bazel (limited to 'src/proto') diff --git a/src/proto/grpc/reflection/v1alpha/BUILD b/src/proto/grpc/reflection/v1alpha/BUILD new file mode 100644 index 0000000000..4d919d029e --- /dev/null +++ b/src/proto/grpc/reflection/v1alpha/BUILD @@ -0,0 +1,32 @@ +# Copyright 2017 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache v2 + +load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package") + +grpc_package(name = "reflection", visibility = "public") + +grpc_proto_library( + name = "reflection_proto", + srcs = ["reflection.proto"], +) + +filegroup( + name = "reflection_proto_file", + srcs = [ + "reflection.proto", + ], +) + diff --git a/src/proto/grpc/reflection/v1alpha/BUILD.bazel b/src/proto/grpc/reflection/v1alpha/BUILD.bazel deleted file mode 100644 index 4d919d029e..0000000000 --- a/src/proto/grpc/reflection/v1alpha/BUILD.bazel +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -licenses(["notice"]) # Apache v2 - -load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package") - -grpc_package(name = "reflection", visibility = "public") - -grpc_proto_library( - name = "reflection_proto", - srcs = ["reflection.proto"], -) - -filegroup( - name = "reflection_proto_file", - srcs = [ - "reflection.proto", - ], -) - diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD new file mode 100644 index 0000000000..7048911b9a --- /dev/null +++ b/src/proto/grpc/testing/BUILD @@ -0,0 +1,152 @@ +# Copyright 2017 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +licenses(["notice"]) # Apache v2 + +load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package") +load("@grpc_python_dependencies//:requirements.bzl", "requirement") +load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") + +grpc_package(name = "testing", visibility = "public") + +exports_files([ + "echo.proto", + "echo_messages.proto", +]) + +grpc_proto_library( + name = "compiler_test_proto", + srcs = ["compiler_test.proto"], + generate_mocks = True, +) + +grpc_proto_library( + name = "control_proto", + srcs = ["control.proto"], + has_services = False, + deps = [ + "payloads_proto", + "stats_proto", + ], +) + +grpc_proto_library( + name = "echo_messages_proto", + srcs = ["echo_messages.proto"], + has_services = False, +) + +grpc_proto_library( + name = "echo_proto", + srcs = ["echo.proto"], + deps = ["echo_messages_proto"], + generate_mocks = True, +) + +grpc_proto_library( + name = "empty_proto", + srcs = ["empty.proto"], + has_services = False, +) + +py_proto_library( + name = "py_empty_proto", + protos = ["empty.proto",], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], +) + +grpc_proto_library( + name = "messages_proto", + srcs = ["messages.proto"], + has_services = False, +) + +py_proto_library( + name = "py_messages_proto", + protos = ["messages.proto",], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], +) + +grpc_proto_library( + name = "metrics_proto", + srcs = ["metrics.proto"], +) + +grpc_proto_library( + name = "payloads_proto", + srcs = ["payloads.proto"], + has_services = False, +) + +grpc_proto_library( + name = "benchmark_service_proto", + srcs = ["benchmark_service.proto"], + deps = [ + "messages_proto", + ], +) + +grpc_proto_library( + name = "report_qps_scenario_service_proto", + srcs = ["report_qps_scenario_service.proto"], + deps = [ + "control_proto", + ], +) + +grpc_proto_library( + name = "worker_service_proto", + srcs = ["worker_service.proto"], + deps = [ + "control_proto", + ], +) + +grpc_proto_library( + name = "stats_proto", + srcs = ["stats.proto"], + has_services = False, + deps = [ + "//src/proto/grpc/core:stats_proto", + ] +) + +grpc_proto_library( + name = "test_proto", + srcs = ["test.proto"], + deps = [ + "empty_proto", + "messages_proto", + ], +) + +py_proto_library( + name = "py_test_proto", + protos = ["test.proto",], + with_grpc = True, + deps = [ + requirement('protobuf'), + ], + proto_deps = [ + ":py_empty_proto", + ":py_messages_proto", + ] +) + diff --git a/src/proto/grpc/testing/BUILD.bazel b/src/proto/grpc/testing/BUILD.bazel deleted file mode 100644 index 7048911b9a..0000000000 --- a/src/proto/grpc/testing/BUILD.bazel +++ /dev/null @@ -1,152 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -licenses(["notice"]) # Apache v2 - -load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package") -load("@grpc_python_dependencies//:requirements.bzl", "requirement") -load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") - -grpc_package(name = "testing", visibility = "public") - -exports_files([ - "echo.proto", - "echo_messages.proto", -]) - -grpc_proto_library( - name = "compiler_test_proto", - srcs = ["compiler_test.proto"], - generate_mocks = True, -) - -grpc_proto_library( - name = "control_proto", - srcs = ["control.proto"], - has_services = False, - deps = [ - "payloads_proto", - "stats_proto", - ], -) - -grpc_proto_library( - name = "echo_messages_proto", - srcs = ["echo_messages.proto"], - has_services = False, -) - -grpc_proto_library( - name = "echo_proto", - srcs = ["echo.proto"], - deps = ["echo_messages_proto"], - generate_mocks = True, -) - -grpc_proto_library( - name = "empty_proto", - srcs = ["empty.proto"], - has_services = False, -) - -py_proto_library( - name = "py_empty_proto", - protos = ["empty.proto",], - with_grpc = True, - deps = [ - requirement('protobuf'), - ], -) - -grpc_proto_library( - name = "messages_proto", - srcs = ["messages.proto"], - has_services = False, -) - -py_proto_library( - name = "py_messages_proto", - protos = ["messages.proto",], - with_grpc = True, - deps = [ - requirement('protobuf'), - ], -) - -grpc_proto_library( - name = "metrics_proto", - srcs = ["metrics.proto"], -) - -grpc_proto_library( - name = "payloads_proto", - srcs = ["payloads.proto"], - has_services = False, -) - -grpc_proto_library( - name = "benchmark_service_proto", - srcs = ["benchmark_service.proto"], - deps = [ - "messages_proto", - ], -) - -grpc_proto_library( - name = "report_qps_scenario_service_proto", - srcs = ["report_qps_scenario_service.proto"], - deps = [ - "control_proto", - ], -) - -grpc_proto_library( - name = "worker_service_proto", - srcs = ["worker_service.proto"], - deps = [ - "control_proto", - ], -) - -grpc_proto_library( - name = "stats_proto", - srcs = ["stats.proto"], - has_services = False, - deps = [ - "//src/proto/grpc/core:stats_proto", - ] -) - -grpc_proto_library( - name = "test_proto", - srcs = ["test.proto"], - deps = [ - "empty_proto", - "messages_proto", - ], -) - -py_proto_library( - name = "py_test_proto", - protos = ["test.proto",], - with_grpc = True, - deps = [ - requirement('protobuf'), - ], - proto_deps = [ - ":py_empty_proto", - ":py_messages_proto", - ] -) - -- cgit v1.2.3 From 45e8ada064b7e95599a4aef5434cdd2ff02d6543 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Fri, 12 Oct 2018 12:12:29 -0700 Subject: Revert "Bazel rules for Python grpcio_reflection" This reverts commit 2e78e516ad8cb45cff705581625f85e5033b4e5b. --- src/proto/grpc/reflection/v1alpha/BUILD | 8 ----- src/proto/grpc/testing/BUILD | 11 ------- src/proto/grpc/testing/proto2/BUILD.bazel | 30 ------------------- .../grpc_reflection/v1alpha/BUILD.bazel | 34 ---------------------- .../grpcio_tests/tests/reflection/BUILD.bazel | 21 ------------- 5 files changed, 104 deletions(-) delete mode 100644 src/proto/grpc/testing/proto2/BUILD.bazel delete mode 100644 src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel delete mode 100644 src/python/grpcio_tests/tests/reflection/BUILD.bazel (limited to 'src/proto') diff --git a/src/proto/grpc/reflection/v1alpha/BUILD b/src/proto/grpc/reflection/v1alpha/BUILD index 4d919d029e..4605418447 100644 --- a/src/proto/grpc/reflection/v1alpha/BUILD +++ b/src/proto/grpc/reflection/v1alpha/BUILD @@ -22,11 +22,3 @@ grpc_proto_library( name = "reflection_proto", srcs = ["reflection.proto"], ) - -filegroup( - name = "reflection_proto_file", - srcs = [ - "reflection.proto", - ], -) - diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD index 7048911b9a..f6a8f69d24 100644 --- a/src/proto/grpc/testing/BUILD +++ b/src/proto/grpc/testing/BUILD @@ -15,8 +15,6 @@ licenses(["notice"]) # Apache v2 load("//bazel:grpc_build_system.bzl", "grpc_proto_library", "grpc_package") -load("@grpc_python_dependencies//:requirements.bzl", "requirement") -load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") grpc_package(name = "testing", visibility = "public") @@ -60,15 +58,6 @@ grpc_proto_library( has_services = False, ) -py_proto_library( - name = "py_empty_proto", - protos = ["empty.proto",], - with_grpc = True, - deps = [ - requirement('protobuf'), - ], -) - grpc_proto_library( name = "messages_proto", srcs = ["messages.proto"], diff --git a/src/proto/grpc/testing/proto2/BUILD.bazel b/src/proto/grpc/testing/proto2/BUILD.bazel deleted file mode 100644 index c4c4f004ef..0000000000 --- a/src/proto/grpc/testing/proto2/BUILD.bazel +++ /dev/null @@ -1,30 +0,0 @@ -load("@grpc_python_dependencies//:requirements.bzl", "requirement") -load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") - -package(default_visibility = ["//visibility:public"]) - -py_proto_library( - name = "empty2_proto", - protos = [ - "empty2.proto", - ], - with_grpc = True, - deps = [ - requirement('protobuf'), - ], -) - -py_proto_library( - name = "empty2_extensions_proto", - protos = [ - "empty2_extensions.proto", - ], - proto_deps = [ - ":empty2_proto", - ], - with_grpc = True, - deps = [ - requirement('protobuf'), - ], -) - diff --git a/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel b/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel deleted file mode 100644 index 3a2ba26371..0000000000 --- a/src/python/grpcio_reflection/grpc_reflection/v1alpha/BUILD.bazel +++ /dev/null @@ -1,34 +0,0 @@ -load("@grpc_python_dependencies//:requirements.bzl", "requirement") -load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_library") - -package(default_visibility = ["//visibility:public"]) - -genrule( - name = "mv_reflection_proto", - srcs = [ - "//src/proto/grpc/reflection/v1alpha:reflection_proto_file", - ], - outs = ["reflection.proto",], - cmd = "cp $< $@", -) - -py_proto_library( - name = "py_reflection_proto", - protos = [":mv_reflection_proto",], - with_grpc = True, - deps = [ - requirement('protobuf'), - ], -) - -py_library( - name = "grpc_reflection", - srcs = ["reflection.py",], - deps = [ - ":py_reflection_proto", - "//src/python/grpcio/grpc:grpcio", - requirement('protobuf'), - ], - imports=["../../",], -) - diff --git a/src/python/grpcio_tests/tests/reflection/BUILD.bazel b/src/python/grpcio_tests/tests/reflection/BUILD.bazel deleted file mode 100644 index c0efb0b7ce..0000000000 --- a/src/python/grpcio_tests/tests/reflection/BUILD.bazel +++ /dev/null @@ -1,21 +0,0 @@ -load("@grpc_python_dependencies//:requirements.bzl", "requirement") - -package(default_visibility = ["//visibility:public"]) - -py_test( - name="_reflection_servicer_test", - size="small", - timeout="moderate", - srcs=["_reflection_servicer_test.py",], - main="_reflection_servicer_test.py", - deps=[ - "//src/python/grpcio/grpc:grpcio", - "//src/python/grpcio_reflection/grpc_reflection/v1alpha:grpc_reflection", - "//src/python/grpcio_tests/tests/unit:test_common", - "//src/proto/grpc/testing:py_empty_proto", - "//src/proto/grpc/testing/proto2:empty2_extensions_proto", - requirement('protobuf'), - ], - imports=["../../",], -) - -- cgit v1.2.3 From 9d2f985f555718af2ab97eb50b332f06d7abd4f9 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Fri, 12 Oct 2018 12:12:36 -0700 Subject: Revert "Bazel rules for gRPC Python interop tests" This reverts commit 9172775bc82b071acb81f08e81e7d7706a9dee3f. --- requirements.bazel.txt | 1 - src/proto/grpc/testing/BUILD | 23 ----- src/python/grpcio_tests/tests/interop/BUILD.bazel | 97 ---------------------- .../tests/interop/credentials/BUILD.bazel | 9 -- 4 files changed, 130 deletions(-) delete mode 100644 src/python/grpcio_tests/tests/interop/BUILD.bazel delete mode 100644 src/python/grpcio_tests/tests/interop/credentials/BUILD.bazel (limited to 'src/proto') diff --git a/requirements.bazel.txt b/requirements.bazel.txt index efbf5314af..16f31f9e94 100644 --- a/requirements.bazel.txt +++ b/requirements.bazel.txt @@ -8,4 +8,3 @@ wheel>=0.29 futures>=2.2.0 google-auth>=1.0.0 oauth2client==4.1.0 -requests>=2.14.2 diff --git a/src/proto/grpc/testing/BUILD b/src/proto/grpc/testing/BUILD index f6a8f69d24..16721ff2ed 100644 --- a/src/proto/grpc/testing/BUILD +++ b/src/proto/grpc/testing/BUILD @@ -64,15 +64,6 @@ grpc_proto_library( has_services = False, ) -py_proto_library( - name = "py_messages_proto", - protos = ["messages.proto",], - with_grpc = True, - deps = [ - requirement('protobuf'), - ], -) - grpc_proto_library( name = "metrics_proto", srcs = ["metrics.proto"], @@ -125,17 +116,3 @@ grpc_proto_library( "messages_proto", ], ) - -py_proto_library( - name = "py_test_proto", - protos = ["test.proto",], - with_grpc = True, - deps = [ - requirement('protobuf'), - ], - proto_deps = [ - ":py_empty_proto", - ":py_messages_proto", - ] -) - diff --git a/src/python/grpcio_tests/tests/interop/BUILD.bazel b/src/python/grpcio_tests/tests/interop/BUILD.bazel deleted file mode 100644 index a39f30d32a..0000000000 --- a/src/python/grpcio_tests/tests/interop/BUILD.bazel +++ /dev/null @@ -1,97 +0,0 @@ -load("@grpc_python_dependencies//:requirements.bzl", "requirement") - -package(default_visibility = ["//visibility:public"]) - -py_library( - name = "_intraop_test_case", - srcs = ["_intraop_test_case.py"], - deps = [ - ":methods", - ], - imports=["../../",], -) - -py_library( - name = "client", - srcs = ["client.py"], - deps = [ - "//src/python/grpcio/grpc:grpcio", - ":methods", - ":resources", - "//src/proto/grpc/testing:py_test_proto", - requirement('google-auth'), - ], - imports=["../../",], -) - -py_library( - name = "methods", - srcs = ["methods.py"], - deps = [ - "//src/python/grpcio/grpc:grpcio", - "//src/proto/grpc/testing:py_empty_proto", - "//src/proto/grpc/testing:py_messages_proto", - "//src/proto/grpc/testing:py_test_proto", - requirement('google-auth'), - requirement('requests'), - requirement('enum34'), - ], - imports=["../../",], -) - -py_library( - name = "resources", - srcs = ["resources.py"], - data = [ - "//src/python/grpcio_tests/tests/interop/credentials", - ], -) - -py_library( - name = "server", - srcs = ["server.py"], - deps = [ - "//src/python/grpcio/grpc:grpcio", - ":methods", - ":resources", - "//src/python/grpcio_tests/tests/unit:test_common", - "//src/proto/grpc/testing:py_test_proto", - ], - imports=["../../",], -) - -py_test( - name="_insecure_intraop_test", - size="small", - srcs=["_insecure_intraop_test.py",], - main="_insecure_intraop_test.py", - deps=[ - "//src/python/grpcio/grpc:grpcio", - ":_intraop_test_case", - ":methods", - ":server", - "//src/python/grpcio_tests/tests/unit:test_common", - "//src/proto/grpc/testing:py_test_proto", - ], - imports=["../../",], - data=[ - "//src/python/grpcio_tests/tests/unit/credentials", - ], -) - -py_test( - name="_secure_intraop_test", - size="small", - srcs=["_secure_intraop_test.py",], - main="_secure_intraop_test.py", - deps=[ - "//src/python/grpcio/grpc:grpcio", - ":_intraop_test_case", - ":methods", - ":server", - "//src/python/grpcio_tests/tests/unit:test_common", - "//src/proto/grpc/testing:py_test_proto", - ], - imports=["../../",], -) - diff --git a/src/python/grpcio_tests/tests/interop/credentials/BUILD.bazel b/src/python/grpcio_tests/tests/interop/credentials/BUILD.bazel deleted file mode 100644 index bc2b997292..0000000000 --- a/src/python/grpcio_tests/tests/interop/credentials/BUILD.bazel +++ /dev/null @@ -1,9 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -filegroup( - name="credentials", - srcs=glob([ - "**", - ]), -) - -- cgit v1.2.3