Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Redis port option to startup script #232

Merged
merged 6 commits into from
Jan 31, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
jssmith committed Jan 31, 2017
commit 519ddd6709aa3eb2481fdef154a2c1b85438d970
16 changes: 9 additions & 7 deletions python/ray/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def start_redis(node_ip_address, port=None, num_retries=20, cleanup=True, redire
assert os.path.isfile(redis_filepath)
assert os.path.isfile(redis_module)
counter = 0
if port:
if port is not None:
if num_retries != 1:
raise Exception("Num retries must be 1 if port is specified")
else:
Expand Down Expand Up @@ -399,6 +399,8 @@ def start_ray_processes(address_info=None,
/dev/null.
include_global_scheduler (bool): If include_global_scheduler is True, then
start a global scheduler process.
include_redis (bool): If include_redis is True, then start a Redis
server process.

Returns:
A dictionary of the address information for the processes that were
Expand Down Expand Up @@ -538,12 +540,12 @@ def start_ray_node(node_ip_address,
redirect_output=redirect_output)

def start_ray_head(address_info=None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the indentation in the lines below needs to be fixed

node_ip_address="127.0.0.1",
num_workers=0,
num_local_schedulers=1,
worker_path=None,
cleanup=True,
redirect_output=False):
node_ip_address="127.0.0.1",
num_workers=0,
num_local_schedulers=1,
worker_path=None,
cleanup=True,
redirect_output=False):
"""Start Ray in local mode.

Args:
Expand Down
8 changes: 4 additions & 4 deletions python/ray/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,10 +781,10 @@ def _init(address_info=None, start_ray_local=False, object_id_seed=None,
num_local_schedulers = 1
# Start the scheduler, object store, and some workers. These will be killed
# by the call to cleanup(), which happens when the Python script exits.
address_info = services.start_ray_local(address_info=address_info,
node_ip_address=node_ip_address,
num_workers=num_workers,
num_local_schedulers=num_local_schedulers)
address_info = services.start_ray_head(address_info=address_info,
node_ip_address=node_ip_address,
num_workers=num_workers,
num_local_schedulers=num_local_schedulers)
else:
if redis_address is None:
raise Exception("If start_ray_local=False, then redis_address must be provided.")
Expand Down
10 changes: 5 additions & 5 deletions scripts/start_ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def check_no_existing_redis_clients(node_ip_address, redis_address):
address_info_in = None

address_info = services.start_ray_head(address_info=address_info_in,
node_ip_address=node_ip_address,
num_workers=args.num_workers,
cleanup=False,
redirect_output=True)
node_ip_address=node_ip_address,
num_workers=args.num_workers,
cleanup=False,
redirect_output=True)
print(address_info)
print("\nStarted Ray with {} workers on this node. A different number of "
"workers can be set with the --num-workers flag (but you have to "
Expand All @@ -78,7 +78,7 @@ def check_no_existing_redis_clients(node_ip_address, redis_address):
address_info["redis_address"]))
else:
# Start Ray on a non-head node.
if args.redis_port:
if args.redis_port is not None:
raise Exception("If --head is not passed in, --redis-port is not allowed")
if args.redis_address is None:
raise Exception("If --head is not passed in, --redis-address must be provided.")
Expand Down