Stop the ray cluster by sending a signal to the cluster status actor.
(namespace: str)
| 149 | |
| 150 | |
| 151 | def stop_ray_cluster(namespace: str): |
| 152 | """ |
| 153 | Stop the ray cluster by sending a signal to the cluster status actor. |
| 154 | """ |
| 155 | cluster_status = ( |
| 156 | ray.remote(ClusterStatus) |
| 157 | .options( |
| 158 | name=CLUSTER_ACTOR_NAME, |
| 159 | namespace=namespace, |
| 160 | get_if_exists=True, |
| 161 | ) |
| 162 | .remote() |
| 163 | ) |
| 164 | ray.get(cluster_status.finish.remote()) |
| 165 | logger.info("Stopping ray cluster...") |