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

Conversation

jssmith
Copy link
Contributor

@jssmith jssmith commented Jan 30, 2017

When scripting Ray startup we want to specify the port on which Redis will be started. This change introduced the --redis-port option to the Ray startup script.

Copy link
Collaborator

@robertnishihara robertnishihara left a comment

Choose a reason for hiding this comment

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

Nice, this looks good :)

Want to also update the cluster usage instructions to reflect this? (maybe tell people both ways of doing it or something)

@@ -69,6 +78,8 @@ 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:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use if args.redis_port is not None for consistency?

@@ -69,6 +78,8 @@ 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:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use if args.redis_port is not None for consistency?

@@ -200,10 +200,14 @@ def start_redis(node_ip_address, num_retries=20, cleanup=True, redirect_output=F
assert os.path.isfile(redis_filepath)
assert os.path.isfile(redis_module)
counter = 0
if port:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use if port is not None for consistency?

@@ -519,7 +537,7 @@ def start_ray_node(node_ip_address,
cleanup=cleanup,
redirect_output=redirect_output)

def start_ray_local(address_info=None,
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

@@ -519,7 +537,7 @@ def start_ray_node(node_ip_address,
cleanup=cleanup,
redirect_output=redirect_output)

def start_ray_local(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.

This is also used when starting Ray on a single machine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have updated worker.py

@@ -370,7 +375,8 @@ def start_ray_processes(address_info=None,
worker_path=None,
cleanup=True,
redirect_output=False,
include_global_scheduler=False):
include_global_scheduler=False,
include_redis=False):
Copy link
Collaborator

Choose a reason for hiding this comment

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

document this argument

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have added this.

@@ -178,7 +178,7 @@ def wait_for_redis_to_start(redis_host, redis_port, num_retries=5):
if counter == num_retries:
raise Exception("Unable to connect to Redis. If the Redis instance is on a different machine, check that your firewall is configured properly.")

def start_redis(node_ip_address, num_retries=20, cleanup=True, redirect_output=False):
def start_redis(node_ip_address, port=None, num_retries=20, cleanup=True, redirect_output=False):
Copy link
Contributor

Choose a reason for hiding this comment

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

for completeness, lets add documentation for "port"

address_info["redis_address"] = redis_address
time.sleep(0.1)
else:
redis_host, redis_port = redis_address.split(":")
Copy link
Contributor

Choose a reason for hiding this comment

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

the current terminology is
blah_ip_address -> ip_address of blah without port,
blah_port -> port of blah
blah_address -> ip address and port of blah

I like blah_host better instead of blah_ip_address, but we should make it the same everywhere

redirect_output=True)

if args.redis_port is not None:
address_info_in = {"redis_address": "{}:{}".format(node_ip_address,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to call it address_info instead of address_info_in. I'm aware the name is also used below but it is not a problem, as it is explicitly updated like so:
address_info = function(address_info)

@robertnishihara robertnishihara merged commit 6ad2b5d into ray-project:master Jan 31, 2017
@robertnishihara robertnishihara deleted the redisport branch January 31, 2017 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants