@@ -1002,6 +1002,7 @@ def get_ray_obj(group, version, namespace, plural, cls=None):
1002
1002
"resourceName" : "quicktest" ,
1003
1003
"workload.codeflare.dev/appwrapper" : "quicktest" ,
1004
1004
"orderedinstance" : "m4.xlarge_g4dn.xlarge" ,
1005
+ "kueue.x-k8s.io/queue-name" : "team-a-queue" ,
1005
1006
},
1006
1007
"managedFields" : [
1007
1008
{
@@ -2483,6 +2484,36 @@ def test_get_cluster(mocker):
2483
2484
assert cluster_config .num_workers == 1
2484
2485
2485
2486
2487
+ def test_get_cluster_no_mcad (mocker ):
2488
+ mocker .patch ("kubernetes.client.ApisApi.get_api_versions" )
2489
+ mocker .patch ("kubernetes.config.load_kube_config" , return_value = "ignore" )
2490
+ mocker .patch (
2491
+ "kubernetes.client.CustomObjectsApi.list_namespaced_custom_object" ,
2492
+ side_effect = get_ray_obj ,
2493
+ )
2494
+ mocker .patch (
2495
+ "kubernetes.client.NetworkingV1Api.list_namespaced_ingress" ,
2496
+ return_value = ingress_retrieval (cluster_name = "quicktest" , client_ing = True ),
2497
+ )
2498
+ cluster = get_cluster ("quicktest" )
2499
+ cluster_config = cluster .config
2500
+ assert cluster_config .name == "quicktest" and cluster_config .namespace == "ns"
2501
+ assert (
2502
+ "m4.xlarge" in cluster_config .machine_types
2503
+ and "g4dn.xlarge" in cluster_config .machine_types
2504
+ )
2505
+ assert cluster_config .min_cpus == 1 and cluster_config .max_cpus == 1
2506
+ assert cluster_config .min_memory == "2G" and cluster_config .max_memory == "2G"
2507
+ assert cluster_config .num_gpus == 0
2508
+ assert cluster_config .instascale
2509
+ assert (
2510
+ cluster_config .image
2511
+ == "ghcr.io/foundation-model-stack/base:ray2.1.0-py38-gpu-pytorch1.12.0cu116-20221213-193103"
2512
+ )
2513
+ assert cluster_config .num_workers == 1
2514
+ assert cluster_config .local_queue == "team-a-queue"
2515
+
2516
+
2486
2517
def route_retrieval (group , version , namespace , plural , name ):
2487
2518
assert group == "route.openshift.io"
2488
2519
assert version == "v1"
0 commit comments