shy-evening-51366
10/18/2024, 11:29 AM@task(task_config=RayJobConfig(worker_node_config=[WorkerNodeConfig(…)]))
). I can see the cluster starting, the job getting scheduled and distributed, and completing successfully.
I’m having trouble with using an existing RayCluster (in the same cluster) though. What is the correct approach for that?
From the docs here I read that I should be able to use @task(task_config=RayJobConfig(address="<RAY_CLUSTER_ADDRESS>"))
.
However when trying that it seems worker_node_config
is a required argument. I tried using an empty list instead:
@task(
container_image=...,
task_config=RayJobConfig(
worker_node_config=[], # No need to create a Ray cluster but argument is required, maybe just setting to empty list helps?
address="<http://kuberay-cluster-head-svc.kuberay.svc.cluster.local:8265>",
runtime_env=...
),
)
But then it still tries to start a new RayCluster instead of using the existing one found at `address`:
❯ k get rayclusters.ray.io -A
NAMESPACE NAME DESIRED WORKERS AVAILABLE WORKERS CPUS MEMORY GPUS STATUS AGE
<flyte-project-<flyte-domain> ahvfr924w8k2vgvf97wp-n0-0-raycluster-crb9z 100m 500Mi 0 ready 2m25s
kuberay kuberay-cluster 1 1 2 3G 0 ready 3h37m
...
The address works fine if I just run:
k run kuberay-test --rm --tty -i --restart='Never' --image ... --command -- ray job submit --address <http://kuberay-cluster-head-svc.kuberay.svc.cluster.local:8265> -- python -c "import ray; ray.init(); print(ray.cluster_resources())"
shy-evening-51366
10/18/2024, 1:04 PMworker_node_config
has been required since the initial commit? Not sure how the docs example has ever worked.shy-evening-51366
10/18/2024, 1:04 PM@task(
container_image=<RAY_IMAGE>,
)
def ray_task_job_submit(n: int) -> typing.List[int]:
ray.init(address="<ray://kuberay-cluster-head-svc.kuberay.svc.cluster.local:10001>")
futures = [f.remote(i) for i in range(n)]
return ray.get(futures)
clean-glass-36808
10/18/2024, 3:16 PMaverage-finland-92144
10/18/2024, 10:58 PMworker_node_config
list and avoiding creating a new cluster.
@shy-evening-51366
Please report this on an issue to track itshy-evening-51366
10/21/2024, 7:05 AMshy-evening-51366
10/21/2024, 7:18 AM