@@ -105,45 +105,6 @@ def get_ray_cluster(self, name: str, k8s_namespace: str = "default") -> Any:
105
105
log .error ("error fetching custom resource: {}" .format (e ))
106
106
return None
107
107
108
- def get_ray_cluster_status (self , name : str , k8s_namespace : str = "default" , timeout : int = 60 ) -> Any :
109
- """Get a specific Ray cluster in a given namespace.
110
-
111
- Parameters:
112
- - name (str): The name of the Ray cluster custom resource. Defaults to "".
113
- - k8s_namespace (str, optional): The namespace in which to retrieve the Ray cluster. Defaults to "default".
114
- - timeout (int, optional): The duration in seconds after which we stop trying to get status. Defaults to 60 seconds.
115
-
116
-
117
- Returns:
118
- Any: The custom resource for the specified Ray cluster, or None if not found.
119
-
120
- Raises:
121
- ApiException: If there was an error fetching the custom resource.
122
- """
123
- for attempt in range (10 ):
124
- try :
125
- resource : Any = self .api .get_namespaced_custom_object_status (
126
- group = constants .GROUP ,
127
- version = constants .VERSION ,
128
- plural = constants .PLURAL ,
129
- name = name ,
130
- namespace = k8s_namespace ,
131
- )
132
- except ApiException as e :
133
- if e .status == 404 :
134
- log .error ("raycluster resource is not found. error = {}" .format (e ))
135
- return None
136
- else :
137
- log .error ("error fetching custom resource: {}" .format (e ))
138
- return None
139
-
140
- if resource ["status" ]:
141
- return resource ["status" ]
142
- else :
143
- time .sleep (5 )
144
-
145
- return None
146
-
147
108
def get_ray_cluster_status (self , name : str , k8s_namespace : str = "default" , timeout : int = 60 , delay_between_attempts : int = 5 ) -> Any :
148
109
"""Get a specific Ray cluster in a given namespace.
149
110
0 commit comments