Skip to content

Commit a55b41b

Browse files
authored
[VISUALIZER] Extract health proto into shared directory (blockscout#893)
* Update integration tests to use launcher 'init_server' for server initialization * Add integration test for health endpoint * Extract health proto definition into shared directory * Add proto into docker build contexts
1 parent 9e34393 commit a55b41b

File tree

17 files changed

+880
-176
lines changed

17 files changed

+880
-176
lines changed

.github/workflows/visualizer.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ jobs:
146146
with:
147147
context: "visualizer"
148148
file: "visualizer/Dockerfile"
149+
build-contexts: |
150+
proto=proto
149151
push: ${{ steps.tags_extractor.outputs.tags != '' }}
150152
tags: ${{ steps.tags_extractor.outputs.tags }}
151153
# platforms: |

proto/health/v1/health.proto

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Copyright 2015 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+
15+
// The canonical version of this proto can be found at
16+
// https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto
17+
18+
syntax = "proto3";
19+
20+
package grpc.health.v1;
21+
22+
option csharp_namespace = "Grpc.Health.V1";
23+
option go_package = "google.golang.org/grpc/health/grpc_health_v1";
24+
option java_multiple_files = true;
25+
option java_outer_classname = "HealthProto";
26+
option java_package = "io.grpc.health.v1";
27+
28+
message HealthCheckRequest {
29+
string service = 1;
30+
}
31+
32+
message HealthCheckResponse {
33+
enum ServingStatus {
34+
UNKNOWN = 0;
35+
SERVING = 1;
36+
NOT_SERVING = 2;
37+
SERVICE_UNKNOWN = 3; // Used only by the Watch method.
38+
}
39+
ServingStatus status = 1;
40+
}
41+
42+
// Health is gRPC's mechanism for checking whether a server is able to handle
43+
// RPCs. Its semantics are documented in
44+
// https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
45+
service Health {
46+
// Check gets the health of the specified service. If the requested service
47+
// is unknown, the call will fail with status NOT_FOUND. If the caller does
48+
// not specify a service name, the server should respond with its overall
49+
// health status.
50+
//
51+
// Clients should set a deadline when calling Check, and can declare the
52+
// server unhealthy if they do not receive a timely response.
53+
//
54+
// Check implementations should be idempotent and side effect free.
55+
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
56+
57+
// Performs a watch for the serving status of the requested service.
58+
// The server will immediately send back a message indicating the current
59+
// serving status. It will then subsequently send a new message whenever
60+
// the service's serving status changes.
61+
//
62+
// If the requested service is unknown when the call is received, the
63+
// server will send a message setting the serving status to
64+
// SERVICE_UNKNOWN but will *not* terminate the call. If at some
65+
// future point, the serving status of the service becomes known, the
66+
// server will send a new message with the service's serving status.
67+
//
68+
// If the call terminates with status UNIMPLEMENTED, then clients
69+
// should assume this method is not supported and should not retry the
70+
// call. If the call terminates with any other status (including OK),
71+
// clients should retry the call with appropriate exponential backoff.
72+
// rpc Watch(HealthCheckRequest) returns (stream HealthCheckResponse);
73+
}

0 commit comments

Comments
 (0)