pygrpc-native 0.7.0__tar.gz → 0.7.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/.github/workflows/ci.yml +22 -0
  2. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/.pre-commit-config.yaml +3 -3
  3. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/CHANGELOG.md +8 -0
  4. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/Cargo.lock +1 -1
  5. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/Cargo.toml +1 -1
  6. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/PKG-INFO +1 -1
  7. pygrpc_native-0.7.1/interop/_protos.py +18 -0
  8. pygrpc_native-0.7.1/interop/expected_diffs.toml +2 -0
  9. pygrpc_native-0.7.1/interop/protos/src/proto/grpc/testing/empty.proto +28 -0
  10. pygrpc_native-0.7.1/interop/protos/src/proto/grpc/testing/messages.proto +354 -0
  11. pygrpc_native-0.7.1/interop/protos/src/proto/grpc/testing/test.proto +116 -0
  12. pygrpc_native-0.7.1/interop/python_client.py +435 -0
  13. pygrpc_native-0.7.1/interop/run.py +205 -0
  14. pygrpc_native-0.7.1/interop/server.py +66 -0
  15. pygrpc_native-0.7.1/interop/service.py +155 -0
  16. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/python/pygrpc_native/_server.py +4 -1
  17. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/python/pygrpc_native/aio.py +11 -1
  18. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_aio.py +26 -0
  19. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_server.py +9 -0
  20. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/.github/CODEOWNERS +0 -0
  21. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  22. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  23. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  24. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  25. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/.github/dependabot.yml +0 -0
  26. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/.github/workflows/dco.yml +0 -0
  27. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/.github/workflows/release.yml +0 -0
  28. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/.github/workflows/stale.yml +0 -0
  29. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/.gitignore +0 -0
  30. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/CODE_OF_CONDUCT.md +0 -0
  31. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/CONTRIBUTING.md +0 -0
  32. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/DCO +0 -0
  33. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/LICENSE +0 -0
  34. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/README.md +0 -0
  35. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/SECURITY.md +0 -0
  36. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/benchmarks/README.md +0 -0
  37. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/benchmarks/echo.py +0 -0
  38. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/docs/low-level-api.md +0 -0
  39. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/pyproject.toml +0 -0
  40. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/python/pygrpc_native/__init__.py +0 -0
  41. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/python/pygrpc_native/_native.pyi +0 -0
  42. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/python/pygrpc_native/py.typed +0 -0
  43. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/src/lib.rs +0 -0
  44. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/src/metrics.rs +0 -0
  45. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/src/server.rs +0 -0
  46. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_add_methods.py +0 -0
  47. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_api.py +0 -0
  48. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_bearer_auth.py +0 -0
  49. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_call_details.py +0 -0
  50. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_calls.py +0 -0
  51. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_concurrency_limit.py +0 -0
  52. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_connection.py +0 -0
  53. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_delay_stream_headers.py +0 -0
  54. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_downstream.py +0 -0
  55. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_fallback.py +0 -0
  56. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_front.py +0 -0
  57. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_generic_methods.py +0 -0
  58. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_interceptors.py +0 -0
  59. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_metrics.py +0 -0
  60. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_response_metadata.py +0 -0
  61. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/tests/test_stream_try_send.py +0 -0
  62. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/CHANGELOG.md +0 -0
  63. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/Cargo.toml +0 -0
  64. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/LICENSE-APACHE +0 -0
  65. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/LICENSE-MIT +0 -0
  66. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/README.md +0 -0
  67. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/byte_str.rs +0 -0
  68. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/convert.rs +0 -0
  69. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/error.rs +0 -0
  70. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/extensions.rs +0 -0
  71. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/header/map.rs +0 -0
  72. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/header/mod.rs +0 -0
  73. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/header/name.rs +0 -0
  74. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/header/value.rs +0 -0
  75. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/lib.rs +0 -0
  76. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/method.rs +0 -0
  77. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/request.rs +0 -0
  78. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/response.rs +0 -0
  79. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/status.rs +0 -0
  80. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/uri/authority.rs +0 -0
  81. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/uri/builder.rs +0 -0
  82. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/uri/mod.rs +0 -0
  83. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/uri/path.rs +0 -0
  84. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/uri/port.rs +0 -0
  85. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/uri/scheme.rs +0 -0
  86. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/uri/tests.rs +0 -0
  87. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/src/version.rs +0 -0
  88. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/tests/header_map.rs +0 -0
  89. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/tests/header_map_fuzz.rs +0 -0
  90. {pygrpc_native-0.7.0 → pygrpc_native-0.7.1}/vendor/http/tests/status_code.rs +0 -0
