mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 19:08:52 +08:00
[cli] Remove the deprecated old_style logging calls (#10776)
Co-authored-by: Richard Liaw <rliaw@berkeley.edu>
This commit is contained in:
@@ -465,8 +465,6 @@ def start(node_ip_address, address, port, redis_password, redis_shard_ports,
|
||||
# Get the node IP address if one is not provided.
|
||||
ray_params.update_if_absent(node_ip_address=node_ip_address)
|
||||
cli_logger.labeled_value("Local node IP", ray_params.node_ip_address)
|
||||
cli_logger.old_info(logger, "Using IP address {} for this node.",
|
||||
ray_params.node_ip_address)
|
||||
ray_params.update_if_absent(
|
||||
redis_port=port,
|
||||
redis_shard_ports=redis_shard_ports,
|
||||
@@ -525,24 +523,6 @@ def start(node_ip_address, address, port, redis_password, redis_shard_ports,
|
||||
cli_logger.newline()
|
||||
cli_logger.print("To terminate the Ray runtime, run")
|
||||
cli_logger.print(cf.bold(" ray stop"))
|
||||
|
||||
cli_logger.old_info(
|
||||
logger,
|
||||
"\nStarted Ray on this node. You can add additional nodes to "
|
||||
"the cluster by calling\n\n"
|
||||
" ray start --address='{}'{}\n\n"
|
||||
"from the node you wish to add. You can connect a driver to the "
|
||||
"cluster from Python by running\n\n"
|
||||
" import ray\n"
|
||||
" ray.init(address='auto'{})\n\n"
|
||||
"If you have trouble connecting from a different machine, check "
|
||||
"that your firewall is configured properly. If you wish to "
|
||||
"terminate the processes that have been started, run\n\n"
|
||||
" ray stop".format(
|
||||
redis_address, " --redis-password='" + redis_password + "'"
|
||||
if redis_password else "",
|
||||
", _redis_password='" + redis_password + "'"
|
||||
if redis_password else ""))
|
||||
else:
|
||||
# Start Ray on a non-head node.
|
||||
if not (port is None):
|
||||
@@ -589,8 +569,6 @@ def start(node_ip_address, address, port, redis_password, redis_shard_ports,
|
||||
node_ip_address=services.get_node_ip_address(redis_address))
|
||||
|
||||
cli_logger.labeled_value("Local node IP", ray_params.node_ip_address)
|
||||
cli_logger.old_info(logger, "Using IP address {} for this node.",
|
||||
ray_params.node_ip_address)
|
||||
|
||||
# Check that there aren't already Redis clients with the same IP
|
||||
# address connected with this Redis instance. This raises an exception
|
||||
@@ -610,11 +588,6 @@ def start(node_ip_address, address, port, redis_password, redis_shard_ports,
|
||||
cli_logger.print("To terminate the Ray runtime, run")
|
||||
cli_logger.print(cf.bold(" ray stop"))
|
||||
|
||||
cli_logger.old_info(
|
||||
logger, "\nStarted Ray on this node. If you wish to terminate the "
|
||||
"processes that have been started, run\n\n"
|
||||
" ray stop")
|
||||
|
||||
if block:
|
||||
cli_logger.newline()
|
||||
with cli_logger.group(cf.bold("--block")):
|
||||
@@ -630,8 +603,6 @@ def start(node_ip_address, address, port, redis_password, redis_shard_ports,
|
||||
if len(deceased) > 0:
|
||||
cli_logger.newline()
|
||||
cli_logger.error("Some Ray subprcesses exited unexpectedly:")
|
||||
cli_logger.old_error(logger,
|
||||
"Ray processes died unexpectedly:")
|
||||
|
||||
with cli_logger.indented():
|
||||
for process_type, process in deceased:
|
||||
@@ -639,15 +610,10 @@ def start(node_ip_address, address, port, redis_password, redis_shard_ports,
|
||||
"{}",
|
||||
cf.bold(str(process_type)),
|
||||
_tags={"exit code": str(process.returncode)})
|
||||
cli_logger.old_error(
|
||||
logger, "\t{} died with exit code {}".format(
|
||||
process_type, process.returncode))
|
||||
|
||||
# shutdown_at_exit will handle cleanup.
|
||||
cli_logger.newline()
|
||||
cli_logger.error("Remaining processes will be killed.")
|
||||
cli_logger.old_error(
|
||||
logger, "Killing remaining processes and exiting...")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
@@ -719,10 +685,6 @@ def stop(force, verbose, log_style, log_color):
|
||||
total_found += 1
|
||||
|
||||
proc_string = str(subprocess.list2cmdline(proc_args))
|
||||
if verbose:
|
||||
operation = "Terminating" if force else "Killing"
|
||||
cli_logger.old_info(logger, "%s process %s: %s", operation,
|
||||
proc.pid, proc_string)
|
||||
try:
|
||||
if force:
|
||||
proc.kill()
|
||||
@@ -749,7 +711,6 @@ def stop(force, verbose, log_style, log_color):
|
||||
except (psutil.Error, OSError) as ex:
|
||||
cli_logger.error("Could not terminate `{}` due to {}",
|
||||
cf.bold(proc_string), str(ex))
|
||||
cli_logger.old_error(logger, "Error: %s", ex)
|
||||
|
||||
if total_found == 0:
|
||||
cli_logger.print("Did not find any active Ray processes.")
|
||||
@@ -847,7 +808,6 @@ def up(cluster_config_file, min_workers, max_workers, no_restart, restart_only,
|
||||
cli_logger.warning("{}", str(e))
|
||||
cli_logger.warning(
|
||||
"Could not download remote cluster configuration file.")
|
||||
cli_logger.old_info(logger, "Error downloading file: ", e)
|
||||
create_or_update_cluster(
|
||||
config_file=cluster_config_file,
|
||||
override_min_workers=min_workers,
|
||||
@@ -1130,11 +1090,6 @@ def submit(cluster_config_file, screen, tmux, stop, start, cluster_name,
|
||||
cf.bold("-- <args ...>"),
|
||||
cf.bold("ray submit script.py -- --arg=123 --flag"))
|
||||
cli_logger.newline()
|
||||
cli_logger.old_warning(
|
||||
logger,
|
||||
"ray submit [yaml] [script.py] --args=... is deprecated and "
|
||||
"will be removed in a future version of Ray. Use "
|
||||
"`ray submit [yaml] script.py -- --arg1 --arg2` instead.")
|
||||
|
||||
if start:
|
||||
create_or_update_cluster(
|
||||
|
||||
Reference in New Issue
Block a user