benchmark-runner 1.0.827__py3-none-any.whl → 1.0.829__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.

Potentially problematic release.


This version of benchmark-runner might be problematic. Click here for more details.

@@ -42,6 +42,8 @@ class BareMetalOperations:
42
42
  self._upgrade_ocp_version = self._environment_variables_dict.get('upgrade_ocp_version', '')
43
43
  self._upgrade_channel = self._environment_variables_dict.get('upgrade_channel', '')
44
44
  self._timeout = int(self._environment_variables_dict.get('timeout', ''))
45
+ self._must_gather_log = self._environment_variables_dict.get('must_gather_log', '')
46
+ self._run_artifacts_path = self._environment_variables_dict.get('run_artifacts_path', '')
45
47
  if user:
46
48
  self._user = user
47
49
  self._provision_kubeadmin_password_path = self._environment_variables_dict.get('provision_kubeadmin_password_path', '')
@@ -107,14 +109,17 @@ class BareMetalOperations:
107
109
  current_wait_time = 0
108
110
  logger.info(f'Waiting until the upgrade to version {self._upgrade_ocp_version} starts...')
109
111
  oc.wait_for_ocp_upgrade_start(upgrade_version=self._upgrade_ocp_version)
110
- while self._timeout <= 0 or current_wait_time <= self._timeout and oc.upgrade_in_progress():
112
+ while (self._timeout <= 0 or current_wait_time <= self._timeout) and oc.upgrade_in_progress():
111
113
  logger.info(f'Waiting till OCP upgrade complete, waiting {int(current_wait_time / 60)} minutes')
112
114
  # sleep for x seconds
113
115
  time.sleep(sleep_time)
114
116
  current_wait_time += sleep_time
115
- if f'Cluster version is {self._upgrade_ocp_version}' == oc.get_cluster_status():
117
+ if oc.get_upgrade_version() == self._upgrade_ocp_version:
118
+ logger.info(f"OCP successfully upgraded to {oc.get_upgrade_version()}")
116
119
  return True
117
120
  else:
121
+ if self._must_gather_log:
122
+ oc.generate_must_gather(destination_path=self._run_artifacts_path)
118
123
  raise OCPUpgradeFailed(status=oc.get_cluster_status())
119
124
 
120
125
  def _install_ocp_cmd(self):
@@ -101,11 +101,24 @@ class OC(SSH):
101
101
 
102
102
  def upgrade_in_progress(self):
103
103
  """
104
- This method returns True when an upgrade is in progress and False when it is not.
104
+ This method returns True if an upgrade is in progress and False otherwise, with retries on transient failures.
105
105
  @return: bool
106
106
  """
107
- status = self.run(f"{self._cli} get clusterversion version -o jsonpath='{{.status.conditions[?(@.type==\"Progressing\")].status}}'")
108
- return status == 'True'
107
+ for i in range(1, self.RETRIES + 1):
108
+ try:
109
+ status = self.run(
110
+ f"{self._cli} get clusterversion version "
111
+ "-o jsonpath='{{.status.conditions[?(@.type==\"Progressing\")].status}}'"
112
+ ).strip()
113
+ return status == 'True'
114
+ except Exception as e:
115
+ logger.warning(f"[upgrade_in_progress] attempt {i}/{self.RETRIES} failed: {e}")
116
+ time.sleep(self.DELAY)
117
+ # Final attempt (will bubble if it fails)
118
+ return self.run(
119
+ f"{self._cli} get clusterversion version "
120
+ "-o jsonpath='{{.status.conditions[?(@.type==\"Progressing\")].status}}'"
121
+ ).strip() == 'True'
109
122
 
110
123
  @logger_time_stamp
111
124
  def wait_for_ocp_upgrade_start(self, upgrade_version: str, timeout: int = SHORT_TIMEOUT):
@@ -1521,6 +1534,29 @@ class OC(SSH):
1521
1534
  results_list.append(line.strip().split(':')[data_index:])
1522
1535
  return results_list
1523
1536
 
