mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 20:06:31 +08:00
@@ -210,7 +210,7 @@ def get_or_create_head_node(config, config_file, no_restart, restart_only, yes,
|
||||
provider.external_ip(head_node)))
|
||||
|
||||
|
||||
def attach_cluster(config_file, start, use_tmux, override_cluster_name):
|
||||
def attach_cluster(config_file, start, use_tmux, override_cluster_name, new):
|
||||
"""Attaches to a screen for the specified cluster.
|
||||
|
||||
Arguments:
|
||||
@@ -218,8 +218,20 @@ def attach_cluster(config_file, start, use_tmux, override_cluster_name):
|
||||
start: whether to start the cluster if it isn't up
|
||||
use_tmux: whether to use tmux as multiplexer
|
||||
override_cluster_name: set the name of the cluster
|
||||
new: whether to force a new screen
|
||||
"""
|
||||
cmd = "tmux attach || tmux new" if use_tmux else "screen -L -xRR"
|
||||
|
||||
if use_tmux:
|
||||
if new:
|
||||
cmd = "tmux new"
|
||||
else:
|
||||
cmd = "tmux attach || tmux new"
|
||||
else:
|
||||
if new:
|
||||
cmd = "screen -L"
|
||||
else:
|
||||
cmd = "screen -L -xRR"
|
||||
|
||||
exec_cluster(config_file, cmd, False, False, False, start,
|
||||
override_cluster_name, None)
|
||||
|
||||
|
||||
@@ -478,8 +478,10 @@ def teardown(cluster_config_file, yes, workers_only, cluster_name):
|
||||
required=False,
|
||||
type=str,
|
||||
help=("Override the configured cluster name."))
|
||||
def attach(cluster_config_file, start, tmux, cluster_name):
|
||||
attach_cluster(cluster_config_file, start, tmux, cluster_name)
|
||||
@click.option(
|
||||
"--new", "-N", is_flag=True, help=("Force creation of a new screen."))
|
||||
def attach(cluster_config_file, start, tmux, cluster_name, new):
|
||||
attach_cluster(cluster_config_file, start, tmux, cluster_name, new)
|
||||
|
||||
|
||||
@cli.command()
|
||||
|
||||
Reference in New Issue
Block a user