예제 #1
0
def try_create_gcs_client(
        address: Optional[str],
        redis_password: Optional[str]) -> Optional[GcsClient]:
    """
    Try to create a gcs client based on the the command line args or by
    autodetecting a running Ray cluster.
    """
    address = canonicalize_bootstrap_address(address)
    return GcsClient(address=address)
예제 #2
0
def try_create_gcs_client(
    address: Optional[str], redis_password: Optional[str]
) -> Optional[GcsClient]:
    """
    Try to create a gcs client based on the the command line args or by
    autodetecting a running Ray cluster.
    """
    address = canonicalize_bootstrap_address(address)
    if use_gcs_for_bootstrap():
        return GcsClient(address=address)
    else:
        if redis_password is None:
            redis_password = ray.ray_constants.REDIS_DEFAULT_PASSWORD
        return GcsClient.connect_to_gcs_by_redis_address(address, redis_password)
예제 #3
0
파일: internal_api.py 프로젝트: novahe/ray
def memory_summary(address=None,
                   redis_password=ray_constants.REDIS_DEFAULT_PASSWORD,
                   group_by="NODE_ADDRESS",
                   sort_by="OBJECT_SIZE",
                   units="B",
                   line_wrap=True,
                   stats_only=False,
                   num_entries=None):
    from ray.dashboard.memory_utils import memory_summary
    address = services.canonicalize_bootstrap_address(address)

    state = GlobalState()
    state._initialize_global_state(
        GcsClientOptions.from_redis_address(address, redis_password))
    if stats_only:
        return get_store_stats(state)
    return (memory_summary(state, group_by, sort_by, line_wrap, units,
                           num_entries) + get_store_stats(state))
예제 #4
0
def list_state_cli_group(ctx):
    address = services.canonicalize_bootstrap_address(None)
    gcs_client = GcsClient(address=address, nums_reconnect_retry=0)
    ray.experimental.internal_kv._initialize_internal_kv(gcs_client)
    api_server_url = ray._private.utils.internal_kv_get_with_retry(
        gcs_client,
        ray_constants.DASHBOARD_ADDRESS,
        namespace=ray_constants.KV_NAMESPACE_DASHBOARD,
        num_retries=20,
    )
    if api_server_url is None:
        raise ValueError((
            "Couldn't obtain the API server address from GCS. It is likely that "
            "the GCS server is down. Check gcs_server.[out | err] to see if it is "
            "still alive."))

    assert use_gcs_for_bootstrap()
    ctx.ensure_object(dict)
    ctx.obj["api_server_url"] = f"http://{api_server_url.decode()}"