Skip to content

Commit 8df9082

Browse files
Allow to skip module artifact check/errors (#417)
1 parent 4960bf0 commit 8df9082

File tree

5 files changed

+61
-26
lines changed

5 files changed

+61
-26
lines changed

Diff for: redisbench_admin/run_remote/args.py

+6
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,11 @@ def create_run_remote_arguments(parser):
119119
action="store_true",
120120
help="skip environment variables check",
121121
)
122+
parser.add_argument(
123+
"--continue-on-module-check-error",
124+
default=False,
125+
action="store_true",
126+
help="Continue running benchmarks even if module check failed",
127+
)
122128

123129
return parser

Diff for: redisbench_admin/run_remote/remote_db.py

+7
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def remote_db_spin(
102102
redis_password=None,
103103
flushall_on_every_test_start=False,
104104
ignore_keyspace_errors=False,
105+
continue_on_module_check_error=False,
105106
):
106107
(
107108
_,
@@ -131,6 +132,7 @@ def remote_db_spin(
131132
remote_module_file_dir,
132133
server_public_ip,
133134
username,
135+
continue_on_module_check_error,
134136
)
135137
# setup Redis
136138
redis_setup_result = True
@@ -229,6 +231,11 @@ def remote_db_spin(
229231
True,
230232
username,
231233
)
234+
raise Exception(
235+
"A error occurred while spinning DB: {}. Aborting...".format(
236+
e.__str__()
237+
)
238+
)
232239

233240
if cluster_enabled and skip_redis_setup is False:
234241
setup_redis_cluster_from_conns(

Diff for: redisbench_admin/run_remote/run_remote.py

+21-12
Original file line numberDiff line numberDiff line change
@@ -178,21 +178,29 @@ def run_remote_command_logic(args, project_name, project_version):
178178
logging.critical("{}. Exiting right away!".format(failure_reason))
179179
exit(1)
180180

181+
continue_on_module_check_error = args.continue_on_module_check_error
181182
module_check_status, error_message = redis_modules_check(local_module_files)
182183
if module_check_status is False:
183-
if webhook_notifications_active:
184-
failure_reason = error_message
185-
generate_failure_notification(
186-
webhook_client_slack,
187-
ci_job_name,
188-
ci_job_link,
189-
failure_reason,
190-
tf_github_org,
191-
tf_github_repo,
192-
tf_github_branch,
193-
None,
184+
if continue_on_module_check_error is False:
185+
if webhook_notifications_active:
186+
failure_reason = error_message
187+
generate_failure_notification(
188+
webhook_client_slack,
189+
ci_job_name,
190+
ci_job_link,
191+
failure_reason,
192+
tf_github_org,
193+
tf_github_repo,
194+
tf_github_branch,
195+
None,
196+
)
197+
exit(1)
198+
else:
199+
logging.error(
200+
"the module check failed with the following message {} but you've decided to continue anyway.".format(
201+
error_message
202+
)
194203
)
195-
exit(1)
196204

197205
common_properties_log(
198206
tf_bin_path,
@@ -505,6 +513,7 @@ def run_remote_command_logic(args, project_name, project_version):
505513
redis_password,
506514
flushall_on_every_test_start,
507515
ignore_keyspace_errors,
516+
continue_on_module_check_error,
508517
)
509518
if benchmark_type == "read-only":
510519
ro_benchmark_set(

Diff for: redisbench_admin/run_remote/standalone.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def remote_module_files_cp(
7272
remote_module_file_dir,
7373
server_public_ip,
7474
username,
75+
continue_on_module_check_error=False,
7576
):
7677
remote_module_files = []
7778
if local_module_files is not None:
@@ -99,22 +100,24 @@ def remote_module_files_cp(
99100
os.path.basename(local_module_file_and_plugin),
100101
)
101102
# copy the module to the DB machine
102-
copy_file_to_remote_setup(
103+
cp_res = copy_file_to_remote_setup(
103104
server_public_ip,
104105
username,
105106
private_key,
106107
local_module_file_and_plugin,
107108
remote_module_file,
108109
None,
109110
port,
111+
continue_on_module_check_error,
110112
)
111-
execute_remote_commands(
112-
server_public_ip,
113-
username,
114-
private_key,
115-
["chmod 755 {}".format(remote_module_file)],
116-
port,
117-
)
113+
if cp_res:
114+
execute_remote_commands(
115+
server_public_ip,
116+
username,
117+
private_key,
118+
["chmod 755 {}".format(remote_module_file)],
119+
port,
120+
)
118121
if pos > 1:
119122
remote_module_files_in = remote_module_files_in + " "
120123
remote_module_files_in = remote_module_files_in + remote_module_file

Diff for: redisbench_admin/utils/remote.py

+16-6
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ def copy_file_to_remote_setup(
6363
remote_file,
6464
dirname=None,
6565
port=22,
66+
continue_on_module_check_error=False,
6667
):
6768
full_local_path = local_file
69+
res = False
6870
if dirname is not None:
6971
full_local_path = "{}/{}".format(dirname, local_file)
7072
logging.info(
@@ -94,12 +96,20 @@ def copy_file_to_remote_setup(
9496
)
9597
res = True
9698
else:
97-
logging.error(
98-
"Local file {} does not exists. aborting...".format(full_local_path)
99-
)
100-
raise Exception(
101-
"Local file {} does not exists. aborting...".format(full_local_path)
102-
)
99+
if continue_on_module_check_error:
100+
logging.warning(
101+
"Continuing running benchmarks after module check failed on file: {}. Full path {}".format(
102+
local_file, full_local_path
103+
)
104+
)
105+
else:
106+
logging.error(
107+
"Local file {} does not exists. aborting...".format(full_local_path)
108+
)
109+
110+
raise Exception(
111+
"Local file {} does not exists. aborting...".format(full_local_path)
112+
)
103113
return res
104114

105115

0 commit comments

Comments
 (0)