MCPcopy
hub / github.com/ray-project/ray / client

Function client

python/ray/client_builder.py:363–391  ·  view source on GitHub ↗

Creates a ClientBuilder based on the provided address. The address can be of the following forms: * None: Connects to or creates a local cluster and connects to it. * ``"local"``: Creates a new cluster locally and connects to it. * ``"IP:Port"``: Connects to a Ray C

(
    address: Optional[str] = None, _deprecation_warn_enabled: bool = True
)

Source from the content-addressed store, hash-verified

361
362@Deprecated
363def client(
364 address: Optional[str] = None, _deprecation_warn_enabled: bool = True
365) -> ClientBuilder:
366 """
367 Creates a ClientBuilder based on the provided address. The address can be
368 of the following forms:
369
370 * None: Connects to or creates a local cluster and connects to it.
371 * ``"local"``: Creates a new cluster locally and connects to it.
372 * ``"IP:Port"``: Connects to a Ray Client Server at the given address.
373 * ``"module://inner_address"``: load module.ClientBuilder & pass
374 inner_address
375
376 The _deprecation_warn_enabled flag enables deprecation warnings, and is
377 for internal use only. Set it to False to suppress client deprecation
378 warnings.
379 """
380 env_address = os.environ.get(RAY_ADDRESS_ENVIRONMENT_VARIABLE)
381 if env_address and address is None:
382 logger.debug(
383 f"Using address ({env_address}) instead of auto-detection "
384 f"because {RAY_ADDRESS_ENVIRONMENT_VARIABLE} is set."
385 )
386 address = env_address
387
388 builder = _get_builder_from_address(address)
389 # Disable client deprecation warn when ray.client is used internally
390 builder._deprecation_warn_enabled = _deprecation_warn_enabled
391 return builder

Callers

nothing calls this directly

Calls 3

getMethod · 0.65
debugMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…