Skip to content
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

[KubeRay][Autoscaler] Make KubeRay CRD version configurable #40357

Merged
merged 2 commits into from
Oct 16, 2023
Merged
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
8 changes: 5 additions & 3 deletions python/ray/autoscaler/_private/kuberay/node_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
KUBERAY_LABEL_KEY_TYPE = "ray.io/group"
# Kind label value indicating the pod is the head.
KUBERAY_KIND_HEAD = "head"
# Group name (node type) to use for the head.
# Group name (node type) to use for the head.
KUBERAY_TYPE_HEAD = "head-group"
# KubeRay CRD version
KUBERAY_CRD_VER = os.getenv("KUBERAY_CRD_VER", "v1alpha1")

RAY_HEAD_POD_NAME = os.getenv("RAY_HEAD_POD_NAME")

Expand Down Expand Up @@ -162,7 +164,7 @@ def url_from_resource(namespace: str, path: str) -> str:
if path.startswith("pods"):
api_group = "/api/v1"
elif path.startswith("rayclusters"):
api_group = "/apis/ray.io/v1alpha1"
api_group = "/apis/ray.io/" + KUBERAY_CRD_VER
else:
raise NotImplementedError("Tried to access unknown entity at {}".format(path))
return (
Expand Down Expand Up @@ -398,7 +400,7 @@ def _url(self, path: str) -> str:
if path.startswith("pods"):
api_group = "/api/v1"
elif path.startswith("rayclusters"):
api_group = "/apis/ray.io/v1alpha1"
api_group = "/apis/ray.io/" + KUBERAY_CRD_VER
else:
raise NotImplementedError(
"Tried to access unknown entity at {}".format(path)
Expand Down