Ah, you should just be able to do:
$ ray start --head
I was referring to a mini-cluster, so I start the cluster with a code like this:
from ray.cluster_utils import Cluster
Starts a head-node for the cluster.
cluster = Cluster(
I think you can just start a mini cluster in a driver (with the while loop so that the driver won’t terminate) and use
you may need to manually start the Ray service – see some of the tests we run in
@sangcho What do you mean by ‘in a driver’? Can you please provide a short code sample?
@rliaw Confirmed to work when starting ray with a ‘subprocess’ commad, e.g.:
import subprocess subprocess.run("ray start --head --include-dashboard=false", check=True)
Ah, sorry it is not a driver, just a python script.
from ray.cluster_utils import Cluster # Pseudo code c = Cluster() c.add_node ... import time while True: # script shouldn't exit otherwise the mini cluster will crash time.sleep(1)
@sangcho Thnx, but I’ve already managed to make it work by simply running ray instance with ‘subprocess’ module.