File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1212import redis
1313from grpc import ServicerContext
1414from grpc import server as grpc_server
15+ from grpc_health .v1 import health , health_pb2 , health_pb2_grpc
1516from playwright ._impl ._api_types import TimeoutError
1617from playwright .async_api import async_playwright
1718
@@ -328,6 +329,14 @@ def main():
328329 runner .wss_secure = args .wss_secure
329330
330331 add_RunnerServicer_to_server (runner , server )
332+
333+ # Add health checking service
334+ health_servicer = health .HealthServicer ()
335+ health_pb2_grpc .add_HealthServicer_to_server (health_servicer , server )
336+
337+ # Set the health status to SERVING
338+ health_servicer .set ('' , health_pb2 .HealthCheckResponse .SERVING )
339+
331340 server .add_insecure_port (f'[::]:{ args .port } ' )
332341 server .start ()
333342
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ RUN apt-get update && apt-get install -y \
1515
1616RUN pip3 install poetry
1717
18+ # Install grpc_health_probe
19+ RUN wget -qO/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.22/grpc_health_probe-linux-amd64 && \
20+ chmod +x /grpc_health_probe
21+
1822RUN mkdir /code
1923WORKDIR /code
2024
You can’t perform that action at this time.
0 commit comments