def get_worker_node_ips(cluster_config: Union[dict, str]) -> List[str]: """Returns worker node IPs for given configuration file. Args: cluster_config (Union[str, dict]): Either the config dict of the cluster, or a path pointing to a file containing the config. Returns: List of worker node ip addresses. Raises: RuntimeError if the cluster is not found. """ return commands.get_worker_node_ips(_as_config_file(cluster_config))
def get_worker_ips(cluster_config_file, cluster_name): """Return the list of worker IPs of a Ray cluster.""" worker_ips = get_worker_node_ips(cluster_config_file, cluster_name) click.echo("\n".join(worker_ips))