[core] Java worker should respect the user provided node_ip_address (#13732)

This commit is contained in:
Xianyang Liu
2021-02-08 11:59:06 +08:00
committed by GitHub
parent 7231b6b91c
commit 918ad84f08
2 changed files with 53 additions and 1 deletions
+7 -1
View File
@@ -1370,6 +1370,7 @@ def start_raylet(redis_address,
raylet_name,
redis_password,
session_dir,
node_ip_address,
)
else:
java_worker_command = []
@@ -1508,7 +1509,8 @@ def get_ray_jars_dir():
def build_java_worker_command(java_worker_options, redis_address,
node_manager_port, plasma_store_name,
raylet_name, redis_password, session_dir):
raylet_name, redis_password, session_dir,
node_ip_address):
"""This method assembles the command used to start a Java worker.
Args:
@@ -1519,6 +1521,7 @@ def build_java_worker_command(java_worker_options, redis_address,
raylet_name (str): The name of the raylet socket to create.
redis_password (str): The password of connect to redis.
session_dir (str): The path of this session.
node_ip_address (str): The ip address for this node.
Returns:
The command string for starting Java worker.
"""
@@ -1536,6 +1539,9 @@ def build_java_worker_command(java_worker_options, redis_address,
if redis_password is not None:
pairs.append(("ray.redis.password", redis_password))
if node_ip_address is not None:
pairs.append(("ray.node-ip", node_ip_address))
pairs.append(("ray.home", RAY_HOME))
pairs.append(("ray.logging.dir", os.path.join(session_dir, "logs")))
pairs.append(("ray.session-dir", session_dir))