File tree Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,11 @@ def test_validate_gpu_nodes(openshift_dyn_client):
27
27
found = False
28
28
for machineset in machinesets :
29
29
logger .info (machineset .instance .metadata .name )
30
- if re .search ("gpu" , machineset .instance .metadata .name ):
30
+ # "gpu" for AWS machineset
31
+ # "nvidia" for Azure machineset
32
+ if re .search ("gpu" , machineset .instance .metadata .name ) or re .search (
33
+ "nvidia" , machineset .instance .metadata .name
34
+ ):
31
35
gpu_machineset = machineset
32
36
found = True
33
37
break
@@ -86,18 +90,20 @@ def test_validate_gpu_nodes(openshift_dyn_client):
86
90
logger .info ("Checking GPU machineset instance type" )
87
91
88
92
err_msg = "No instanceType found for GPU machineset"
89
- try :
90
- logger .info (
91
- machineset .instance .spec .template .spec .providerSpec .value .instanceType
92
- )
93
- except AttributeError :
94
- logger .error (f"FAIL: { err_msg } " )
95
- assert False , err_msg
96
93
97
- instance_type = str (
98
- machineset .instance .spec .template .spec .providerSpec .value .instanceType
94
+ # for AWS
95
+ instance_type = (
96
+ gpu_machineset .instance .spec .template .spec .providerSpec .value .instanceType
99
97
)
100
- if instance_type == "None" :
98
+ if instance_type is None :
99
+ # for Azure
100
+ instance_type = (
101
+ gpu_machineset .instance .spec .template .spec .providerSpec .value .vmSize
102
+ )
103
+
104
+ logger .info (instance_type )
105
+
106
+ if instance_type is None :
101
107
logger .error (f"FAIL: { err_msg } " )
102
108
assert False , err_msg
103
109
You can’t perform that action at this time.
0 commit comments