Skip to content

Commit

Permalink
Be compatible to ray 1.5.0 (intel-analytics#4387)
Browse files Browse the repository at this point in the history
* compatible to ray 1.5.0

* refine
  • Loading branch information
shanyu-sys committed Jul 30, 2021
1 parent ea0fac6 commit 064baaa
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions python/orca/src/bigdl/orca/ray/raycontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

0 comments on commit 064baaa

Please sign in to comment.