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

@@ -1,6 +1,8 @@
1
1
 
2
2
  import os
3
+ import time
3
4
 
5
+ from googleapiclient.errors import HttpError
4
6
  from googleapiclient.discovery import build
5
7
  from google.oauth2.credentials import Credentials
6
8
  from googleapiclient.http import MediaFileUpload
@@ -137,34 +139,40 @@ class GoogleDriveOperations:
137
139
  logger.error(f"Error creating folder '{folder_name}': {e}")
138
140
  return None
139
141
 
140
- def _find_folder_id(self, parent_folder_id, folder_name):
142
+ def _find_folder_id(self, parent_folder_id, folder_name, max_retries=3, delay=5):
141
143
  """
142
- Helper method to find the folder ID by name within a specified parent folder.
144
+ Finds a folder ID by name within a specified parent folder, with retry handling.
145
+
143
146
  :param parent_folder_id: The ID of the parent folder to search within.
144
147
  :param folder_name: The name of the folder to find.
148
+ :param max_retries: The maximum number of retry attempts.
149
+ :param delay: The delay (in seconds) between retries.
145
150
  :return: The ID of the folder if found, otherwise None.
146
151
  """
147
- page_token = None
148
- while True:
149
- results = self.service.files().list(
150
- q=f"'{parent_folder_id}' in parents and trashed = false and mimeType = 'application/vnd.google-apps.folder'",
151
- includeItemsFromAllDrives=True,
152
- supportsAllDrives=True,
153
- pageSize=100,
154
- fields="nextPageToken, files(id, name)",
155
- pageToken=page_token
156
- ).execute()
157
-
158
- items = results.get('files', [])
159
- for item in items:
160
- if item['name'] == folder_name:
161
- return item['id']
162
-
163
- page_token = results.get('nextPageToken', None)
164
- if page_token is None:
165
- break
166
-
167
- return None
152
+ for attempt in range(max_retries):
153
+ try:
154
+ response = self.service.files().list(
155
+ q=f"'{parent_folder_id}' in parents and name='{folder_name}' and mimeType='application/vnd.google-apps.folder' and trashed=false",
156
+ supportsAllDrives=True,
157
+ includeItemsFromAllDrives=True,
158
+ pageSize=100,
159
+ fields="files(id, name)"
160
+ ).execute()
161
+ folders = response.get('files', [])
162
+ if folders:
163
+ return folders[0]['id']
164
+ except HttpError as e:
165
+ if e.resp.status in [403, 404]: # Permanent errors (e.g., permission denied)
166
+ logger.error(f"Permission error or folder not found: {e}")
167
+ break # No point in retrying
168
+ if attempt < max_retries - 1:
169
+ logger.warning(f"Attempt {attempt + 1} failed with error {e}. Retrying in {delay} seconds...")
170
+ time.sleep(delay)
171
+ else:
172
+ logger.error(f"Failed after {max_retries} attempts: {e}")
173
+ raise
174
+
175
+ return None # Explicit return if folder is not found
168
176
 
169
177
  def get_folder_id_by_path(self, folder_path, parent_folder_id):
170
178
  """
@@ -33,7 +33,6 @@ class OC(SSH):
33
33
 
34
34
  def __init__(self, kubeadmin_password: str = ''):
35
35
  super().__init__()
36
- self.__kubeadmin_password = kubeadmin_password
37
36
  self.__environment_variables_dict = environment_variables.environment_variables_dict
38
37
  self._run_artifacts = self.__environment_variables_dict.get('run_artifacts_path', '')
39
38
  self.__elasticsearch_url = self.__environment_variables_dict.get('elasticsearch_url', '')
@@ -43,6 +42,10 @@ class OC(SSH):
43
42
  self.__worker_disk_ids = self.__environment_variables_dict.get('worker_disk_ids', '')
44
43
  if self.__worker_disk_ids:
45
44
  self.__worker_disk_ids = ast.literal_eval(self.__worker_disk_ids)
45
+ if kubeadmin_password:
46
+ self.__kubeadmin_password = kubeadmin_password
47
+ else:
48
+ self.__kubeadmin_password = self.__environment_variables_dict.get('kubeadmin_password', '')
46
49
 
47
50
  def get_ocp_server_version(self):
48
51
  """
@@ -217,6 +217,7 @@ class BootstormVM(WorkloadsOperations):
217
217
  failure_vms = [] # List to store failed VM names
218
218
 
219
219
  if self._wait_for_upgrade_version:
220
+ logger.info(f"wait for ocp upgrade version: {self._wait_for_upgrade_version}")
220
221
  upgrade_done = self._oc.get_cluster_status() == f'Cluster version is {self._wait_for_upgrade_version}'
221
222
  current_wait_time = 0
222
223
 
@@ -391,6 +391,7 @@ class WorkloadsOperations:
391
391
  :return:
