mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 07:41:09 +08:00
[Java] Support multiple workers in Java worker process (#5505)
This commit is contained in:
@@ -76,7 +76,9 @@ cdef extern from "ray/common/ray_config.h" nogil:
|
||||
|
||||
uint64_t object_manager_default_chunk_size() const
|
||||
|
||||
int num_workers_per_process() const
|
||||
int num_workers_per_process_python() const
|
||||
|
||||
int num_workers_per_process_java() const
|
||||
|
||||
int64_t max_task_lease_timeout_ms() const
|
||||
|
||||
|
||||
@@ -142,8 +142,12 @@ cdef class Config:
|
||||
return RayConfig.instance().object_manager_default_chunk_size()
|
||||
|
||||
@staticmethod
|
||||
def num_workers_per_process():
|
||||
return RayConfig.instance().num_workers_per_process()
|
||||
def num_workers_per_process_python():
|
||||
return RayConfig.instance().num_workers_per_process_python()
|
||||
|
||||
@staticmethod
|
||||
def num_workers_per_process_java():
|
||||
return RayConfig.instance().num_workers_per_process_java()
|
||||
|
||||
@staticmethod
|
||||
def max_task_lease_timeout_ms():
|
||||
|
||||
@@ -1181,12 +1181,15 @@ def build_java_worker_command(
|
||||
command += "-Dray.home={} ".format(RAY_HOME)
|
||||
command += "-Dray.log-dir={} ".format(os.path.join(session_dir, "logs"))
|
||||
|
||||
command += ("-Dray.raylet.config.num_workers_per_process_java=" +
|
||||
"RAY_WORKER_NUM_WORKERS_PLACEHOLDER ")
|
||||
|
||||
if java_worker_options:
|
||||
# Put `java_worker_options` in the last, so it can overwrite the
|
||||
# above options.
|
||||
command += java_worker_options + " "
|
||||
|
||||
command += "RAY_WORKER_OPTION_0 "
|
||||
command += "RAY_WORKER_DYNAMIC_OPTION_PLACEHOLDER_0 "
|
||||
command += "org.ray.runtime.runner.worker.DefaultWorker"
|
||||
|
||||
return command
|
||||
|
||||
Reference in New Issue
Block a user