[autoscaler] Experimental support for local / on-prem clusters (#2678)

This adds some experimental (undocumented) support for launching Ray on existing nodes. You have to provide the head ip, and the list of worker ips.

There are also a couple additional utils added for rsyncing files and port-forward.
This commit is contained in:
Eric Liang
2018-08-19 12:43:04 -07:00
committed by GitHub
parent 62d0698097
commit 9473da69bd
10 changed files with 339 additions and 37 deletions
+35 -3
View File
@@ -9,7 +9,7 @@ import subprocess
import ray.services as services
from ray.autoscaler.commands import (attach_cluster, exec_cluster,
create_or_update_cluster,
create_or_update_cluster, rsync,
teardown_cluster, get_head_node_ip)
import ray.utils
@@ -445,6 +445,32 @@ def attach(cluster_config_file, start, cluster_name):
attach_cluster(cluster_config_file, start, cluster_name)
@click.command()
@click.argument("cluster_config_file", required=True, type=str)
@click.argument("source", required=True, type=str)
@click.argument("target", required=True, type=str)
@click.option(
"--cluster-name",
required=False,
type=str,
help=("Override the configured cluster name."))
def rsync_down(cluster_config_file, source, target, cluster_name):
rsync(cluster_config_file, source, target, cluster_name, down=True)
@click.command()
@click.argument("cluster_config_file", required=True, type=str)
@click.argument("source", required=True, type=str)
@click.argument("target", required=True, type=str)
@click.option(
"--cluster-name",
required=False,
type=str,
help=("Override the configured cluster name."))
def rsync_up(cluster_config_file, source, target, cluster_name):
rsync(cluster_config_file, source, target, cluster_name, down=False)
@click.command()
@click.argument("cluster_config_file", required=True, type=str)
@click.argument("cmd", required=True, type=str)
@@ -468,8 +494,12 @@ def attach(cluster_config_file, start, cluster_name):
required=False,
type=str,
help=("Override the configured cluster name."))
def exec_cmd(cluster_config_file, cmd, screen, stop, start, cluster_name):
exec_cluster(cluster_config_file, cmd, screen, stop, start, cluster_name)
@click.option(
"--port-forward", required=False, type=int, help=("Port to forward."))
def exec_cmd(cluster_config_file, cmd, screen, stop, start, cluster_name,
port_forward):
exec_cluster(cluster_config_file, cmd, screen, stop, start, cluster_name,
port_forward)
@click.command()
@@ -489,6 +519,8 @@ cli.add_command(create_or_update)
cli.add_command(create_or_update, name="up")
cli.add_command(attach)
cli.add_command(exec_cmd, name="exec")
cli.add_command(rsync_down)
cli.add_command(rsync_up)
cli.add_command(teardown)
cli.add_command(teardown, name="down")
cli.add_command(get_head_ip)