benchmark-runner 1.0.703__py3-none-any.whl → 1.0.705__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/google_drive/google_drive_operations.py +12 -21
- benchmark_runner/common/template_operations/templates/hammerdb/internal_data/hammerdb_pod_template.yaml +1 -1
- benchmark_runner/main/environment_variables.py +3 -3
- benchmark_runner/workloads/workloads_operations.py +4 -4
- {benchmark_runner-1.0.703.dist-info → benchmark_runner-1.0.705.dist-info}/METADATA +1 -1
- {benchmark_runner-1.0.703.dist-info → benchmark_runner-1.0.705.dist-info}/RECORD +9 -9
- {benchmark_runner-1.0.703.dist-info → benchmark_runner-1.0.705.dist-info}/LICENSE +0 -0
- {benchmark_runner-1.0.703.dist-info → benchmark_runner-1.0.705.dist-info}/WHEEL +0 -0
- {benchmark_runner-1.0.703.dist-info → benchmark_runner-1.0.705.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
import os
|
|
3
|
-
import json
|
|
4
3
|
|
|
5
4
|
from googleapiclient.discovery import build
|
|
6
5
|
from google.oauth2.credentials import Credentials
|
|
@@ -20,40 +19,32 @@ class GoogleDriveOperations:
|
|
|
20
19
|
1. credentials.json - Obtain from the "Google Cloud Console" under "APIs & Services" > "Credentials" > "Create Credentials" and select "OAuth 2.0 Client ID".
|
|
21
20
|
2. token.json - This is generated automatically. If a browser is not available, copy the token from a machine with a browser.
|
|
22
21
|
"""
|
|
23
|
-
def __init__(self, google_drive_path: str,
|
|
22
|
+
def __init__(self, google_drive_path: str, google_drive_token_file: str, google_drive_credentials_file: str, google_drive_shared_drive_id: str):
|
|
24
23
|
"""
|
|
25
24
|
Initializes GoogleDriveOperations with authentication.
|
|
26
25
|
"""
|
|
27
|
-
self.
|
|
28
|
-
self._google_drive_credentials =
|
|
29
|
-
self._google_drive_token = google_drive_token
|
|
26
|
+
self._google_drive_token = google_drive_token_file # Read token from file
|
|
27
|
+
self._google_drive_credentials = google_drive_credentials_file # Read credentials from file
|
|
30
28
|
self._google_drive_shared_drive_id = google_drive_shared_drive_id
|
|
29
|
+
self._google_drive_path = google_drive_path
|
|
31
30
|
self.creds = self.authenticate()
|
|
32
31
|
self.service = build('drive', 'v3', credentials=self.creds)
|
|
33
32
|
|
|
34
33
|
def authenticate(self):
|
|
35
|
-
"""
|
|
36
|
-
Authenticates and returns credentials using token or interactive login.
|
|
37
|
-
:return: Credentials object
|
|
38
|
-
"""
|
|
39
34
|
creds = None
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
# Check if the credentials are invalid or expired
|
|
35
|
+
# Load credentials from token.json if it exists
|
|
36
|
+
if os.path.exists(self._google_drive_token):
|
|
37
|
+
creds = Credentials.from_authorized_user_file(self._google_drive_token, SCOPES)
|
|
38
|
+
# If credentials are not valid or do not exist, authenticate
|
|
46
39
|
if not creds or not creds.valid:
|
|
47
40
|
if creds and creds.expired and creds.refresh_token:
|
|
48
41
|
creds.refresh(Request())
|
|
49
42
|
else:
|
|
50
|
-
|
|
51
|
-
flow = InstalledAppFlow.from_client_config(json.loads(self._google_drive_credentials), SCOPES)
|
|
43
|
+
flow = InstalledAppFlow.from_client_secrets_file(self._google_drive_credentials, SCOPES)
|
|
52
44
|
creds = flow.run_local_server(port=0)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
# Save the credentials for the next run
|
|
46
|
+
with open(self._google_drive_credentials, 'w') as token_file:
|
|
47
|
+
token_file.write(creds.to_json())
|
|
57
48
|
return creds
|
|
58
49
|
|
|
59
50
|
def list_folders_and_files_in_shared_drive(self, shared_drive_id):
|
|
@@ -21,8 +21,8 @@ spec:
|
|
|
21
21
|
args:
|
|
22
22
|
{%- if kind == 'kata' %}
|
|
23
23
|
runtime_class: kata
|
|
24
|
-
job_timeout: 5400
|
|
25
24
|
{%- endif %}
|
|
25
|
+
job_timeout: {{ timeout }}
|
|
26
26
|
pin: {{ pin }} # enable for nodeSelector
|
|
27
27
|
pin_node: "{{ pin_node1 }}"
|
|
28
28
|
resources: {{ resources }} # enable for resources requests/limits
|
|
@@ -208,10 +208,10 @@ class EnvironmentVariables:
|
|
|
208
208
|
self._environment_variables_dict['bucket'] = EnvironmentVariables.get_env('IBM_BUCKET', '')
|
|
209
209
|
self._environment_variables_dict['key'] = EnvironmentVariables.get_env('IBM_KEY', '')
|
|
210
210
|
|
|
211
|
-
# Google drive
|
|
211
|
+
# Google drive, use file for credentials (jenkins limitation)
|
|
212
212
|
self._environment_variables_dict['google_drive_path'] = EnvironmentVariables.get_env('GOOGLE_DRIVE_PATH', '')
|
|
213
|
-
self._environment_variables_dict['
|
|
214
|
-
self._environment_variables_dict['
|
|
213
|
+
self._environment_variables_dict['google_drive_credentials_file'] = EnvironmentVariables.get_env('GOOGLE_DRIVE_CREDENTIALS_FILE', '')
|
|
214
|
+
self._environment_variables_dict['google_drive_token_file'] = EnvironmentVariables.get_env('GOOGLE_DRIVE_TOKEN_FILE', '')
|
|
215
215
|
self._environment_variables_dict['google_drive_shared_drive_id'] = EnvironmentVariables.get_env('GOOGLE_DRIVE_SHARED_DRIVE_ID', '')
|
|
216
216
|
|
|
217
217
|
# Grafana
|
|
@@ -110,13 +110,13 @@ class WorkloadsOperations:
|
|
|
110
110
|
self._windows_os = os.path.splitext(file_name)[0]
|
|
111
111
|
# google drive
|
|
112
112
|
self._google_drive_path = self._environment_variables_dict.get('google_drive_path', '')
|
|
113
|
-
self.
|
|
114
|
-
self.
|
|
113
|
+
self._google_drive_credentials_file = self._environment_variables_dict.get('google_drive_credentials_file', '')
|
|
114
|
+
self._google_drive_token_file = self._environment_variables_dict.get('google_drive_token_file', '')
|
|
115
115
|
self._google_drive_shared_drive_id = self._environment_variables_dict.get('google_drive_shared_drive_id', '')
|
|
116
116
|
if self._google_drive_path:
|
|
117
117
|
self._google_drive_operation = GoogleDriveOperations(google_drive_path=self._google_drive_path,
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
google_drive_credentials_file=self._google_drive_credentials_file,
|
|
119
|
+
google_drive_token_file=self._google_drive_token_file,
|
|
120
120
|
google_drive_shared_drive_id=self._google_drive_shared_drive_id)
|
|
121
121
|
self._upgrade_ocp_version = self._environment_variables_dict.get('upgrade_ocp_version', '')
|
|
122
122
|
self._run_strategy = self._environment_variables_dict.get('run_strategy', '')
|
|
@@ -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=
|
|
40
|
+
benchmark_runner/common/google_drive/google_drive_operations.py,sha256=PuL7pWKJRTTIwnRPM6XRBNyHe4Hg6g3ee9cYZnKrdJc,15513
|
|
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
|
|
@@ -104,7 +104,7 @@ benchmark_runner/common/template_operations/templates/namespace_template.yaml,sh
|
|
|
104
104
|
benchmark_runner/common/template_operations/templates/bootstorm/bootstorm_data_template.yaml,sha256=QYXTxA9CdS_B3QXR5zw23h7HSVpIj8NdudwvB1Q6508,463
|
|
105
105
|
benchmark_runner/common/template_operations/templates/bootstorm/internal_data/bootstorm_vm_template.yaml,sha256=GqDUFlx9nJhQ4TlGTAHw7YjUsmMe5VY9Rk3kIziamPg,1421
|
|
106
106
|
benchmark_runner/common/template_operations/templates/hammerdb/hammerdb_data_template.yaml,sha256=DGwes_qSSCkM8R1nAQa1Robx_Mt7_qBbL-g3stZ-ZxM,1905
|
|
107
|
-
benchmark_runner/common/template_operations/templates/hammerdb/internal_data/hammerdb_pod_template.yaml,sha256=
|
|
107
|
+
benchmark_runner/common/template_operations/templates/hammerdb/internal_data/hammerdb_pod_template.yaml,sha256=jR120-MnuXBQqm7gHf7-VeaYuwy27mHMpteeifYIYs8,2517
|
|
108
108
|
benchmark_runner/common/template_operations/templates/hammerdb/internal_data/hammerdb_vm_template.yaml,sha256=oqU1aH-b5RBBuxoHiXLtrJLYpsIPqc7x67Ko7HzYfeA,4208
|
|
109
109
|
benchmark_runner/common/template_operations/templates/hammerdb/internal_data/mariadb_template.yaml,sha256=nkbtSCrtvYquV_MLk7aR7yhmUF43Ywvbm70Ia0t3Gak,4455
|
|
110
110
|
benchmark_runner/common/template_operations/templates/hammerdb/internal_data/mssql_template.yaml,sha256=WBsu9tvtcsHxyysiq_x6T4b3NOj8fAfrCWv1yybjvXo,3638
|
|
@@ -158,7 +158,7 @@ benchmark_runner/krkn_hub/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
|
158
158
|
benchmark_runner/krkn_hub/krknhub_exceptions.py,sha256=Hk7Co6zZ0u2RSmBmS4ZAi21ffZaQ2ITTfl6tGLtiAdY,180
|
|
159
159
|
benchmark_runner/krkn_hub/krknhub_workloads.py,sha256=qNRZA-FBQZiT6h013WbP6zBRINh3c6YMnnlksN9fssA,2851
|
|
160
160
|
benchmark_runner/main/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
161
|
-
benchmark_runner/main/environment_variables.py,sha256
|
|
161
|
+
benchmark_runner/main/environment_variables.py,sha256=-4ZJCC6lHmv777xXp_0W4X7KAbZZ183N9qwoFyBVhCQ,27974
|
|
162
162
|
benchmark_runner/main/environment_variables_exceptions.py,sha256=UR0Ith0P0oshsDZdJRlRq8ZUTt0h8jFvUtrnP4m4AIY,437
|
|
163
163
|
benchmark_runner/main/main.py,sha256=SB-rD4U_978gP8ojGUtIsYzhSsmzeEDsUfOiJQJdz9c,14097
|
|
164
164
|
benchmark_runner/main/temporary_environment_variables.py,sha256=ODSHkfhgvdr_b2e3XyvykW21MVjSdyqimREyMc2klRE,957
|
|
@@ -169,9 +169,9 @@ benchmark_runner/workloads/vdbench_vm.py,sha256=Yhoz-GbvZwA8q6qGIeSUsYhEIERj8SmJ
|
|
|
169
169
|
benchmark_runner/workloads/windows_vm.py,sha256=eHK79ueAkSlNC1uamz19o7CO20wzJi-UIqRuTByTVxg,2373
|
|
170
170
|
benchmark_runner/workloads/workloads.py,sha256=F9fnk4h715tq7ANSCbDH0jktB8fpr_u3YG61Kdi5_os,1422
|
|
171
171
|
benchmark_runner/workloads/workloads_exceptions.py,sha256=u7VII95iPRF_YhfpGH1U1RmgiIYESMOtbSF1dz7_ToE,1858
|
|
172
|
-
benchmark_runner/workloads/workloads_operations.py,sha256=
|
|
173
|
-
benchmark_runner-1.0.
|
|
174
|
-
benchmark_runner-1.0.
|
|
175
|
-
benchmark_runner-1.0.
|
|
176
|
-
benchmark_runner-1.0.
|
|
177
|
-
benchmark_runner-1.0.
|
|
172
|
+
benchmark_runner/workloads/workloads_operations.py,sha256=zhMAL-Zc2JtdI-LG4kxGwbGwHaLY2DfklpzM4bBG-eo,25261
|
|
173
|
+
benchmark_runner-1.0.705.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
174
|
+
benchmark_runner-1.0.705.dist-info/METADATA,sha256=2hD_shu1s82cOZQqHt7GWbscmnY118fdL71fY3NWP-o,11309
|
|
175
|
+
benchmark_runner-1.0.705.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
176
|
+
benchmark_runner-1.0.705.dist-info/top_level.txt,sha256=MP7UbTCzu59D53uKCZl5VsQeM_vheyMc7FmryczJQbk,17
|
|
177
|
+
benchmark_runner-1.0.705.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|