392
392
  """
393
393
  date_format = '%Y_%m_%d'
394
+ self._oc.login()
394
395
  metadata = {'ocp_version': self._oc.get_ocp_server_version(),
395
396
  'previous_ocp_version': self._oc.get_previous_ocp_version() if self._upgrade_ocp_version else '',
396
397
  'cnv_version': self._oc.get_cnv_version(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: benchmark-runner
3
- Version: 1.0.739
3
+ Version: 1.0.741
4
4
  Summary: Benchmark Runner Tool
5
5
  Home-page: https://github.com/redhat-performance/benchmark-runner
6
6
  Author: Red Hat
@@ -37,7 +37,7 @@ benchmark_runner/common/elasticsearch/elasticsearch_operations.py,sha256=fXckd9u
37
37
  benchmark_runner/common/github/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  benchmark_runner/common/github/github_operations.py,sha256=wp4zH0_4Qzb_c-GtQlP3VnN374H0aa_icGPk0pwkAZc,1111
39
39
  benchmark_runner/common/google_drive/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
- benchmark_runner/common/google_drive/google_drive_operations.py,sha256=PuL7pWKJRTTIwnRPM6XRBNyHe4Hg6g3ee9cYZnKrdJc,15513
40
+ benchmark_runner/common/google_drive/google_drive_operations.py,sha256=V-N9Wgz25lp-7loH9Nxv97dqMYc0NY82x2E8hOpcwcw,16205
41
41
  benchmark_runner/common/grafana/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  benchmark_runner/common/grafana/grafana_operations.py,sha256=Emt-p44OSe_XgVp6c94EVcDEaniyYtUDQMWCGIP0GR8,4877
43
43
  benchmark_runner/common/grafana/update_grafana_latest_value_mappings.py,sha256=aBKXx1spB8O2kjVsOl5heLl5lKcU07Hx8oHJLasJpSQ,5523
@@ -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=-ta6Z9H4D0GMX2mNt83M_j6Lr3u_7CgeBB2I_PyQcDs,67742
49
+ benchmark_runner/common/oc/oc.py,sha256=8dVYHOhg8dLN-zBxgFSLA5N-V86HIW3YT_Je1eNajwg,67895
50
50
  benchmark_runner/common/oc/oc_exceptions.py,sha256=4JDebyFqe6yIN6Y70E-oscWnme0t7Ggg_CJBBoOuFPs,6336
51
51
  benchmark_runner/common/ocp_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  benchmark_runner/common/ocp_resources/create_cnv.py,sha256=AXsyR8_g_RIFHz2rkyHzzvvUDIiGdOi9rZWJPhiPzDQ,3511
@@ -165,15 +165,15 @@ benchmark_runner/main/environment_variables_exceptions.py,sha256=UR0Ith0P0oshsDZ
165
165
  benchmark_runner/main/main.py,sha256=SB-rD4U_978gP8ojGUtIsYzhSsmzeEDsUfOiJQJdz9c,14097
166
166
  benchmark_runner/main/temporary_environment_variables.py,sha256=ODSHkfhgvdr_b2e3XyvykW21MVjSdyqimREyMc2klRE,957
167
167
  benchmark_runner/workloads/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
168
- benchmark_runner/workloads/bootstorm_vm.py,sha256=1dOThOr4QUptjHg-fV4_-T-0TpriyBvO6As94mLKMtU,18511
168
+ benchmark_runner/workloads/bootstorm_vm.py,sha256=gQcAhsu-5aWp55JqzgLUskCZGZrX53KXoE_Cz2O-6HA,18606
169
169
  benchmark_runner/workloads/vdbench_pod.py,sha256=OcmxVr5QlbkhAgY37wsZ7xJUjs9HI-qMVDex1HdL2P0,9778
170
170
  benchmark_runner/workloads/vdbench_vm.py,sha256=Yhoz-GbvZwA8q6qGIeSUsYhEIERj8SmJB1yjetwsGow,9449
171
171
  benchmark_runner/workloads/windows_vm.py,sha256=eHK79ueAkSlNC1uamz19o7CO20wzJi-UIqRuTByTVxg,2373
172
172
  benchmark_runner/workloads/workloads.py,sha256=F9fnk4h715tq7ANSCbDH0jktB8fpr_u3YG61Kdi5_os,1422
173
173
  benchmark_runner/workloads/workloads_exceptions.py,sha256=u7VII95iPRF_YhfpGH1U1RmgiIYESMOtbSF1dz7_ToE,1858
174
- benchmark_runner/workloads/workloads_operations.py,sha256=zhMAL-Zc2JtdI-LG4kxGwbGwHaLY2DfklpzM4bBG-eo,25261
175
- benchmark_runner-1.0.739.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
176
- benchmark_runner-1.0.739.dist-info/METADATA,sha256=PS3AR0_YwzwzhX4uiJV014Xn8eaggLprhFyHgDNSNU0,11498
177
- benchmark_runner-1.0.739.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
178
- benchmark_runner-1.0.739.dist-info/top_level.txt,sha256=MP7UbTCzu59D53uKCZl5VsQeM_vheyMc7FmryczJQbk,17
179
- benchmark_runner-1.0.739.dist-info/RECORD,,
174
+ benchmark_runner/workloads/workloads_operations.py,sha256=SdddQUbAN5biRjZr5CvmlgKxcE4xatCnoSBm9cn1K9A,25286
175
+ benchmark_runner-1.0.741.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
176
+ benchmark_runner-1.0.741.dist-info/METADATA,sha256=CYjJUj8bTiL6JYOjMDsy4FQeULdR3_JDyBeJvunwZJQ,11498
177
+ benchmark_runner-1.0.741.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
178
+ benchmark_runner-1.0.741.dist-info/top_level.txt,sha256=MP7UbTCzu59D53uKCZl5VsQeM_vheyMc7FmryczJQbk,17
179
+ benchmark_runner-1.0.741.dist-info/RECORD,,