diff --git a/python/ray/autoscaler/commands.py b/python/ray/autoscaler/commands.py index a0bb077f8..3b2a0b9e5 100644 --- a/python/ray/autoscaler/commands.py +++ b/python/ray/autoscaler/commands.py @@ -137,8 +137,17 @@ def teardown_cluster(config_file, yes, workers_only, override_cluster_name, if not workers_only: try: - exec_cluster(config_file, "ray stop", "auto", False, False, False, - False, override_cluster_name, None, False) + exec_cluster( + config_file, + cmd="ray stop", + run_env="auto", + screen=False, + tmux=False, + stop=False, + start=False, + override_cluster_name=override_cluster_name, + port_forward=None, + with_output=False) except Exception: logger.exception("Ignoring error attempting a clean shutdown.") @@ -230,8 +239,16 @@ def kill_node(config_file, yes, hard, override_cluster_name): def monitor_cluster(cluster_config_file, num_lines, override_cluster_name): """Tails the autoscaler logs of a Ray cluster.""" cmd = "tail -n {} -f /tmp/ray/session_*/logs/monitor*".format(num_lines) - exec_cluster(cluster_config_file, cmd, "auto", False, False, False, False, - override_cluster_name, None) + exec_cluster( + cluster_config_file, + cmd=cmd, + run_env="auto", + screen=False, + tmux=False, + stop=False, + start=False, + override_cluster_name=override_cluster_name, + port_forward=None) def warn_about_bad_start_command(start_commands): @@ -418,11 +435,20 @@ def attach_cluster(config_file, start, use_screen, use_tmux, "--new only makes sense if passing --screen or --tmux") cmd = "$SHELL" - exec_cluster(config_file, cmd, "auto", False, False, False, start, - override_cluster_name, port_forward) + exec_cluster( + config_file, + cmd=cmd, + run_env="auto", + screen=False, + tmux=False, + stop=False, + start=start, + override_cluster_name=override_cluster_name, + port_forward=port_forward) def exec_cluster(config_file, + *, cmd=None, run_env="auto", screen=False, diff --git a/python/ray/scripts/scripts.py b/python/ray/scripts/scripts.py index 2ca66c602..68df379c3 100644 --- a/python/ray/scripts/scripts.py +++ b/python/ray/scripts/scripts.py @@ -904,11 +904,11 @@ def submit(cluster_config_file, screen, tmux, stop, start, cluster_name, cmd = " ".join(command_parts) exec_cluster( cluster_config_file, - cmd, - "docker", - screen, - tmux, - stop, + cmd=cmd, + run_env="docker", + screen=screen, + tmux=tmux, + stop=stop, start=False, override_cluster_name=cluster_name, port_forward=port_forward) @@ -958,8 +958,17 @@ def exec(cluster_config_file, cmd, run_env, screen, tmux, stop, start, cluster_name, port_forward): """Execute a command via SSH on a Ray cluster.""" port_forward = [(port, port) for port in list(port_forward)] - exec_cluster(cluster_config_file, cmd, run_env, screen, tmux, stop, start, - cluster_name, port_forward) + + exec_cluster( + cluster_config_file, + cmd=cmd, + run_env=run_env, + screen=screen, + tmux=tmux, + stop=stop, + start=start, + override_cluster_name=cluster_name, + port_forward=port_forward) @cli.command()