@@ -121,10 +121,13 @@ def create_ray_cluster(
121
121
122
122
local_ray_verion = _validation_utils .get_local_ray_version ()
123
123
if ray_version != local_ray_verion :
124
+ install_ray_version = "." .join (ray_version .split ("_" ))
124
125
logging .info (
125
126
f"[Ray on Vertex]: Local runtime has Ray version { local_ray_verion } "
126
127
+ f", but the requested cluster runtime has { ray_version } . Please "
127
- + "ensure that the Ray versions match for client connectivity."
128
+ + "ensure that the Ray versions match for client connectivity. You may "
129
+ + f'"pip install --user --force-reinstall ray[default]=={ install_ray_version } "'
130
+ + " and restart runtime before cluster connection."
128
131
)
129
132
130
133
if cluster_name is None :
@@ -162,8 +165,12 @@ def create_ray_cluster(
162
165
ray_version , python_version , enable_cuda
163
166
)
164
167
if custom_images is not None :
165
- if not (custom_images .head is None or custom_images .worker is None ):
166
- image_uri = custom_images .head
168
+ if custom_images .head is None or custom_images .worker is None :
169
+ raise ValueError (
170
+ "[Ray on Vertex AI]: custom_images.head and custom_images.worker must be specified when custom_images is set."
171
+ )
172
+ image_uri = custom_images .head
173
+
167
174
resource_pool_images [resource_pool_0 .id ] = image_uri
168
175
169
176
worker_pools = []
@@ -207,8 +214,7 @@ def create_ray_cluster(
207
214
ray_version , python_version , enable_cuda
208
215
)
209
216
if custom_images is not None :
210
- if not (custom_images .head is None or custom_images .worker is None ):
211
- image_uri = custom_images .worker
217
+ image_uri = custom_images .worker
212
218
resource_pool_images [resource_pool .id ] = image_uri
213
219
214
220
i += 1
0 commit comments