Health Check#

Once an Orchestration is running, you can use jina ping CLI to run a health check of the complete Orchestration or (in the case of a Flow) individual Executors or Gateway.

Start a Deployment in Python:

from jina import Deployment

dep = Deployment(protocol='grpc', port=12345)

with dep:
    dep.block()

Check the readiness of the Deployment:

jina ping deployment grpc://localhost:12345

Start a Flow in Python:

from jina import Flow

f = Flow(protocol='grpc', port=12345).add(port=12346)

with f:
    f.block()

Check the readiness of the Flow:

jina ping flow grpc://localhost:12345

You can also check the readiness of an individual Executor:

jina ping executor localhost:12346

…or the readiness of the Gateway service:

jina ping gateway  grpc://localhost:12345

When these commands succeed, you should see something like:

INFO   JINA@28600 readiness check succeeded 1 times!!! 

Use in Kubernetes

The CLI exits with code 1 when the readiness check is not successful, which makes it a good choice to be used as readinessProbe for Executor and Gateway when deployed in Kubernetes.