mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 13:02:16 +08:00
Tweak/exec attach info (#3447)
* Add custom cluster name to exec info * Update submit info to match exec info
This commit is contained in:
committed by
Eric Liang
parent
d8205976e8
commit
be6567e6fd
@@ -591,9 +591,21 @@ def submit(cluster_config_file, screen, tmux, stop, start, cluster_name,
|
||||
cmd = " ".join(["python", target] + list(script_args))
|
||||
exec_cluster(cluster_config_file, cmd, screen, tmux, stop, False,
|
||||
cluster_name, port_forward)
|
||||
if tmux:
|
||||
logger.info("Use `ray attach {} --tmux` "
|
||||
"to check on command status.".format(cluster_config_file))
|
||||
|
||||
if tmux or screen:
|
||||
attach_command_parts = ["ray attach", cluster_config_file]
|
||||
if cluster_name is not None:
|
||||
attach_command_parts.append(
|
||||
"--cluster-name={}".format(cluster_name))
|
||||
if tmux:
|
||||
attach_command_parts.append("--tmux")
|
||||
elif screen:
|
||||
attach_command_parts.append("--screen")
|
||||
|
||||
attach_command = " ".join(attach_command_parts)
|
||||
attach_info = "Use `{}` to check on command status.".format(
|
||||
attach_command)
|
||||
logger.info(attach_info)
|
||||
|
||||
|
||||
@cli.command()
|
||||
@@ -627,11 +639,24 @@ def submit(cluster_config_file, screen, tmux, stop, start, cluster_name,
|
||||
def exec_cmd(cluster_config_file, cmd, screen, tmux, stop, start, cluster_name,
|
||||
port_forward):
|
||||
assert not (screen and tmux), "Can specify only one of `screen` or `tmux`."
|
||||
|
||||
exec_cluster(cluster_config_file, cmd, screen, tmux, stop, start,
|
||||
cluster_name, port_forward)
|
||||
if tmux:
|
||||
logger.info("Use `ray attach {} --tmux` "
|
||||
"to check on command status.".format(cluster_config_file))
|
||||
|
||||
if tmux or screen:
|
||||
attach_command_parts = ["ray attach", cluster_config_file]
|
||||
if cluster_name is not None:
|
||||
attach_command_parts.append(
|
||||
"--cluster-name={}".format(cluster_name))
|
||||
if tmux:
|
||||
attach_command_parts.append("--tmux")
|
||||
elif screen:
|
||||
attach_command_parts.append("--screen")
|
||||
|
||||
attach_command = " ".join(attach_command_parts)
|
||||
attach_info = "Use `{}` to check on command status.".format(
|
||||
attach_command)
|
||||
logger.info(attach_info)
|
||||
|
||||
|
||||
@cli.command()
|
||||
|
||||
Reference in New Issue
Block a user