mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 14:12:00 +08:00
Enable including Java worker for ray start command (#3838)
This commit is contained in:
+14
-3
@@ -70,6 +70,9 @@ class RayParams(object):
|
||||
monitor the log files for all processes on this node and push their
|
||||
contents to Redis.
|
||||
autoscaling_config: path to autoscaling config file.
|
||||
include_java (bool): If True, the raylet backend can also support
|
||||
Java worker.
|
||||
java_worker_options (str): The command options for Java worker.
|
||||
_internal_config (str): JSON configuration for overriding
|
||||
RayConfig defaults. For testing purposes ONLY.
|
||||
"""
|
||||
@@ -106,6 +109,8 @@ class RayParams(object):
|
||||
temp_dir=None,
|
||||
include_log_monitor=None,
|
||||
autoscaling_config=None,
|
||||
include_java=False,
|
||||
java_worker_options=None,
|
||||
_internal_config=None):
|
||||
self.object_id_seed = object_id_seed
|
||||
self.redis_address = redis_address
|
||||
@@ -136,6 +141,8 @@ class RayParams(object):
|
||||
self.temp_dir = temp_dir
|
||||
self.include_log_monitor = include_log_monitor
|
||||
self.autoscaling_config = autoscaling_config
|
||||
self.include_java = include_java
|
||||
self.java_worker_options = java_worker_options
|
||||
self._internal_config = _internal_config
|
||||
self._check_usage()
|
||||
|
||||
@@ -146,7 +153,7 @@ class RayParams(object):
|
||||
kwargs: The keyword arguments to set corresponding fields.
|
||||
"""
|
||||
for arg in kwargs:
|
||||
if (hasattr(self, arg)):
|
||||
if hasattr(self, arg):
|
||||
setattr(self, arg, kwargs[arg])
|
||||
else:
|
||||
raise ValueError("Invalid RayParams parameter in"
|
||||
@@ -161,7 +168,7 @@ class RayParams(object):
|
||||
kwargs: The keyword arguments to set corresponding fields.
|
||||
"""
|
||||
for arg in kwargs:
|
||||
if (hasattr(self, arg)):
|
||||
if hasattr(self, arg):
|
||||
if getattr(self, arg) is None:
|
||||
setattr(self, arg, kwargs[arg])
|
||||
else:
|
||||
@@ -180,6 +187,10 @@ class RayParams(object):
|
||||
"num_gpus instead.")
|
||||
|
||||
if self.num_workers is not None:
|
||||
raise Exception(
|
||||
raise ValueError(
|
||||
"The 'num_workers' argument is deprecated. Please use "
|
||||
"'num_cpus' instead.")
|
||||
|
||||
if self.include_java is None and self.java_worker_options is not None:
|
||||
raise ValueError("Should not specify `java-worker-options` "
|
||||
"without providing `include-java`.")
|
||||
|
||||
Reference in New Issue
Block a user