python/ray/_private/gcs_utils.py
def check_health(address: str, timeout=2) -> bool:
    """Checks Ray cluster health, before / without actually connecting to the
    cluster via ray.init().

    Args:
        address: Ray cluster / GCS address string, e.g. ip:port.
        timeout: request timeout.
    Returns:
        Returns True if the cluster is running and has matching Ray version.
        Returns False if no service is running.
        Raises an exception otherwise.
    """
    req = gcs_service_pb2.CheckAliveRequest()
    try:
        channel = create_gcs_channel(address)
        stub = gcs_service_pb2_grpc.HeartbeatInfoGcsServiceStub(channel)
        resp = stub.CheckAlive(req, timeout=timeout)
    except grpc.RpcError:
        return False
    if resp.status.code != GcsCode.OK:
        raise RuntimeError(f"GCS running at {address} is unhealthy: {resp.status}")
    if resp.ray_version is None:
        resp.ray_version = "<= 1.12"
    if resp.ray_version != ray.__version__:
        raise RuntimeError(
            f"Ray cluster at {address} has version "
            f"{resp.ray_version}, but this process is running "
            f"Ray version {ray.__version__}."
        )
    return True
Checks Ray cluster health, before / without actually connecting to the
    cluster via ray.init().

    Args:
        address: Ray cluster / GCS address string, e.g. ip:port.
        timeout: request timeout.
    Returns:
        Returns True if the cluster is running and has matching Ray version.
        Returns False if no service is running.
        Raises an exception otherwise.
    
Checks Ray cluster health, before / without actually connecting to the
cluster via ray.init().
Checks Ray cluster health before / without actually connecting to the cluster via ray . init () .
def check_health(address: str, timeout=2) -> bool:
    req = gcs_service_pb2.CheckAliveRequest()
    try:
        channel = create_gcs_channel(address)
        stub = gcs_service_pb2_grpc.HeartbeatInfoGcsServiceStub(channel)
        resp = stub.CheckAlive(req, timeout=timeout)
    except grpc.RpcError:
        return False
    if resp.status.code != GcsCode.OK:
        raise RuntimeError(f"GCS running at {address} is unhealthy: {resp.status}")
    if resp.ray_version is None:
        resp.ray_version = "<= 1.12"
    if resp.ray_version != ray.__version__:
        raise RuntimeError(
            f"Ray cluster at {address} has version "
            f"{resp.ray_version}, but this process is running "
            f"Ray version {ray.__version__}."
        )
    return True
def check_health ( address : str , timeout = 2 ) -> bool : req = gcs_service_pb2 . CheckAliveRequest ( ) try : channel = create_gcs_channel ( address ) stub = gcs_service_pb2_grpc . HeartbeatInfoGcsServiceStub ( channel ) resp = stub . CheckAlive ( req , timeout = timeout ) except grpc . RpcError : return False if resp . status . code != GcsCode . OK : raise RuntimeError ( f"GCS running at {address} is unhealthy: {resp.status}" ) if resp . ray_version is None : resp . ray_version = "<= 1.12" if resp . ray_version != ray . __version__ : raise RuntimeError ( f"Ray cluster at {address} has version " f"{resp.ray_version}, but this process is running " f"Ray version {ray.__version__}." ) return True
Checks Ray cluster health, before / without actually connecting to the
cluster via ray.init().
Checks Ray cluster health before / without actually connecting to the cluster via ray . init () .
"""Checks Ray cluster health, before / without actually connecting to the
    cluster via ray.init().

    Args:
        address: Ray cluster / GCS address string, e.g. ip:port.
        timeout: request timeout.
    Returns:
        Returns True if the cluster is running and has matching Ray version.
        Returns False if no service is running.
        Raises an exception otherwise.
    """
Returns True if the cluster is running and has matching Ray version.
Returns False if no service is running.
Raises an exception otherwise.
Returns True if the cluster is running and has matching Ray version . Returns False if no service is running . Raises an exception otherwise .
address
str
Ray cluster / GCS address string, e.g. ip:port.
Ray cluster / GCS address string e . g . ip : port .
timeout
None