Skip to content

Commit

Permalink
Add ray rdd (intel-analytics#2996)
Browse files Browse the repository at this point in the history
* add ray rdd

* fix style

* add more tests
  • Loading branch information
yangw1234 committed Oct 28, 2020
1 parent 2dae44a commit a20a495
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/orca/src/bigdl/orca/ray/raycontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ def init(self, driver_cores=0):
os.environ.update(self.env)
import ray
self._address_info = ray.init(num_cpus=self.ray_node_cpu_cores,
redis_password=self.redis_password,
object_store_memory=self.object_store_memory,
resources=self.extra_params)
else:
Expand All @@ -479,6 +480,10 @@ def address_info(self):
else:
raise Exception("The Ray cluster has not been launched yet. Please call init first")

@property
def redis_address(self):
return self.address_info["redis_address"]

def _start_cluster(self):
print("Start to launch ray on cluster")
ray_rdd = self.sc.range(0, self.num_ray_nodes,
Expand All @@ -489,7 +494,6 @@ def _start_cluster(self):

self.ray_processesMonitor = ProcessMonitor(process_infos, self.sc, ray_rdd, self,
verbose=self.verbose)
self.redis_address = self.ray_processesMonitor.master.master_addr
return self

def _start_restricted_worker(self, num_cores, node_ip_address):
Expand Down

0 comments on commit a20a495

Please sign in to comment.