[cli] enable log-new-style by default (#10213)

This commit is contained in:
Richard Liaw
2020-08-21 15:21:43 -07:00
committed by GitHub
parent 136c8ff19e
commit f87669372d
2 changed files with 20 additions and 12 deletions
+2 -2
View File
@@ -103,11 +103,11 @@ def create_or_update_cluster(config_file: str,
yes: bool,
override_cluster_name: Optional[str],
no_config_cache: bool,
dump_command_output: bool = True,
redirect_command_output: bool = False,
use_login_shells: bool = True) -> None:
"""Create or updates an autoscaling Ray cluster from a config json."""
set_using_login_shells(use_login_shells)
cmd_output_util.set_output_redirected(not dump_command_output)
cmd_output_util.set_output_redirected(redirect_command_output)
if use_login_shells:
cli_logger.warning(
+18 -10
View File
@@ -57,9 +57,10 @@ logging_options = [
click.option(
"--log-new-style/--log-old-style",
is_flag=True,
default=False,
default=True,
envvar="RAY_LOG_NEWSTYLE",
help=("Whether to use the old or the new CLI UX. "
"You can also toggle this via the env var RAY_LOG_NEWSTYLE. "
"The new UX supports colored, formatted output and was "
"designed to display only the most important information for "
"human users. The old UX uses the standard `logging` module. "
@@ -915,11 +916,11 @@ def stop(force, verbose, log_new_style, log_color):
default=False,
help="Disable the local cluster config cache.")
@click.option(
"--dump-command-output",
"--redirect-command-output",
is_flag=True,
default=False,
help=("Print command output straight to "
"the terminal instead of redirecting to a file."))
help=("Redirect command output to a file instead "
"of straight to the terminal."))
@click.option(
"--use-login-shells/--use-normal-shells",
is_flag=True,
@@ -929,7 +930,7 @@ def stop(force, verbose, log_new_style, log_color):
"this can be disabled for a better user experience."))
@add_click_options(logging_options)
def up(cluster_config_file, min_workers, max_workers, no_restart, restart_only,
yes, cluster_name, no_config_cache, dump_command_output,
yes, cluster_name, no_config_cache, redirect_command_output,
use_login_shells, log_new_style, log_color, verbose):
"""Create or update a Ray cluster."""
cli_logger.old_style = not log_new_style
@@ -956,10 +957,17 @@ def up(cluster_config_file, min_workers, max_workers, no_restart, restart_only,
cli_logger.warning(
"Could not download remote cluster configuration file.")
cli_logger.old_info(logger, "Error downloading file: ", e)
create_or_update_cluster(cluster_config_file, min_workers, max_workers,
no_restart, restart_only, yes, cluster_name,
no_config_cache, dump_command_output,
use_login_shells)
create_or_update_cluster(
config_file=cluster_config_file,
override_min_workers=min_workers,
override_max_workers=max_workers,
no_restart=no_restart,
restart_only=restart_only,
yes=yes,
override_cluster_name=cluster_name,
no_config_cache=no_config_cache,
redirect_command_output=redirect_command_output,
use_login_shells=use_login_shells)
@cli.command()
@@ -1236,7 +1244,7 @@ def submit(cluster_config_file, screen, tmux, stop, start, cluster_name,
yes=True,
override_cluster_name=cluster_name,
no_config_cache=False,
dump_command_output=True,
redirect_command_output=False,
use_login_shells=True)
target = os.path.basename(script)
target = os.path.join("~", target)