benchmark-runner 1.0.803__py3-none-any.whl → 1.0.805__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- benchmark_runner/common/oc/oc.py +21 -3
- benchmark_runner/workloads/bootstorm_vm.py +51 -38
- {benchmark_runner-1.0.803.dist-info → benchmark_runner-1.0.805.dist-info}/METADATA +1 -1
- {benchmark_runner-1.0.803.dist-info → benchmark_runner-1.0.805.dist-info}/RECORD +7 -7
- {benchmark_runner-1.0.803.dist-info → benchmark_runner-1.0.805.dist-info}/WHEEL +1 -1
- {benchmark_runner-1.0.803.dist-info → benchmark_runner-1.0.805.dist-info}/licenses/LICENSE +0 -0
- {benchmark_runner-1.0.803.dist-info → benchmark_runner-1.0.805.dist-info}/top_level.txt +0 -0
benchmark_runner/common/oc/oc.py
CHANGED
|
@@ -1289,9 +1289,27 @@ class OC(SSH):
|
|
|
1289
1289
|
else:
|
|
1290
1290
|
return self.run(ssh_vm_cmd)
|
|
1291
1291
|
|
|
1292
|
-
def
|
|
1292
|
+
def wait_for_vm_access(self, vm_name: str = '', namespace: str = environment_variables.environment_variables_dict['namespace'],
|
|
1293
|
+
timeout: int = SHORT_TIMEOUT):
|
|
1294
|
+
"""
|
|
1295
|
+
This method waits for VM to be accessible via virtctl ssh
|
|
1296
|
+
:param vm_name:
|
|
1297
|
+
:param timeout:
|
|
1298
|
+
:return:
|
|
1299
|
+
"""
|
|
1300
|
+
current_wait_time = 0
|
|
1301
|
+
while timeout <= 0 or current_wait_time <= timeout:
|
|
1302
|
+
check_virtctl_vm_cmd = f"virtctl ssh --local-ssh=true --local-ssh-opts='-o BatchMode=yes' --local-ssh-opts='-o PasswordAuthentication=no' --local-ssh-opts='-o ConnectTimeout=2' root@{vm_name} -n {namespace} 2>&1 |egrep 'denied|verification failed' && echo 'True' || echo 'False'"
|
|
1303
|
+
if 'True' in self.run(check_virtctl_vm_cmd):
|
|
1304
|
+
return 'True'
|
|
1305
|
+
# sleep for x seconds
|
|
1306
|
+
time.sleep(OC.SLEEP_TIME)
|
|
1307
|
+
current_wait_time += OC.SLEEP_TIME
|
|
1308
|
+
raise VMStateTimeout(vm_name=vm_name, state='virtctl')
|
|
1309
|
+
|
|
1310
|
+
def get_vm_access(self, vm_name: str = '', namespace: str = environment_variables.environment_variables_dict['namespace']):
|
|
1293
1311
|
"""
|
|
1294
|
-
This method returns True when the VM is
|
|
1312
|
+
This method returns True when the VM is access and an error message when it is not, using virtctl protocol
|
|
1295
1313
|
:param vm_name:
|
|
1296
1314
|
:param namespace:
|
|
1297
1315
|
:return: virtctl_status 'True' if successful, or an error message if it fails.
|
|
@@ -1312,7 +1330,7 @@ class OC(SSH):
|
|
|
1312
1330
|
:return:
|
|
1313
1331
|
"""
|
|
1314
1332
|
namespace = f'-n {namespace}' if namespace else ''
|
|
1315
|
-
command = f"{self._cli} get vmi {vm_name} {namespace} -o jsonpath
|
|
1333
|
+
command = f"{self._cli} get vmi {vm_name} {namespace} -o jsonpath=\"{{.status.nodeName}}\""
|
|
1316
1334
|
|
|
1317
1335
|
try:
|
|
1318
1336
|
result = self.run(command)
|
|
@@ -66,6 +66,19 @@ class BootstormVM(WorkloadsOperations):
|
|
|
66
66
|
"""
|
|
67
67
|
self._bootstorm_start_time[vm_name] = time.time()
|
|
68
68
|
|
|
69
|
+
@logger_time_stamp
|
|
70
|
+
def _wait_vm_access(self, vm_name: str):
|
|
71
|
+
"""
|
|
72
|
+
This method verifies virtctl into VM and return vm node in success or False if failed
|
|
73
|
+
@return:
|
|
74
|
+
"""
|
|
75
|
+
if self._oc.get_vm_node(vm_name=vm_name):
|
|
76
|
+
vm_node = self._oc.get_vm_node(vm_name=vm_name)
|
|
77
|
+
if self._oc.wait_for_vm_access(vm_name=vm_name):
|
|
78
|
+
logger.info(f"Successfully virtctl into VM: '{vm_name}' in node {vm_node} ")
|
|
79
|
+
return vm_node
|
|
80
|
+
return False
|
|
81
|
+
|
|
69
82
|
@logger_time_stamp
|
|
70
83
|
def _wait_ssh_vm(self, vm_name: str):
|
|
71
84
|
"""
|
|
@@ -92,7 +105,7 @@ class BootstormVM(WorkloadsOperations):
|
|
|
92
105
|
"""
|
|
93
106
|
if vm_node:
|
|
94
107
|
delta = round((time.time() - self._bootstorm_start_time[vm_name]) * self.MILLISECONDS, 3)
|
|
95
|
-
data = {'vm_name': vm_name, 'node': vm_node, 'bootstorm_time': delta, '
|
|
108
|
+
data = {'vm_name': vm_name, 'node': vm_node, 'bootstorm_time': delta, 'access_vm': int(bool(vm_node)),}
|
|
96
109
|
logger.info(data)
|
|
97
110
|
return data
|
|
98
111
|
return {}
|
|
@@ -123,15 +136,15 @@ class BootstormVM(WorkloadsOperations):
|
|
|
123
136
|
self._data_dict.update(self._prometheus_result)
|
|
124
137
|
total_run_time = self._get_bootstorm_vm_total_run_time()
|
|
125
138
|
self._data_dict.update({'total_run_time': total_run_time})
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
139
|
+
# Google drive run_artifacts_url folder path
|
|
140
|
+
if self._google_drive_path and self.get_run_artifacts_google_drive():
|
|
141
|
+
self._data_dict.update({'run_artifacts_url': self.get_run_artifacts_google_drive()})
|
|
142
|
+
if self._es_host:
|
|
143
|
+
# upload several run results
|
|
144
|
+
self._upload_to_elasticsearch(index=self._es_index, kind=self._kind, status=self._status,
|
|
145
|
+
result=self._data_dict)
|
|
146
|
+
# verify that data upload to elastic search according to unique uuid
|
|
147
|
+
self._verify_elasticsearch_data_uploaded(index=self._es_index, uuid=self._uuid)
|
|
135
148
|
|
|
136
149
|
def _run_vm(self):
|
|
137
150
|
"""
|
|
@@ -143,7 +156,7 @@ class BootstormVM(WorkloadsOperations):
|
|
|
143
156
|
self._set_bootstorm_vm_first_run_time()
|
|
144
157
|
self._set_bootstorm_vm_start_time(vm_name=self._vm_name)
|
|
145
158
|
self._virtctl.start_vm_sync(vm_name=self._vm_name)
|
|
146
|
-
self.vm_node = self.
|
|
159
|
+
self.vm_node = self._wait_vm_access(vm_name=self._vm_name)
|
|
147
160
|
self._data_dict = self._get_bootstorm_vm_elapsed_time(vm_name=self._vm_name, vm_node=self.vm_node)
|
|
148
161
|
self._data_dict['run_artifacts_url'] = os.path.join(self._run_artifacts_url,
|
|
149
162
|
f'{self._get_run_artifacts_hierarchy(workload_name=self._workload_name, is_file=True)}-{self._time_stamp_format}.tar.gz')
|
|
@@ -158,16 +171,16 @@ class BootstormVM(WorkloadsOperations):
|
|
|
158
171
|
:param vm_name: The name of the VM to verify.
|
|
159
172
|
:param retries: Number of retry attempts.
|
|
160
173
|
:param delay: Time to wait (in seconds) between retries.
|
|
161
|
-
@return:
|
|
174
|
+
@return: access_status 'True' if successful, or an error message if it fails
|
|
162
175
|
"""
|
|
163
|
-
|
|
176
|
+
access_status = None
|
|
164
177
|
for attempt in range(retries):
|
|
165
178
|
try:
|
|
166
|
-
|
|
179
|
+
access_status = self._oc.get_vm_access(vm_name)
|
|
167
180
|
|
|
168
|
-
if str(
|
|
181
|
+
if str(access_status).lower() == "true":
|
|
169
182
|
# Log success and store relevant data
|
|
170
|
-
logger.info(f"VM {vm_name} verified successfully (virtctl SSH status: {
|
|
183
|
+
logger.info(f"VM {vm_name} verified successfully (virtctl SSH status: {access_status}).")
|
|
171
184
|
break # Exit loop on success
|
|
172
185
|
else:
|
|
173
186
|
logger.info(f"Attempt {attempt + 1}/{retries}: VM {vm_name} not reachable via Virtctl SSH. Retrying...")
|
|
@@ -185,8 +198,8 @@ class BootstormVM(WorkloadsOperations):
|
|
|
185
198
|
self._data_dict = {
|
|
186
199
|
'vm_name': vm_name,
|
|
187
200
|
'node': vm_node,
|
|
188
|
-
'
|
|
189
|
-
'
|
|
201
|
+
'access_vm': 1 if str(access_status).lower() == "true" else 0, # int value for Grafana
|
|
202
|
+
'access_status': access_status,
|
|
190
203
|
'test_name': self._test_name,
|
|
191
204
|
'run_artifacts_url': os.path.join(
|
|
192
205
|
self._run_artifacts_url,
|
|
@@ -194,13 +207,13 @@ class BootstormVM(WorkloadsOperations):
|
|
|
194
207
|
)
|
|
195
208
|
}
|
|
196
209
|
|
|
197
|
-
if str(
|
|
210
|
+
if str(access_status).lower() != "true":
|
|
198
211
|
logger.info(
|
|
199
|
-
f"All attempts failed for VM {vm_name}. Final SSH status: {self._data_dict.get('
|
|
212
|
+
f"All attempts failed for VM {vm_name}. Final SSH status: {self._data_dict.get('access_status', 'No status available')}")
|
|
200
213
|
error_log_path = f"{self._run_artifacts_path}/{vm_name}_error.log"
|
|
201
214
|
|
|
202
215
|
# Retrieve the status or use a default message
|
|
203
|
-
status_message = self._data_dict.get('
|
|
216
|
+
status_message = self._data_dict.get('access_status') or "No status available"
|
|
204
217
|
|
|
205
218
|
try:
|
|
206
219
|
with open(error_log_path, "w") as error_log_file:
|
|
@@ -209,7 +222,7 @@ class BootstormVM(WorkloadsOperations):
|
|
|
209
222
|
logger.error(f"Failed to write error log for {vm_name}: {write_err}")
|
|
210
223
|
|
|
211
224
|
self._finalize_vm()
|
|
212
|
-
return
|
|
225
|
+
return access_status
|
|
213
226
|
|
|
214
227
|
def _verify_single_vm_wrapper(self, vm_name, return_dict):
|
|
215
228
|
"""
|
|
@@ -251,7 +264,7 @@ class BootstormVM(WorkloadsOperations):
|
|
|
251
264
|
failure_vms.append(vm_name)
|
|
252
265
|
return failure_vms
|
|
253
266
|
|
|
254
|
-
def
|
|
267
|
+
def _verify_vms_access(self, delay=10):
|
|
255
268
|
"""
|
|
256
269
|
This method verifies the virtctl SSH login for each VM, either during the upgrade or once for each VM.
|
|
257
270
|
It prepares the data for ElasticSearch, generates a must-gather in case of an error, and uploads it to Google Drive.
|
|
@@ -292,19 +305,19 @@ class BootstormVM(WorkloadsOperations):
|
|
|
292
305
|
odf_version=self._odf_version)
|
|
293
306
|
# Error log with details of failed VM, for catching all vm errors
|
|
294
307
|
logger.error(f"Failed to verify virtctl SSH login for the following VMs: {', '.join(failure_vms)}")
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
+
# Upload artifacts
|
|
309
|
+
if self._google_drive_shared_drive_id:
|
|
310
|
+
self.upload_run_artifacts_to_google_drive()
|
|
311
|
+
elif self._endpoint_url:
|
|
312
|
+
self.upload_run_artifacts_to_s3()
|
|
313
|
+
else:
|
|
314
|
+
self._save_artifacts_local = True
|
|
315
|
+
if self._es_host:
|
|
316
|
+
self._data_dict.update({'run_artifacts_url': self.get_run_artifacts_google_drive(), 'failure_vms': failure_vms, 'verification_failure': True})
|
|
317
|
+
# upload several run results
|
|
318
|
+
self._upload_to_elasticsearch(index=self._es_index, kind=self._kind, status=self._status,result=self._data_dict)
|
|
319
|
+
# verify that data upload to elastic search according to unique uuid
|
|
320
|
+
self._verify_elasticsearch_data_uploaded(index=self._es_index, uuid=self._uuid)
|
|
308
321
|
|
|
309
322
|
except Exception as err:
|
|
310
323
|
# Save run artifacts logs
|
|
@@ -322,7 +335,7 @@ class BootstormVM(WorkloadsOperations):
|
|
|
322
335
|
if not self._run_strategy:
|
|
323
336
|
self._virtctl.start_vm_async(vm_name=f'{self._workload_name}-{self._trunc_uuid}-{vm_num}')
|
|
324
337
|
self._virtctl.wait_for_vm_status(vm_name=vm_name, status=VMStatus.Running)
|
|
325
|
-
vm_node = self.
|
|
338
|
+
vm_node = self._wait_vm_access(vm_name)
|
|
326
339
|
self._data_dict = self._get_bootstorm_vm_elapsed_time(vm_name=vm_name, vm_node=vm_node)
|
|
327
340
|
self._data_dict['run_artifacts_url'] = os.path.join(self._run_artifacts_url, f'{self._get_run_artifacts_hierarchy(workload_name=self._workload_name, is_file=True)}-scale-{self._time_stamp_format}.tar.gz')
|
|
328
341
|
self._finalize_vm()
|
|
@@ -394,7 +407,7 @@ class BootstormVM(WorkloadsOperations):
|
|
|
394
407
|
def run_vm_workload(self):
|
|
395
408
|
# verification only w/o running or deleting any resource
|
|
396
409
|
if self._verification_only:
|
|
397
|
-
self.
|
|
410
|
+
self._verify_vms_access()
|
|
398
411
|
else:
|
|
399
412
|
if not self._scale:
|
|
400
413
|
self._run_vm()
|
|
@@ -46,7 +46,7 @@ benchmark_runner/common/logger/init_logger.py,sha256=ERa-gNqrl2pZybj7v3csvmao7Mv
|
|
|
46
46
|
benchmark_runner/common/logger/logger_exceptions.py,sha256=rivdlRm_jIsKQ53rP_-HX8emdtOmQNO4JuIkg8fnBoc,454
|
|
47
47
|
benchmark_runner/common/logger/logger_time_stamp.py,sha256=2JgugN9LpXF4Ijx0wPRzz3DAGJB8eJpM5g1qPvbWbV8,1479
|
|
48
48
|
benchmark_runner/common/oc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
-
benchmark_runner/common/oc/oc.py,sha256=
|
|
49
|
+
benchmark_runner/common/oc/oc.py,sha256=iCsh3eBrhRta2qn7h97vhy-jWQ_fKlC9HTi_Cg2fYZQ,70518
|
|
50
50
|
benchmark_runner/common/oc/oc_exceptions.py,sha256=XfKUzeK3Ors_Y2csQEoGqrlsZlYvq6OXLkFh9s_mQRM,6311
|
|
51
51
|
benchmark_runner/common/oc/singleton_oc_login.py,sha256=OISe7GxN-povQBk1GYVwkdcuEvIbDQP5QImYbNvhX5Y,2395
|
|
52
52
|
benchmark_runner/common/ocp_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -166,15 +166,15 @@ benchmark_runner/main/environment_variables_exceptions.py,sha256=UR0Ith0P0oshsDZ
|
|
|
166
166
|
benchmark_runner/main/main.py,sha256=A744O550wQh37hhk10H0HlT28LZ_2EOaRlJyWG6Pras,14083
|
|
167
167
|
benchmark_runner/main/temporary_environment_variables.py,sha256=ODSHkfhgvdr_b2e3XyvykW21MVjSdyqimREyMc2klRE,957
|
|
168
168
|
benchmark_runner/workloads/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
169
|
-
benchmark_runner/workloads/bootstorm_vm.py,sha256=
|
|
169
|
+
benchmark_runner/workloads/bootstorm_vm.py,sha256=1nugd-X-8ZX2-inIiHMxQnPDfUlmCm7OKKW6_EinwBc,21168
|
|
170
170
|
benchmark_runner/workloads/vdbench_pod.py,sha256=feu3lvNumfBCD-An6__xS5Kt9nA50A_-0FmqTXuU9iw,10011
|
|
171
171
|
benchmark_runner/workloads/vdbench_vm.py,sha256=4rRbE-jAbmNrhP-k8F_OREkJ59VfQ7wLrfRQPwDneJg,9786
|
|
172
172
|
benchmark_runner/workloads/windows_vm.py,sha256=qFVD3qBFMnVpYXnrpam-7H5-0Yzvx6qtaEEZx4T-ex4,2415
|
|
173
173
|
benchmark_runner/workloads/workloads.py,sha256=F9fnk4h715tq7ANSCbDH0jktB8fpr_u3YG61Kdi5_os,1422
|
|
174
174
|
benchmark_runner/workloads/workloads_exceptions.py,sha256=u7VII95iPRF_YhfpGH1U1RmgiIYESMOtbSF1dz7_ToE,1858
|
|
175
175
|
benchmark_runner/workloads/workloads_operations.py,sha256=cuhGZA1n1Ing0amC-f9Y4MYtwQrFGyaoZUNkpZObKX4,26432
|
|
176
|
-
benchmark_runner-1.0.
|
|
177
|
-
benchmark_runner-1.0.
|
|
178
|
-
benchmark_runner-1.0.
|
|
179
|
-
benchmark_runner-1.0.
|
|
180
|
-
benchmark_runner-1.0.
|
|
176
|
+
benchmark_runner-1.0.805.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
177
|
+
benchmark_runner-1.0.805.dist-info/METADATA,sha256=-5DyHf3RX4fcO6nj6tTrIgFH6Akj8omUOlzFCop-pcs,11520
|
|
178
|
+
benchmark_runner-1.0.805.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
|
179
|
+
benchmark_runner-1.0.805.dist-info/top_level.txt,sha256=MP7UbTCzu59D53uKCZl5VsQeM_vheyMc7FmryczJQbk,17
|
|
180
|
+
benchmark_runner-1.0.805.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|