• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 The gRPC Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15load("@rules_python//python:defs.bzl", "py_binary", "py_library")
16
17package(
18    default_testonly = 1,
19    default_visibility = ["//visibility:public"],
20)
21
22py_library(
23    name = "benchmark_client",
24    srcs = ["benchmark_client.py"],
25    srcs_version = "PY3",
26    deps = [
27        "//src/proto/grpc/testing:benchmark_service_py_pb2_grpc",
28        "//src/proto/grpc/testing:py_messages_proto",
29        "//src/python/grpcio/grpc:grpcio",
30        "//src/python/grpcio_tests/tests/qps:histogram",
31        "//src/python/grpcio_tests/tests/unit:resources",
32    ],
33)
34
35py_library(
36    name = "benchmark_servicer",
37    srcs = ["benchmark_servicer.py"],
38    srcs_version = "PY3",
39    deps = [
40        "//src/proto/grpc/testing:benchmark_service_py_pb2_grpc",
41        "//src/proto/grpc/testing:py_messages_proto",
42        "//src/python/grpcio/grpc:grpcio",
43    ],
44)
45
46py_library(
47    name = "worker_servicer",
48    srcs = ["worker_servicer.py"],
49    data = [
50        "//src/python/grpcio_tests/tests/unit/credentials",
51    ],
52    srcs_version = "PY3",
53    deps = [
54        ":benchmark_client",
55        ":benchmark_servicer",
56        "//src/proto/grpc/testing:benchmark_service_py_pb2_grpc",
57        "//src/proto/grpc/testing:control_py_pb2",
58        "//src/proto/grpc/testing:payloads_py_pb2",
59        "//src/proto/grpc/testing:stats_py_pb2",
60        "//src/proto/grpc/testing:worker_service_py_pb2_grpc",
61        "//src/python/grpcio/grpc:grpcio",
62        "//src/python/grpcio_tests/tests/qps:histogram",
63        "//src/python/grpcio_tests/tests/unit:resources",
64        "//src/python/grpcio_tests/tests/unit/framework/common",
65    ],
66)
67
68py_binary(
69    name = "server",
70    srcs = ["server.py"],
71    python_version = "PY3",
72    deps = [":benchmark_servicer"],
73)
74
75py_binary(
76    name = "worker",
77    srcs = ["worker.py"],
78    imports = ["../../"],
79    python_version = "PY3",
80    deps = [
81        ":worker_servicer",
82        "//src/proto/grpc/testing:worker_service_py_pb2_grpc",
83    ],
84)
85