MCPcopy
hub / github.com/ray-project/ray / shutdown

Method shutdown

python/ray/cluster_utils.py:403–418  ·  view source on GitHub ↗

Removes all nodes.

(self)

Source from the content-addressed store, hash-verified

401 return all(node.remaining_processes_alive() for node in self.list_all_nodes())
402
403 def shutdown(self):
404 """Removes all nodes."""
405
406 # We create a list here as a copy because `remove_node`
407 # modifies `self.worker_nodes`.
408 all_nodes = list(self.worker_nodes)
409 for node in all_nodes:
410 self.remove_node(node)
411
412 if self.head_node is not None:
413 self.remove_node(self.head_node)
414 # need to reset internal kv since gcs is down
415 ray.experimental.internal_kv._internal_kv_reset()
416 # Delete the cluster address.
417 ray._common.utils.reset_ray_address()
418 ray._private.services.find_gcs_addresses.cache_clear()

Callers 15

ray_start_clusterFunction · 0.95
ray_clusterFunction · 0.95
ray_clusterFunction · 0.95
clusterFunction · 0.95
ray_cpu_head_gpu_workerFunction · 0.95
mainFunction · 0.95
test_clusterFunction · 0.95
test_shutdownFunction · 0.95

Calls 2

remove_nodeMethod · 0.95
listFunction · 0.85

Tested by 15

ray_start_clusterFunction · 0.76
ray_clusterFunction · 0.76
ray_clusterFunction · 0.76
clusterFunction · 0.76
ray_cpu_head_gpu_workerFunction · 0.76
test_clusterFunction · 0.76
test_shutdownFunction · 0.76