Skip to content

fix(RHOAIENG-25120): remove kueue as mandatory in RayCluster #832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/codeflare_sdk/ray/cluster/build_ray_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,11 @@ def add_queue_label(cluster: "codeflare_sdk.ray.cluster.Cluster", labels: dict):
if lq_name == None:
return
elif not local_queue_exists(cluster):
raise ValueError(
# ValueError removed to pass validation to validating admission policy
print(
"local_queue provided does not exist or is not in this namespace. Please provide the correct local_queue name in Cluster Configuration"
)
return
labels.update({"kueue.x-k8s.io/queue-name": lq_name})


Expand Down
16 changes: 16 additions & 0 deletions src/codeflare_sdk/ray/cluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ def up(self):
f"Ray Cluster: '{self.config.name}' has successfully been created"
)
except Exception as e: # pragma: no cover
if e.status == 422:
print(
"WARNING: RayCluster creation rejected by the validating admission policy. Please contact your administrator."
)
else:
print(
"WARNING: Failed to create RayCluster due to unexpected error. Please contact your administrator."
)
return _kube_api_error_handling(e)

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

def _throw_for_no_raycluster(self):
Expand Down