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

Function _get_builder_from_address

python/ray/client_builder.py:340–359  ·  view source on GitHub ↗
(address: Optional[str])

Source from the content-addressed store, hash-verified

338
339
340def _get_builder_from_address(address: Optional[str]) -> ClientBuilder:
341 if address == "local":
342 return _LocalClientBuilder("local")
343 if address is None:
344 # NOTE: This is not placed in `Node::get_temp_dir_path`, because
345 # this file is accessed before the `Node` object is created.
346 address = ray._private.services.canonicalize_bootstrap_address(address)
347 return _LocalClientBuilder(address)
348 module_string, inner_address = _split_address(address)
349 try:
350 module = importlib.import_module(module_string)
351 except Exception as e:
352 raise RuntimeError(
353 f"Module: {module_string} does not exist.\n"
354 f"This module was parsed from Address: {address}"
355 ) from e
356 assert "ClientBuilder" in dir(
357 module
358 ), f"Module: {module_string} does not have ClientBuilder."
359 return module.ClientBuilder(inner_address)
360
361
362@Deprecated

Callers 1

clientFunction · 0.85

Calls 2

_LocalClientBuilderClass · 0.85
_split_addressFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…