Skip to content

Commit 7ea8c03

Browse files
Fixed multi files related to same module on remote-run (#412)
1 parent 55162ba commit 7ea8c03

File tree

4 files changed

+42
-15
lines changed

4 files changed

+42
-15
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisbench-admin"
3-
version = "0.10.7"
3+
version = "0.10.8"
44
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
55
authors = ["filipecosta90 <[email protected]>","Redis Performance Group <[email protected]>"]
66
readme = "README.md"

redisbench_admin/run/modules.py

+30-13
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,36 @@ def redis_modules_check(local_module_files):
1515
"Using the following module artifacts: {}".format(local_module_files)
1616
)
1717
for local_module_file in local_module_files:
18-
logging.info(
19-
"Checking if module artifact {} exists...".format(local_module_file)
20-
)
21-
if os.path.exists(local_module_file) is False:
22-
error_message = "Specified module artifact does not exist: {}".format(
23-
local_module_file
24-
)
25-
logging.error(error_message)
26-
status = False
27-
else:
18+
if type(local_module_file) is str:
2819
logging.info(
29-
"Confirmed that module artifact: '{}' exists!".format(
30-
local_module_file
31-
)
20+
"Checking if module artifact {} exists...".format(local_module_file)
21+
)
22+
error_message, status = exists_check(
23+
error_message, local_module_file, status
3224
)
25+
if type(local_module_file) is list:
26+
for inner_local_module_file in local_module_file:
27+
logging.info(
28+
"Checking if module artifact {} exists...".format(
29+
inner_local_module_file
30+
)
31+
)
32+
error_message, status = exists_check(
33+
error_message, inner_local_module_file, status
34+
)
35+
3336
return status, error_message
37+
38+
39+
def exists_check(error_message, local_module_file, status):
40+
if os.path.exists(local_module_file) is False:
41+
error_message = "Specified module artifact does not exist: {}".format(
42+
local_module_file
43+
)
44+
logging.error(error_message)
45+
status = False
46+
else:
47+
logging.info(
48+
"Confirmed that module artifact: '{}' exists!".format(local_module_file)
49+
)
50+
return error_message, status

redisbench_admin/run_remote/run_remote.py

+6
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ def run_remote_command_logic(args, project_name, project_version):
121121
tf_setup_name_sufix = "{}-{}".format(args.setup_name_sufix, tf_github_sha)
122122
s3_bucket_name = args.s3_bucket_name
123123
local_module_files = args.module_path
124+
for pos, module_file in enumerate(local_module_files):
125+
if " " in module_file:
126+
logging.info(
127+
"Detected multiple files in single module path {}".format(module_file)
128+
)
129+
local_module_files[pos] = module_file.split(" ")
124130
dbdir_folder = args.dbdir_folder
125131
private_key = args.private_key
126132
grafana_profile_dashboard = args.grafana_profile_dashboard

redisbench_admin/run_remote/standalone.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ def remote_module_files_cp(
7676
remote_module_files = []
7777
if local_module_files is not None:
7878
for local_module_file in local_module_files:
79-
splitted_module_and_plugins = local_module_file.split(" ")
79+
splitted_module_and_plugins = []
80+
if type(local_module_file) is str:
81+
splitted_module_and_plugins = local_module_file.split(" ")
82+
if type(local_module_file) is list:
83+
splitted_module_and_plugins = local_module_file
8084
if len(splitted_module_and_plugins) > 1:
8185
logging.info(
8286
"Detected a module and plugin(s) pairs {}".format(

0 commit comments

Comments
 (0)