mirror of
https://github.com/vale981/ray
synced 2025-03-06 18:41:40 -05:00
parent
cb56f39070
commit
cf9cd5da9d
2 changed files with 18 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue