mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 15:40:09 +08:00
Minor improvements and fixes in Python code. (#3022)
This commit fix some small defects. 1. Remove a comment that should have been removed in #3003 2. Remove `redis_protected_mode` that is never used in `ray.init()` 3. Fix `object_id_seed` that is forgotten to be passed into `ray._init()` 4. Remove several redundant brackets.
This commit is contained in:
committed by
Robert Nishihara
parent
9948e8c11b
commit
f2dbd3096c
@@ -432,24 +432,24 @@ def stop():
|
||||
"--min-workers",
|
||||
required=False,
|
||||
type=int,
|
||||
help=("Override the configured min worker node count for the cluster."))
|
||||
help="Override the configured min worker node count for the cluster.")
|
||||
@click.option(
|
||||
"--max-workers",
|
||||
required=False,
|
||||
type=int,
|
||||
help=("Override the configured max worker node count for the cluster."))
|
||||
help="Override the configured max worker node count for the cluster.")
|
||||
@click.option(
|
||||
"--cluster-name",
|
||||
"-n",
|
||||
required=False,
|
||||
type=str,
|
||||
help=("Override the configured cluster name."))
|
||||
help="Override the configured cluster name.")
|
||||
@click.option(
|
||||
"--yes",
|
||||
"-y",
|
||||
is_flag=True,
|
||||
default=False,
|
||||
help=("Don't ask for confirmation."))
|
||||
help="Don't ask for confirmation.")
|
||||
def create_or_update(cluster_config_file, min_workers, max_workers, no_restart,
|
||||
restart_only, yes, cluster_name):
|
||||
if restart_only or no_restart:
|
||||
@@ -465,19 +465,19 @@ def create_or_update(cluster_config_file, min_workers, max_workers, no_restart,
|
||||
"--workers-only",
|
||||
is_flag=True,
|
||||
default=False,
|
||||
help=("Only destroy the workers."))
|
||||
help="Only destroy the workers.")
|
||||
@click.option(
|
||||
"--yes",
|
||||
"-y",
|
||||
is_flag=True,
|
||||
default=False,
|
||||
help=("Don't ask for confirmation."))
|
||||
help="Don't ask for confirmation.")
|
||||
@click.option(
|
||||
"--cluster-name",
|
||||
"-n",
|
||||
required=False,
|
||||
type=str,
|
||||
help=("Override the configured cluster name."))
|
||||
help="Override the configured cluster name.")
|
||||
def teardown(cluster_config_file, yes, workers_only, cluster_name):
|
||||
teardown_cluster(cluster_config_file, yes, workers_only, cluster_name)
|
||||
|
||||
@@ -488,17 +488,17 @@ def teardown(cluster_config_file, yes, workers_only, cluster_name):
|
||||
"--start",
|
||||
is_flag=True,
|
||||
default=False,
|
||||
help=("Start the cluster if needed."))
|
||||
help="Start the cluster if needed.")
|
||||
@click.option(
|
||||
"--tmux", is_flag=True, default=False, help=("Run the command in tmux."))
|
||||
"--tmux", is_flag=True, default=False, help="Run the command in tmux.")
|
||||
@click.option(
|
||||
"--cluster-name",
|
||||
"-n",
|
||||
required=False,
|
||||
type=str,
|
||||
help=("Override the configured cluster name."))
|
||||
help="Override the configured cluster name.")
|
||||
@click.option(
|
||||
"--new", "-N", is_flag=True, help=("Force creation of a new screen."))
|
||||
"--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)
|
||||
|
||||
@@ -512,7 +512,7 @@ def attach(cluster_config_file, start, tmux, cluster_name, new):
|
||||
"-n",
|
||||
required=False,
|
||||
type=str,
|
||||
help=("Override the configured cluster name."))
|
||||
help="Override the configured cluster name.")
|
||||
def rsync_down(cluster_config_file, source, target, cluster_name):
|
||||
rsync(cluster_config_file, source, target, cluster_name, down=True)
|
||||
|
||||
@@ -526,7 +526,7 @@ def rsync_down(cluster_config_file, source, target, cluster_name):
|
||||
"-n",
|
||||
required=False,
|
||||
type=str,
|
||||
help=("Override the configured cluster name."))
|
||||
help="Override the configured cluster name.")
|
||||
def rsync_up(cluster_config_file, source, target, cluster_name):
|
||||
rsync(cluster_config_file, source, target, cluster_name, down=False)
|
||||
|
||||
@@ -538,27 +538,27 @@ def rsync_up(cluster_config_file, source, target, cluster_name):
|
||||
"--stop",
|
||||
is_flag=True,
|
||||
default=False,
|
||||
help=("Stop the cluster after the command finishes running."))
|
||||
help="Stop the cluster after the command finishes running.")
|
||||
@click.option(
|
||||
"--start",
|
||||
is_flag=True,
|
||||
default=False,
|
||||
help=("Start the cluster if needed."))
|
||||
help="Start the cluster if needed.")
|
||||
@click.option(
|
||||
"--screen",
|
||||
is_flag=True,
|
||||
default=False,
|
||||
help=("Run the command in a screen."))
|
||||
help="Run the command in a screen.")
|
||||
@click.option(
|
||||
"--tmux", is_flag=True, default=False, help=("Run the command in tmux."))
|
||||
"--tmux", is_flag=True, default=False, help="Run the command in tmux.")
|
||||
@click.option(
|
||||
"--cluster-name",
|
||||
"-n",
|
||||
required=False,
|
||||
type=str,
|
||||
help=("Override the configured cluster name."))
|
||||
help="Override the configured cluster name.")
|
||||
@click.option(
|
||||
"--port-forward", required=False, type=int, help=("Port to forward."))
|
||||
"--port-forward", required=False, type=int, help="Port to forward.")
|
||||
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`."
|
||||
@@ -576,7 +576,7 @@ def exec_cmd(cluster_config_file, cmd, screen, tmux, stop, start, cluster_name,
|
||||
"-n",
|
||||
required=False,
|
||||
type=str,
|
||||
help=("Override the configured cluster name."))
|
||||
help="Override the configured cluster name.")
|
||||
def get_head_ip(cluster_config_file, cluster_name):
|
||||
click.echo(get_head_node_ip(cluster_config_file, cluster_name))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user