Skip to content

Commit 192c579

Browse files
committed
fix(RHOAIENG-25120): remove kueue as mandatory in RayCluster
Signed-off-by: Pat O'Connor <[email protected]>
1 parent 028d0d5 commit 192c579

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/codeflare_sdk/ray/cluster/build_ray_cluster.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,16 @@ def add_queue_label(cluster: "codeflare_sdk.ray.cluster.Cluster", labels: dict):
488488
if lq_name == None:
489489
return
490490
elif not local_queue_exists(cluster):
491+
"""commenting out to just return nothing
491492
raise ValueError(
492493
"local_queue provided does not exist or is not in this namespace. Please provide the correct local_queue name in Cluster Configuration"
493494
)
495+
"""
496+
# below added after above removal to test if it works (doesn't block creation)
497+
print(
498+
"local_queue provided does not exist or is not in this namespace. Please provide the correct local_queue name in Cluster Configuration"
499+
)
500+
return
494501
labels.update({"kueue.x-k8s.io/queue-name": lq_name})
495502

496503

src/codeflare_sdk/ray/cluster/cluster.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@ def up(self):
183183
f"Ray Cluster: '{self.config.name}' has successfully been created"
184184
)
185185
except Exception as e: # pragma: no cover
186+
if e.status == 422:
187+
print(
188+
"WARNING: RayCluster creation rejected by the validating admission policy. Please contact your administrator."
189+
)
190+
else:
191+
print(
192+
"WARNING: Failed to create RayCluster due to unexpected error. Please contact your administrator."
193+
)
186194
return _kube_api_error_handling(e)
187195

188196
# Applies a new cluster with the provided or default spec
@@ -231,6 +239,14 @@ def apply(self, force=False):
231239
except AttributeError as e:
232240
raise RuntimeError(f"Failed to initialize DynamicClient: {e}")
233241
except Exception as e: # pragma: no cover
242+
if e.status == 422:
243+
print(
244+
"WARNING: RayCluster creation rejected by the validating admission policy. Please contact your administrator."
245+
)
246+
else:
247+
print(
248+
"WARNING: Failed to create RayCluster due to unexpected error. Please contact your administrator."
249+
)
234250
return _kube_api_error_handling(e)
235251

236252
def _throw_for_no_raycluster(self):

0 commit comments

Comments
 (0)