diff --git a/python/orca/src/bigdl/orca/ray/raycontext.py b/python/orca/src/bigdl/orca/ray/raycontext.py index 401080634d7..ac8f4f5a4e9 100755 --- a/python/orca/src/bigdl/orca/ray/raycontext.py +++ b/python/orca/src/bigdl/orca/ray/raycontext.py @@ -24,6 +24,7 @@ import tempfile import filelock import multiprocessing +from packaging import version from zoo.ray.process import session_execute, ProcessMonitor from zoo.ray.utils import is_local @@ -527,12 +528,17 @@ def init(self, driver_cores=0): for k, v in self.extra_params.items(): kw = k.replace("-", "_") kwargs[kw] = v - self._address_info = ray.init(num_cpus=self.ray_node_cpu_cores, - _redis_password=self.redis_password, - object_store_memory=self.object_store_memory, - include_dashboard=self.include_webui, - dashboard_host="0.0.0.0", - *kwargs) + init_params = dict( + num_cpus=self.ray_node_cpu_cores, + _redis_password=self.redis_password, + object_store_memory=self.object_store_memory, + include_dashboard=self.include_webui, + dashboard_host="0.0.0.0", + ) + init_params.update(kwargs) + if version.parse(ray.__version__) >= version.parse("1.4.0"): + init_params["namespace"] = "az" + self._address_info = ray.init(**init_params) else: self.cluster_ips = self._gather_cluster_ips() from bigdl.util.common import init_executor_gateway @@ -614,6 +620,12 @@ def _start_driver(self, num_cores, redis_address): node_ip_address=node_ip, redis_address=redis_address) ray.shutdown() - return ray.init(address=redis_address, - _redis_password=self.ray_service.password, - _node_ip_address=node_ip) + init_params = dict( + address=redis_address, + namespace="az", + _redis_password=self.ray_service.password, + _node_ip_address=node_ip + ) + if version.parse(ray.__version__) >= version.parse("1.4.0"): + init_params["namespace"] = "az" + return ray.init(**init_params)