Skip to content

Commit

Permalink
Fixed multi files related to same module on remote-run (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipecosta90 authored Mar 28, 2023
1 parent 55162ba commit 7ea8c03
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "redisbench-admin"
version = "0.10.7"
version = "0.10.8"
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
authors = ["filipecosta90 <filipecosta.90@gmail.com>","Redis Performance Group <performance@redis.com>"]
readme = "README.md"
Expand Down
43 changes: 30 additions & 13 deletions redisbench_admin/run/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,36 @@ def redis_modules_check(local_module_files):
"Using the following module artifacts: {}".format(local_module_files)
)
for local_module_file in local_module_files:
logging.info(
"Checking if module artifact {} exists...".format(local_module_file)
)
if os.path.exists(local_module_file) is False:
error_message = "Specified module artifact does not exist: {}".format(
local_module_file
)
logging.error(error_message)
status = False
else:
if type(local_module_file) is str:
logging.info(
"Confirmed that module artifact: '{}' exists!".format(
local_module_file
)
"Checking if module artifact {} exists...".format(local_module_file)
)
error_message, status = exists_check(
error_message, local_module_file, status
)
if type(local_module_file) is list:
for inner_local_module_file in local_module_file:
logging.info(
"Checking if module artifact {} exists...".format(
inner_local_module_file
)
)
error_message, status = exists_check(
error_message, inner_local_module_file, status
)

return status, error_message


def exists_check(error_message, local_module_file, status):
if os.path.exists(local_module_file) is False:
error_message = "Specified module artifact does not exist: {}".format(
local_module_file
)
logging.error(error_message)
status = False
else:
logging.info(
"Confirmed that module artifact: '{}' exists!".format(local_module_file)
)
return error_message, status
6 changes: 6 additions & 0 deletions redisbench_admin/run_remote/run_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ def run_remote_command_logic(args, project_name, project_version):
tf_setup_name_sufix = "{}-{}".format(args.setup_name_sufix, tf_github_sha)
s3_bucket_name = args.s3_bucket_name
local_module_files = args.module_path
for pos, module_file in enumerate(local_module_files):
if " " in module_file:
logging.info(
"Detected multiple files in single module path {}".format(module_file)
)
local_module_files[pos] = module_file.split(" ")
dbdir_folder = args.dbdir_folder
private_key = args.private_key
grafana_profile_dashboard = args.grafana_profile_dashboard
Expand Down
6 changes: 5 additions & 1 deletion redisbench_admin/run_remote/standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ def remote_module_files_cp(
remote_module_files = []
if local_module_files is not None:
for local_module_file in local_module_files:
splitted_module_and_plugins = local_module_file.split(" ")
splitted_module_and_plugins = []
if type(local_module_file) is str:
splitted_module_and_plugins = local_module_file.split(" ")
if type(local_module_file) is list:
splitted_module_and_plugins = local_module_file
if len(splitted_module_and_plugins) > 1:
logging.info(
"Detected a module and plugin(s) pairs {}".format(
Expand Down

0 comments on commit 7ea8c03

Please sign in to comment.