File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
google/cloud/aiplatform/preview/vertex_ray Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -249,7 +249,9 @@ def get_ray_cluster(cluster_resource_name: str) -> resources.Cluster:
249
249
cluster = _gapic_utils .persistent_resource_to_cluster (persistent_resource = response )
250
250
if cluster :
251
251
return cluster
252
- raise ValueError ("[Ray on Vertex AI]: The cluster is not a Ray cluster." )
252
+ raise ValueError (
253
+ "[Ray on Vertex AI]: Please delete and recreate the cluster (The cluster is not a Ray cluster or the cluster image is outdated)."
254
+ )
253
255
254
256
255
257
def list_ray_clusters () -> List [resources .Cluster ]:
Original file line number Diff line number Diff line change @@ -154,11 +154,18 @@ def persistent_resource_to_cluster(
154
154
image_uri = persistent_resource .resource_runtime_spec .ray_spec .resource_pool_images [
155
155
"head-node"
156
156
]
157
- if image_uri is None :
157
+ if not image_uri :
158
158
image_uri = persistent_resource .resource_runtime_spec .ray_spec .image_uri
159
- python_version , ray_version = _validation_utils .get_versions_from_image_uri (
160
- image_uri
161
- )
159
+ try :
160
+ python_version , ray_version = _validation_utils .get_versions_from_image_uri (
161
+ image_uri
162
+ )
163
+ except IndexError :
164
+ logging .info (
165
+ "[Ray on Vertex AI]: The image of cluster %s is outdated. It is recommended to delete and recreate the cluster to obtain the latest image." ,
166
+ persistent_resource .name ,
167
+ )
168
+ return
162
169
cluster .python_version = python_version
163
170
cluster .ray_version = ray_version
164
171
You can’t perform that action at this time.
0 commit comments