mirror of
https://github.com/wassname/ray.git
synced 2026-08-11 11:24:51 +08:00
Let worker get worker address and object store address from scheduler (#350)
This commit is contained in:
committed by
Philipp Moritz
parent
b71f064f3e
commit
ac363bf451
+2
-2
@@ -185,8 +185,8 @@ class RayCluster(object):
|
||||
Then within a Python interpreter or script, run the following commands.
|
||||
|
||||
import ray
|
||||
ray.init(scheduler_address="{}:10001", objstore_address="{}:20001", driver_address="{}:30001")
|
||||
""".format(self.key_file, self.username, self.node_ip_addresses[0], cd_location, setup_env_path, self.node_private_ip_addresses[0], self.node_private_ip_addresses[0], self.node_private_ip_addresses[0])
|
||||
ray.init(node_ip_address="{}", scheduler_address="{}:10001")
|
||||
""".format(self.key_file, self.username, self.node_ip_addresses[0], cd_location, setup_env_path, self.node_private_ip_addresses[0], self.node_private_ip_addresses[0])
|
||||
|
||||
def stop_ray(self):
|
||||
"""Kill all of the processes in the Ray cluster.
|
||||
|
||||
@@ -6,9 +6,9 @@ import ray
|
||||
|
||||
parser = argparse.ArgumentParser(description="Parse addresses for the worker to connect to.")
|
||||
parser.add_argument("--user-source-directory", type=str, help="the directory containing the user's application code")
|
||||
parser.add_argument("--scheduler-address", default="127.0.0.1:10001", type=str, help="the scheduler's address")
|
||||
parser.add_argument("--objstore-address", default="127.0.0.1:20001", type=str, help="the objstore's address")
|
||||
parser.add_argument("--worker-address", default="127.0.0.1:40001", type=str, help="the worker's address")
|
||||
parser.add_argument("--node-ip-address", required=True, type=str, help="the ip address of the worker's node")
|
||||
parser.add_argument("--scheduler-address", required=True, type=str, help="the scheduler's address")
|
||||
parser.add_argument("--objstore-address", type=str, help="the objstore's address")
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = parser.parse_args()
|
||||
@@ -18,6 +18,6 @@ if __name__ == "__main__":
|
||||
# insert into the first position (as opposed to the zeroth) because the
|
||||
# zeroth position is reserved for the empty string.
|
||||
sys.path.insert(1, args.user_source_directory)
|
||||
ray.worker.connect(args.scheduler_address, args.objstore_address, args.worker_address)
|
||||
ray.worker.connect(args.node_ip_address, args.scheduler_address)
|
||||
|
||||
ray.worker.main_loop()
|
||||
|
||||
Reference in New Issue
Block a user