@@ -65,3 +65,25 @@ jobs:
65
65
  maturin build --release --locked --out dist
66
66
  python -m pip install dist/*.whl
67
67
  - run: pytest -q tests
68
+
69
+ interop:
70
+ runs-on: ubuntu-latest
71
+ steps:
72
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
73
+ - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
74
+ with:
75
+ python-version: "3.12"
76
+ - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
77
+ with:
78
+ go-version: stable
79
+ cache: false
80
+ - uses: dtolnay/rust-toolchain@stable
81
+ - name: Build and install
82
+ run: |
83
+ python -m pip install maturin grpcio grpcio-tools
84
+ maturin build --release --locked --out dist
85
+ python -m pip install dist/*.whl
86
+ GOBIN="$RUNNER_TEMP" go install google.golang.org/grpc/interop/client@v1.77.0
87
+ - run: python interop/run.py --go-client "$RUNNER_TEMP/client" --table interop-results.md
88
+ - if: always()
89
+ run: cat interop-results.md >> "$GITHUB_STEP_SUMMARY"
@@ -10,9 +10,9 @@ repos:
10
10
  rev: v2.4.1
11
11
  hooks:
12
12
  - id: codespell
13
- exclude: ^Cargo\.lock$
14
- # "te" is an HTTP/2 header name.
15
- args: [--ignore-words-list, te]
13
+ exclude: ^(Cargo\.lock|interop/protos/.*)$
14
+ # "te" is an HTTP/2 header name; COMPRESSABLE is a name in the interop protos.
15
+ args: [--ignore-words-list, "te,compressable"]
16
16
  - repo: local
17
17
  hooks:
18
18
  - id: rust-fmt
@@ -4,6 +4,14 @@ All notable changes are listed here. The project follows
4
4
  [semantic versioning](https://semver.org); see
5
5
  [Compatibility](README.md#compatibility) for what that covers.
6
6
 
7
+ ## 0.7.1 (2026-10-31)
8
+
9
+ ### Fixed
10
+
11
+ - A handler that passed a plain int to `set_code()` or `abort()` left the call
12
+ hanging until the client's deadline. The sync server now sends `UNKNOWN` for
13
+ it and the aio server sends the int's status code, as grpcio's servers do.
14
+
7
15
  ## 0.7.0 (2026-10-30)
8
16
 
9
17
  ### Added
@@ -395,7 +395,7 @@ dependencies = [
395
395
 
396
396
  [[package]]
397
397
  name = "pygrpc_native"
398
- version = "0.7.0"
398
+ version = "0.7.1"
399
399
  dependencies = [
400
400
  "bytes",
401
401
  "crossbeam-channel",
@@ -2,7 +2,7 @@
2
2
 
3
3
  [package]
4
4
  name = "pygrpc_native"
5
- version = "0.7.0"
5
+ version = "0.7.1"
6
6
  edition = "2021"
7
7
  license = "Apache-2.0"
8
8
  description = "A gRPC server in Rust that hands calls to Python handlers in batches"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygrpc-native
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Rust
6
6
  Classifier: Operating System :: POSIX :: Linux
@@ -0,0 +1,18 @@
1
+ """Generates the interop test protos into a temp directory and puts it on sys.path."""
2
+
3
+ import sys
4
+ import tempfile
5
+ from pathlib import Path
6
+
7
+ from grpc_tools import protoc
8
+
9
+ PROTOS = Path(__file__).parent / "protos"
10
+
11
+
12
+ def load() -> None:
13
+ out = tempfile.mkdtemp(prefix="pygrpc-interop-")
14
+ files = [str(p.relative_to(PROTOS)) for p in sorted(PROTOS.rglob("*.proto"))]
15
+ args = ["protoc", f"-I{PROTOS}", f"--python_out={out}", f"--grpc_python_out={out}"]
16
+ if protoc.main(args + files) != 0:
17
+ raise RuntimeError("protoc failed")
18
+ sys.path.insert(0, out)
@@ -0,0 +1,2 @@
1
+ # Cases that pass on grpcio but not on pygrpc-native, each with the issue that
2
+ # tracks it. `modes` and `clients` default to all of them.
@@ -0,0 +1,28 @@
1
+
2
+ // Copyright 2015 gRPC authors.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ syntax = "proto3";
17
+
18
+ package grpc.testing;
19
+
20
+ // An empty message that you can re-use to avoid defining duplicated empty
21
+ // messages in your project. A typical example is to use it as argument or the
22
+ // return value of a service API. For instance:
23
+ //
24
+ // service Foo {
25
+ // rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
26
+ // };
27
+ //
28
+ message Empty {}
@@ -0,0 +1,354 @@
1
+ // Copyright 2015-2016 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
+
15
+ // Message definitions to be used by integration test service definitions.
16
+
17
+ syntax = "proto3";
18
+
19
+ package grpc.testing;
20
+
21
+ option java_package = "io.grpc.testing.integration";
22
+
23
+ // TODO(dgq): Go back to using well-known types once
24
+ // https://github.com/grpc/grpc/issues/6980 has been fixed.
25
+ // import "google/protobuf/wrappers.proto";
26
+ message BoolValue {
27
+ // The bool value.
28
+ bool value = 1;
29
+ }
30
+
31
+ // The type of payload that should be returned.
32
+ enum PayloadType {
33
+ // Compressable text format.
34
+ COMPRESSABLE = 0;
35
+ }
36
+
37
+ // A block of data, to simply increase gRPC message size.
38
+ message Payload {
39
+ // The type of data in body.
40
+ PayloadType type = 1;
41
+ // Primary contents of payload.
42
+ bytes body = 2;
43
+ }
44
+
45
+ // A protobuf representation for grpc status. This is used by test
46
+ // clients to specify a status that the server should attempt to return.
47
+ message EchoStatus {
48
+ int32 code = 1;
49
+ string message = 2;
50
+ }
51
+
52
+ // The type of route that a client took to reach a server w.r.t. gRPCLB.
53
+ // The server must fill in "fallback" if it detects that the RPC reached
54
+ // the server via the "gRPCLB fallback" path, and "backend" if it detects
55
+ // that the RPC reached the server via "gRPCLB backend" path (i.e. if it got
56
+ // the address of this server from the gRPCLB server BalanceLoad RPC). Exactly
57
+ // how this detection is done is context and server dependent.
58
+ enum GrpclbRouteType {
59
+ // Server didn't detect the route that a client took to reach it.
60
+ GRPCLB_ROUTE_TYPE_UNKNOWN = 0;
61
+ // Indicates that a client reached a server via gRPCLB fallback.
62
+ GRPCLB_ROUTE_TYPE_FALLBACK = 1;
63
+ // Indicates that a client reached a server as a gRPCLB-given backend.
64
+ GRPCLB_ROUTE_TYPE_BACKEND = 2;
65
+ }
66
+
67
+ // Unary request.
68
+ message SimpleRequest {
69
+ // Desired payload type in the response from the server.
70
+ // If response_type is RANDOM, server randomly chooses one from other formats.
71
+ PayloadType response_type = 1;
72
+
73
+ // Desired payload size in the response from the server.
74
+ int32 response_size = 2;
75
+
76
+ // Optional input payload sent along with the request.
77
+ Payload payload = 3;
78
+
79
+ // Whether SimpleResponse should include username.
80
+ bool fill_username = 4;
81
+
82
+ // Whether SimpleResponse should include OAuth scope.
83
+ bool fill_oauth_scope = 5;
84
+
85
+ // Whether to request the server to compress the response. This field is
86
+ // "nullable" in order to interoperate seamlessly with clients not able to
87
+ // implement the full compression tests by introspecting the call to verify
88
+ // the response's compression status.
89
+ BoolValue response_compressed = 6;
90
+
91
+ // Whether server should return a given status
92
+ EchoStatus response_status = 7;
93
+
94
+ // Whether the server should expect this request to be compressed.
95
+ BoolValue expect_compressed = 8;
96
+
97
+ // Whether SimpleResponse should include server_id.
98
+ bool fill_server_id = 9;
99
+
100
+ // Whether SimpleResponse should include grpclb_route_type.
101
+ bool fill_grpclb_route_type = 10;
102
+
103
+ // If set the server should record this metrics report data for the current RPC.
104
+ TestOrcaReport orca_per_query_report = 11;
105
+ }
106
+
107
+ // Unary response, as configured by the request.
108
+ message SimpleResponse {
109
+ // Payload to increase message size.
110
+ Payload payload = 1;
111
+ // The user the request came from, for verifying authentication was
112
+ // successful when the client expected it.
113
+ string username = 2;
114
+ // OAuth scope.
115
+ string oauth_scope = 3;
116
+
117
+ // Server ID. This must be unique among different server instances,
118
+ // but the same across all RPC's made to a particular server instance.
119
+ string server_id = 4;
120
+ // gRPCLB Path.
121
+ GrpclbRouteType grpclb_route_type = 5;
122
+
123
+ // Server hostname.
124
+ string hostname = 6;
125
+ }
126
+
127
+ // Client-streaming request.
128
+ message StreamingInputCallRequest {
129
+ // Optional input payload sent along with the request.
130
+ Payload payload = 1;
131
+
132
+ // Whether the server should expect this request to be compressed. This field
133
+ // is "nullable" in order to interoperate seamlessly with servers not able to
134
+ // implement the full compression tests by introspecting the call to verify
135
+ // the request's compression status.
136
+ BoolValue expect_compressed = 2;
137
+
138
+ // Not expecting any payload from the response.
139
+ }
140
+
141
+ // Client-streaming response.
142
+ message StreamingInputCallResponse {
143
+ // Aggregated size of payloads received from the client.
144
+ int32 aggregated_payload_size = 1;
145
+ }
146
+
147
+ // Configuration for a particular response.
148
+ message ResponseParameters {
149
+ // Desired payload sizes in responses from the server.
150
+ int32 size = 1;
151
+
152
+ // Desired interval between consecutive responses in the response stream in
153
+ // microseconds.
154
+ int32 interval_us = 2;
155
+
156
+ // Whether to request the server to compress the response. This field is
157
+ // "nullable" in order to interoperate seamlessly with clients not able to
158
+ // implement the full compression tests by introspecting the call to verify
159
+ // the response's compression status.
160
+ BoolValue compressed = 3;
161
+
162
+ // Whether to request the server to send the requesting peer's socket
163
+ // address in the response.
164
+ BoolValue fill_peer_socket_address = 4;
165
+ }
166
+
167
+ // Server-streaming request.
168
+ message StreamingOutputCallRequest {
169
+ // Desired payload type in the response from the server.
170
+ // If response_type is RANDOM, the payload from each response in the stream
171
+ // might be of different types. This is to simulate a mixed type of payload
172
+ // stream.
173
+ PayloadType response_type = 1;
174
+
175
+ // Configuration for each expected response message.
176
+ repeated ResponseParameters response_parameters = 2;
177
+
178
+ // Optional input payload sent along with the request.
179
+ Payload payload = 3;
180
+
181
+ // Whether server should return a given status
182
+ EchoStatus response_status = 7;
183
+
184
+ // If set the server should update this metrics report data at the OOB server.
185
+ TestOrcaReport orca_oob_report = 8;
186
+ }
187
+
188
+ // Server-streaming response, as configured by the request and parameters.
189
+ message StreamingOutputCallResponse {
190
+ // Payload to increase response size.
191
+ Payload payload = 1;
192
+
193
+ // The peer's socket address if requested.
194
+ string peer_socket_address = 2;
195
+ }
196
+
197
+ // For reconnect interop test only.
198
+ // Client tells server what reconnection parameters it used.
199
+ message ReconnectParams {
200
+ int32 max_reconnect_backoff_ms = 1;
201
+ }
202
+
203
+ // For reconnect interop test only.
204
+ // Server tells client whether its reconnects are following the spec and the
205
+ // reconnect backoffs it saw.
206
+ message ReconnectInfo {
207
+ bool passed = 1;
208
+ repeated int32 backoff_ms = 2;
209
+ }
210
+
211
+ message LoadBalancerStatsRequest {
212
+ // Request stats for the next num_rpcs sent by client.
213
+ int32 num_rpcs = 1;
214
+ // If num_rpcs have not completed within timeout_sec, return partial results.
215
+ int32 timeout_sec = 2;
216
+ // Response header + trailer metadata entries we want the values of.
217
+ // Matching of the keys is case-insensitive as per rfc7540#section-8.1.2
218
+ // * (asterisk) is a special value that will return all metadata entries
219
+ repeated string metadata_keys = 3;
220
+ }
221
+
222
+ message LoadBalancerStatsResponse {
223
+ enum MetadataType {
224
+ UNKNOWN = 0;
225
+ INITIAL = 1;
226
+ TRAILING = 2;
227
+ }
228
+ message MetadataEntry {
229
+ // Key, exactly as received from the server. Case may be different from what
230
+ // was requested in the LoadBalancerStatsRequest)
231
+ string key = 1;
232
+ // Value, exactly as received from the server.
233
+ string value = 2;
234
+ // Metadata type
235
+ MetadataType type = 3;
236
+ }
237
+ message RpcMetadata {
238
+ // metadata values for each rpc for the keys specified in
239
+ // LoadBalancerStatsRequest.metadata_keys.
240
+ repeated MetadataEntry metadata = 1;
241
+ }
242
+ message MetadataByPeer {
243
+ // List of RpcMetadata in for each RPC with a given peer
244
+ repeated RpcMetadata rpc_metadata = 1;
245
+ }
246
+ message RpcsByPeer {
247
+ // The number of completed RPCs for each peer.
248
+ map<string, int32> rpcs_by_peer = 1;
249
+ }
250
+ // The number of completed RPCs for each peer.
251
+ map<string, int32> rpcs_by_peer = 1;
252
+ // The number of RPCs that failed to record a remote peer.
253
+ int32 num_failures = 2;
254
+ map<string, RpcsByPeer> rpcs_by_method = 3;
255
+ // All the metadata of all RPCs for each peer.
256
+ map<string, MetadataByPeer> metadatas_by_peer = 4;
257
+ }
258
+
259
+ // Request for retrieving a test client's accumulated stats.
260
+ message LoadBalancerAccumulatedStatsRequest {}
261
+
262
+ // Accumulated stats for RPCs sent by a test client.
263
+ message LoadBalancerAccumulatedStatsResponse {
264
+ // The total number of RPCs have ever issued for each type.
265
+ // Deprecated: use stats_per_method.rpcs_started instead.
266
+ map<string, int32> num_rpcs_started_by_method = 1 [deprecated = true];
267
+ // The total number of RPCs have ever completed successfully for each type.
268
+ // Deprecated: use stats_per_method.result instead.
269
+ map<string, int32> num_rpcs_succeeded_by_method = 2 [deprecated = true];
270
+ // The total number of RPCs have ever failed for each type.
271
+ // Deprecated: use stats_per_method.result instead.
272
+ map<string, int32> num_rpcs_failed_by_method = 3 [deprecated = true];
273
+
274
+ message MethodStats {
275
+ // The number of RPCs that were started for this method.
276
+ int32 rpcs_started = 1;
277
+
278
+ // The number of RPCs that completed with each status for this method. The
279
+ // key is the integral value of a google.rpc.Code; the value is the count.
280
+ map<int32, int32> result = 2;
281
+ }
282
+
283
+ // Per-method RPC statistics. The key is the RpcType in string form; e.g.
284
+ // 'EMPTY_CALL' or 'UNARY_CALL'
285
+ map<string, MethodStats> stats_per_method = 4;
286
+ }
287
+
288
+ // Configurations for a test client.
289
+ message ClientConfigureRequest {
290
+ // Type of RPCs to send.
291
+ enum RpcType {
292
+ EMPTY_CALL = 0;
293
+ UNARY_CALL = 1;
294
+ }
295
+
296
+ // Metadata to be attached for the given type of RPCs.
297
+ message Metadata {
298
+ RpcType type = 1;
299
+ string key = 2;
300
+ string value = 3;
301
+ }
302
+
303
+ // The types of RPCs the client sends.
304
+ repeated RpcType types = 1;
305
+ // The collection of custom metadata to be attached to RPCs sent by the client.
306
+ repeated Metadata metadata = 2;
307
+ // The deadline to use, in seconds, for all RPCs. If unset or zero, the
308
+ // client will use the default from the command-line.
309
+ int32 timeout_sec = 3;
310
+ }
311
+
312
+ // Response for updating a test client's configuration.
313
+ message ClientConfigureResponse {}
314
+
315
+ message MemorySize {
316
+ int64 rss = 1;
317
+ }
318
+
319
+ // Metrics data the server will update and send to the client. It mirrors orca load report
320
+ // https://github.com/cncf/xds/blob/eded343319d09f30032952beda9840bbd3dcf7ac/xds/data/orca/v3/orca_load_report.proto#L15,
321
+ // but avoids orca dependency. Used by both per-query and out-of-band reporting tests.
322
+ message TestOrcaReport {
323
+ double cpu_utilization = 1;
324
+ double memory_utilization = 2;
325
+ map<string, double> request_cost = 3;
326
+ map<string, double> utilization = 4;
327
+ }
328
+
329
+ // Status that will be return to callers of the Hook method
330
+ message SetReturnStatusRequest {
331
+ int32 grpc_code_to_return = 1;
332
+ string grpc_status_description = 2;
333
+ }
334
+
335
+ message HookRequest {
336
+ enum HookRequestCommand {
337
+ // Default value
338
+ UNSPECIFIED = 0;
339
+ // Start the HTTP endpoint
340
+ START = 1;
341
+ // Stop
342
+ STOP = 2;
343
+ // Return from HTTP GET/POST
344
+ RETURN = 3;
345
+ }
346
+ HookRequestCommand command = 1;
347
+ int32 grpc_code_to_return = 2;
348
+ string grpc_status_description = 3;
349
+ // Server port to listen to
350
+ int32 server_port = 4;
351
+ }
352
+
353
+ message HookResponse {
354
+ }
@@ -0,0 +1,116 @@
1
+
2
+ // Copyright 2015-2016 gRPC authors.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ // An integration test service that covers all the method signature permutations
17
+ // of unary/streaming requests/responses.
18
+
19
+ syntax = "proto3";
20
+
21
+ import "src/proto/grpc/testing/empty.proto";
22
+ import "src/proto/grpc/testing/messages.proto";
23
+
24
+ package grpc.testing;
25
+
26
+ option java_package = "io.grpc.testing.integration";
27
+
28
+ // A simple service to test the various types of RPCs and experiment with
29
+ // performance with various types of payload.
30
+ service TestService {
31
+ // One empty request followed by one empty response.
32
+ rpc EmptyCall(grpc.testing.Empty) returns (grpc.testing.Empty);
33
+
34
+ // One request followed by one response.
35
+ rpc UnaryCall(SimpleRequest) returns (SimpleResponse);
36
+
37
+ // One request followed by one response. Response has cache control
38
+ // headers set such that a caching HTTP proxy (such as GFE) can
39
+ // satisfy subsequent requests.
40
+ rpc CacheableUnaryCall(SimpleRequest) returns (SimpleResponse);
41
+
42
+ // One request followed by a sequence of responses (streamed download).
43
+ // The server returns the payload with client desired type and sizes.
44
+ rpc StreamingOutputCall(StreamingOutputCallRequest)
45
+ returns (stream StreamingOutputCallResponse);
46
+
47
+ // A sequence of requests followed by one response (streamed upload).
48
+ // The server returns the aggregated size of client payload as the result.
49
+ rpc StreamingInputCall(stream StreamingInputCallRequest)
50
+ returns (StreamingInputCallResponse);
51
+
52
+ // A sequence of requests with each request served by the server immediately.
53
+ // As one request could lead to multiple responses, this interface
54
+ // demonstrates the idea of full duplexing.
55
+ rpc FullDuplexCall(stream StreamingOutputCallRequest)
56
+ returns (stream StreamingOutputCallResponse);
57
+
58
+ // A sequence of requests followed by a sequence of responses.
59
+ // The server buffers all the client requests and then serves them in order. A
60
+ // stream of responses are returned to the client when the server starts with
61
+ // first request.
62
+ rpc HalfDuplexCall(stream StreamingOutputCallRequest)
63
+ returns (stream StreamingOutputCallResponse);
64
+
65
+ // The test server will not implement this method. It will be used
66
+ // to test the behavior when clients call unimplemented methods.
67
+ rpc UnimplementedCall(grpc.testing.Empty) returns (grpc.testing.Empty);
68
+ }
69
+
70
+ // A simple service NOT implemented at servers so clients can test for
71
+ // that case.
72
+ service UnimplementedService {
73
+ // A call that no server should implement
74
+ rpc UnimplementedCall(grpc.testing.Empty) returns (grpc.testing.Empty);
75
+ }
76
+
77
+ // A service used to control reconnect server.
78
+ service ReconnectService {
79
+ rpc Start(grpc.testing.ReconnectParams) returns (grpc.testing.Empty);
80
+ rpc Stop(grpc.testing.Empty) returns (grpc.testing.ReconnectInfo);
81
+ }
82
+
83
+ // A service used to obtain stats for verifying LB behavior.
84
+ service LoadBalancerStatsService {
85
+ // Gets the backend distribution for RPCs sent by a test client.
86
+ rpc GetClientStats(LoadBalancerStatsRequest)
87
+ returns (LoadBalancerStatsResponse) {}
88
+
89
+ // Gets the accumulated stats for RPCs sent by a test client.
90
+ rpc GetClientAccumulatedStats(LoadBalancerAccumulatedStatsRequest)
91
+ returns (LoadBalancerAccumulatedStatsResponse) {}
92
+ }
93
+
94
+ // Hook service. Used to keep Kubernetes from shutting the pod down.
95
+ service HookService {
96
+ // Sends a request that will "hang" until the return status is set by a call
97
+ // to a SetReturnStatus
98
+ rpc Hook(grpc.testing.Empty) returns (grpc.testing.Empty);
99
+ // Sets a return status for pending and upcoming calls to Hook
100
+ rpc SetReturnStatus(SetReturnStatusRequest) returns (grpc.testing.Empty);
101
+ // Clears the return status. Incoming calls to Hook will "hang"
102
+ rpc ClearReturnStatus(grpc.testing.Empty) returns (grpc.testing.Empty);
103
+ }
104
+
105
+ // A service to remotely control health status of an xDS test server.
106
+ service XdsUpdateHealthService {
107
+ rpc SetServing(grpc.testing.Empty) returns (grpc.testing.Empty);
108
+ rpc SetNotServing(grpc.testing.Empty) returns (grpc.testing.Empty);
109
+ rpc SendHookRequest(HookRequest) returns (HookResponse);
110
+ }
111
+
112
+ // A service to dynamically update the configuration of an xDS test client.
113
+ service XdsUpdateClientConfigureService {
114
+ // Update the tes client's configuration.
115
+ rpc Configure(ClientConfigureRequest) returns (ClientConfigureResponse);
116
+ }