Run the server process of the Ray client. Args: address: The address of the cluster. ray_client_server_ip: Host IP the Ray client server listens on. ray_client_server_port: Port the Ray client server listens on. stdout_file: A file handle opened for writing to re
(
address: str,
ray_client_server_ip: str,
ray_client_server_port: int,
stdout_file: Optional[int] = None,
stderr_file: Optional[int] = None,
redis_username: Optional[str] = None,
redis_password: Optional[str] = None,
fate_share: Optional[bool] = None,
runtime_env_agent_address: Optional[str] = None,
node_id: Optional[str] = None,
server_type: str = "proxy",
serialized_runtime_env_context: Optional[str] = None,
)
| 2419 | |
| 2420 | |
| 2421 | def start_ray_client_server( |
| 2422 | address: str, |
| 2423 | ray_client_server_ip: str, |
| 2424 | ray_client_server_port: int, |
| 2425 | stdout_file: Optional[int] = None, |
| 2426 | stderr_file: Optional[int] = None, |
| 2427 | redis_username: Optional[str] = None, |
| 2428 | redis_password: Optional[str] = None, |
| 2429 | fate_share: Optional[bool] = None, |
| 2430 | runtime_env_agent_address: Optional[str] = None, |
| 2431 | node_id: Optional[str] = None, |
| 2432 | server_type: str = "proxy", |
| 2433 | serialized_runtime_env_context: Optional[str] = None, |
| 2434 | ): |
| 2435 | """Run the server process of the Ray client. |
| 2436 | |
| 2437 | Args: |
| 2438 | address: The address of the cluster. |
| 2439 | ray_client_server_ip: Host IP the Ray client server listens on. |
| 2440 | ray_client_server_port: Port the Ray client server listens on. |
| 2441 | stdout_file: A file handle opened for writing to redirect stdout to. If |
| 2442 | no redirection should happen, then this should be None. |
| 2443 | stderr_file: A file handle opened for writing to redirect stderr to. If |
| 2444 | no redirection should happen, then this should be None. |
| 2445 | redis_username: The username of the Redis server. |
| 2446 | redis_password: The password of the Redis server. |
| 2447 | fate_share: If True, the client server is bound to the parent's job on |
| 2448 | Windows so it terminates with the parent. |
| 2449 | runtime_env_agent_address: Address to the Runtime Env Agent listens on via HTTP. |
| 2450 | Only needed when server_type == "proxy". |
| 2451 | node_id: The hex ID of this node. |
| 2452 | server_type: Whether to start the proxy version of Ray Client. |
| 2453 | serialized_runtime_env_context: If specified, the serialized |
| 2454 | runtime_env_context to start the client server in. |
| 2455 | |
| 2456 | Returns: |
| 2457 | ProcessInfo for the process that was started. |
| 2458 | """ |
| 2459 | root_ray_dir = Path(__file__).resolve().parents[1] |
| 2460 | setup_worker_path = os.path.join( |
| 2461 | root_ray_dir, "_private", "workers", ray_constants.SETUP_WORKER_FILENAME |
| 2462 | ) |
| 2463 | |
| 2464 | ray_client_server_host = ray_client_server_ip |
| 2465 | command = [ |
| 2466 | sys.executable, |
| 2467 | setup_worker_path, |
| 2468 | "-m", |
| 2469 | "ray.util.client.server", |
| 2470 | f"--address={address}", |
| 2471 | f"--host={ray_client_server_host}", |
| 2472 | f"--port={ray_client_server_port}", |
| 2473 | f"--mode={server_type}", |
| 2474 | f"--language={Language.Name(Language.PYTHON)}", |
| 2475 | ] |
| 2476 | if redis_username: |
| 2477 | command.append(f"--redis-username={redis_username}") |
| 2478 | env_updates = {} |
no test coverage detected
searching dependent graphs…