1537
+ @typechecked
1538
+ @logger_time_stamp
1539
+ def generate_must_gather(self, destination_path: str = '/tmp'):
1540
+ """
1541
+ Generates OpenShift must-gather and stores it in the destination path.
1542
+
1543
+ :param destination_path: The directory where the must-gather logs will be stored. Default is '/tmp'.
1544
+ :return: The result of the run command.
1545
+ :raises: RuntimeError if the command fails.
1546
+ """
1547
+ folder_path = os.path.join(destination_path, "must-gather")
1548
+
1549
+ try:
1550
+ command = f'oc adm must-gather --dest-dir={folder_path}'
1551
+ self.run(command)
1552
+ except Exception as e:
1553
+ if os.path.exists(folder_path):
1554
+ try:
1555
+ shutil.rmtree(folder_path)
1556
+ except Exception as remove_error:
1557
+ raise RuntimeError(f"Failed to remove folder {folder_path}: {remove_error}")
1558
+ raise RuntimeError(f"Failed to generate OCP must-gather logs for version: {e}")
1559
+
1524
1560
  @typechecked
1525
1561
  @logger_time_stamp
1526
1562
  def generate_odf_must_gather(self, destination_path: str = '/tmp', odf_version: str = None):
@@ -304,6 +304,7 @@ class BootstormVM(WorkloadsOperations):
304
304
 
305
305
  if failure_vms:
306
306
  if self._must_gather_log:
307
+ self._oc.generate_must_gather(destination_path=self._run_artifacts_path)
307
308
  self._oc.generate_cnv_must_gather(destination_path=self._run_artifacts_path, cnv_version=self._cnv_version)
308
309
  self._oc.generate_odf_must_gather(destination_path=self._run_artifacts_path, odf_version=self._odf_version)
309
310
  # Error log with details of failed VM, for catching all vm errors
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: benchmark-runner
3
- Version: 1.0.827
3
+ Version: 1.0.829
4
4
  Summary: Benchmark Runner Tool
5
5
  Home-page: https://github.com/redhat-performance/benchmark-runner
6
6
  Author: Red Hat
@@ -23,7 +23,7 @@ benchmark_runner/common/clouds/Azure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
23
23
  benchmark_runner/common/clouds/Azure/azure_operations.py,sha256=Ok3l0rxCAqZd2_yzuOuUO6Zs3KjvYC85p2VQf7uyMnM,4735
24
24
  benchmark_runner/common/clouds/BareMetal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  benchmark_runner/common/clouds/BareMetal/bare_metal_exceptions.py,sha256=d-aeCfsfGpZ3e1Bho1M8pYlN0D8R-ffjwPm9YwGHvhU,1552
26
- benchmark_runner/common/clouds/BareMetal/bare_metal_operations.py,sha256=8N6p_H-vHuatmkhBr7zIISFGVacrfdNH3gbRIfhieq8,18804
26
+ benchmark_runner/common/clouds/BareMetal/bare_metal_operations.py,sha256=lNkiRDbOFdNCcwD-jrO1E3pdggElIVC2sufcjd2Jc-s,19178
27
27
  benchmark_runner/common/clouds/IBM/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  benchmark_runner/common/clouds/IBM/ibm_exceptions.py,sha256=psqHgqEBRbfFRWD1blwaWGad-QpThgOl8Puq76VIP80,417
29
29
  benchmark_runner/common/clouds/IBM/ibm_operations.py,sha256=ZpF3Vnu2YKqAEYVf7ofBg_kOavMaLCXYCt0CdX8dKd4,3419
@@ -47,7 +47,7 @@ benchmark_runner/common/logger/init_logger.py,sha256=ERa-gNqrl2pZybj7v3csvmao7Mv
47
47
  benchmark_runner/common/logger/logger_exceptions.py,sha256=rivdlRm_jIsKQ53rP_-HX8emdtOmQNO4JuIkg8fnBoc,454
48
48
  benchmark_runner/common/logger/logger_time_stamp.py,sha256=2JgugN9LpXF4Ijx0wPRzz3DAGJB8eJpM5g1qPvbWbV8,1479
