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

Fix Java worker log dir #4781

Merged
merged 1 commit into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions python/ray/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ def start_raylet(self, use_valgrind=False, use_profiler=False):
self._plasma_store_socket_name,
self._ray_params.worker_path,
self._temp_dir,
self._session_dir,
self._ray_params.num_cpus,
self._ray_params.num_gpus,
self._ray_params.resources,
Expand Down
11 changes: 6 additions & 5 deletions python/ray/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,7 @@ def start_raylet(redis_address,
plasma_store_name,
worker_path,
temp_dir,
session_dir,
num_cpus=None,
num_gpus=None,
resources=None,
Expand All @@ -1088,6 +1089,7 @@ def start_raylet(redis_address,
worker_path (str): The path of the Python file that new worker
processes will execute.
temp_dir (str): The path of the temporary directory Ray will use.
session_dir (str): The path of this session.
num_cpus: The CPUs allocated for this raylet.
num_gpus: The GPUs allocated for this raylet.
resources: The custom resources allocated for this raylet.
Expand Down Expand Up @@ -1145,7 +1147,7 @@ def start_raylet(redis_address,
plasma_store_name,
raylet_name,
redis_password,
os.path.join(temp_dir, "sockets"),
session_dir,
)
else:
java_worker_command = ""
Expand Down Expand Up @@ -1212,7 +1214,7 @@ def build_java_worker_command(
plasma_store_name,
raylet_name,
redis_password,
temp_dir,
session_dir,
):
"""This method assembles the command used to start a Java worker.

Expand All @@ -1223,7 +1225,7 @@ def build_java_worker_command(
to.
raylet_name (str): The name of the raylet socket to create.
redis_password (str): The password of connect to redis.
temp_dir (str): The path of the temporary directory Ray will use.
session_dir (str): The path of this session.
Returns:
The command string for starting Java worker.
"""
Expand All @@ -1244,8 +1246,7 @@ def build_java_worker_command(
command += "-Dray.redis.password={} ".format(redis_password)

command += "-Dray.home={} ".format(RAY_HOME)
# TODO(suquark): We should use temp_dir as the input of a java worker.
command += "-Dray.log-dir={} ".format(os.path.join(temp_dir, "sockets"))
command += "-Dray.log-dir={} ".format(os.path.join(session_dir, "logs"))

if java_worker_options:
# Put `java_worker_options` in the last, so it can overwrite the
Expand Down