@@ -308,6 +308,32 @@ def get_default_kueue_name(namespace: str):
308308 "Default Local Queue with kueue.x-k8s.io/default-queue: true annotation not found please create a default Local Queue or provide the local_queue name in Cluster Configuration"
309309 )
310310
311+ # test function
312+
313+ # def _throw_for_no_raycluster( user_yaml: dict,
314+ # output_file_name: str,
315+ # namespace: str,
316+ # local_queue: Optional[str],
317+ # labels: dict,):
318+ # api_instance = client.CustomObjectsApi(api_config_handler())
319+ # print('hello')
320+ # # try:
321+ # # api_instance.list_namespaced_custom_object(
322+ # # group="kueue.x-k8s.io",
323+ # # version="v1",
324+ # # namespace=namespace,
325+ # # plural="localqueues",
326+ # # )
327+ # # except ApiException as e:
328+ # # if e.status == 404:
329+ # # raise RuntimeError(
330+ # # "RayCluster CustomResourceDefinition unavailable contact your administrator."
331+ # # )
332+ # # else:
333+ # # raise RuntimeError(
334+ # # "Failed to get RayCluster CustomResourceDefinition: " + str(e)
335+ # # )
336+
311337
312338def local_queue_exists (namespace : str , local_queue_name : str ):
313339 # get all local queues in the namespace
@@ -344,10 +370,10 @@ def write_components(
344370 components = user_yaml .get ("spec" , "resources" )["resources" ].get ("GenericItems" )
345371 # check if RayCluster CustomResourceDefinition exists if not throw RuntimeError
346372 # _throw_for_no_raycluster()
347- if local_queue is None :
348- print (
349- "Kueue is not installed or won't be used. The absence of CRDs may lack the necessary functionality."
350- )
373+ # if local_queue is None:
374+ # print(
375+ # "Kueue is not installed or won't be used. The absence of CRDs may lack the necessary functionality."
376+ # )
351377 open (output_file_name , "w" ).close ()
352378 lq_name = local_queue or get_default_kueue_name (namespace )
353379 cluster_labels = labels
@@ -385,17 +411,20 @@ def load_components(
385411 components = user_yaml .get ("spec" , "resources" )["resources" ].get ("GenericItems" )
386412 lq_name = local_queue or get_default_kueue_name (namespace )
387413 cluster_labels = labels
414+ < << << << HEAD
388415 if not local_queue_exists (namespace , lq_name ):
389416 raise ValueError (
390417 "local_queue provided does not exist or is not in this namespace. Please provide the correct local_queue name in Cluster Configuration"
391418 )
419+ == == == =
392420
393421 # _throw_for_no_raycluster()
394422
395- if local_queue is None :
396- print (
397- "Kueue is not installed or won't be used. The absence of CRDs may lack the necessary functionality."
398- )
423+ # if local_queue is None:
424+ # print(
425+ # "Kueue is not installed or won't be used. The absence of CRDs may lack the necessary functionality."
426+ # )
427+ >> >> >> > 1 d38c8d (prep )
399428 for component in components :
400429 if "generictemplate" in component :
401430 if (
0 commit comments