49
49
  benchmark_runner/common/oc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
- benchmark_runner/common/oc/oc.py,sha256=ht1FpW5QCdFxJkEemwBXzrymIrHDw0RQoEpm5z51MNg,71949
50
+ benchmark_runner/common/oc/oc.py,sha256=uY4kH2ootoaDUf8JSvWzQI2uAvpgVXNYSBSrHLwkX1E,73524
51
51
  benchmark_runner/common/oc/oc_exceptions.py,sha256=XfKUzeK3Ors_Y2csQEoGqrlsZlYvq6OXLkFh9s_mQRM,6311
52
52
  benchmark_runner/common/oc/singleton_oc_login.py,sha256=OISe7GxN-povQBk1GYVwkdcuEvIbDQP5QImYbNvhX5Y,2395
53
53
  benchmark_runner/common/ocp_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -167,15 +167,15 @@ benchmark_runner/main/environment_variables_exceptions.py,sha256=UR0Ith0P0oshsDZ
167
167
  benchmark_runner/main/main.py,sha256=A744O550wQh37hhk10H0HlT28LZ_2EOaRlJyWG6Pras,14083
168
168
  benchmark_runner/main/temporary_environment_variables.py,sha256=ODSHkfhgvdr_b2e3XyvykW21MVjSdyqimREyMc2klRE,957
169
169
  benchmark_runner/workloads/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
170
- benchmark_runner/workloads/bootstorm_vm.py,sha256=ZgIiUF3ayMm3FQZwWDUsd8HhjzqCheDJlv_5Puzw4_E,21526
170
+ benchmark_runner/workloads/bootstorm_vm.py,sha256=H55cOHeEIPsb2kxxiXhO0Wuu5wHV0u_61dHbAsvy9VY,21619
171
171
  benchmark_runner/workloads/vdbench_pod.py,sha256=feu3lvNumfBCD-An6__xS5Kt9nA50A_-0FmqTXuU9iw,10011
172
172
  benchmark_runner/workloads/vdbench_vm.py,sha256=4rRbE-jAbmNrhP-k8F_OREkJ59VfQ7wLrfRQPwDneJg,9786
173
173
  benchmark_runner/workloads/windows_vm.py,sha256=qFVD3qBFMnVpYXnrpam-7H5-0Yzvx6qtaEEZx4T-ex4,2415
174
174
  benchmark_runner/workloads/workloads.py,sha256=F9fnk4h715tq7ANSCbDH0jktB8fpr_u3YG61Kdi5_os,1422
175
175
  benchmark_runner/workloads/workloads_exceptions.py,sha256=u7VII95iPRF_YhfpGH1U1RmgiIYESMOtbSF1dz7_ToE,1858
176
176
  benchmark_runner/workloads/workloads_operations.py,sha256=8utD-uU_MNZn5JOC2r5OVq5BfCPkxlUvP3xlUP9oIGk,27160
177
- benchmark_runner-1.0.827.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
178
- benchmark_runner-1.0.827.dist-info/METADATA,sha256=OohDnC4KbU2jToYnq4GF2dCI3fExiDUp8KAs-uaGQyw,11520
179
- benchmark_runner-1.0.827.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
180
- benchmark_runner-1.0.827.dist-info/top_level.txt,sha256=MP7UbTCzu59D53uKCZl5VsQeM_vheyMc7FmryczJQbk,17
181
- benchmark_runner-1.0.827.dist-info/RECORD,,
177
+ benchmark_runner-1.0.829.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
178
+ benchmark_runner-1.0.829.dist-info/METADATA,sha256=hh9R_sn79bTAF1XymlclWHhyyJyc83kPwPVzoy_ASI8,11520
179
+ benchmark_runner-1.0.829.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
180
+ benchmark_runner-1.0.829.dist-info/top_level.txt,sha256=MP7UbTCzu59D53uKCZl5VsQeM_vheyMc7FmryczJQbk,17
181
+ benchmark_runner-1.0.829.dist-info/RECORD,,