删除 Vertex AI 上的 Ray 集群

在 Ray on Vertex AI 集群上完成应用开发后,请删除集群以避免产生不必要的计费。

控制台

  1. 在 Google Cloud 控制台中,转至“Ray on Vertex AI”页面。

    转到 Ray 页面

  2. 选择要删除的 Vertex AI 集群上的 Ray。

  3. 点击删除

Python 版 Vertex AI SDK

在连接到 Ray on Vertex AI 集群的 Python 环境中,运行以下命令:

# Shut down the Ray on Vertex AI if currently connected
ray.shutdown()

# Delete cluster
vertex_ray.delete_ray_cluster(CLUSTER_RESOURCE_NAME)

其中:

  • CLUSTER_RESOURCE_NAME: CLUSTER_RESOURCE_NAME='projects/{}/locations/{}/persistentResources/{}'.format(PROJECT_ID, REGION, CLUSTER_NAME).