Skip to content

Commit

Permalink
Detect module plugins (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipecosta90 authored Mar 15, 2023
1 parent 8d65eeb commit e86f0c2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 28 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.5"
version = "0.10.6"
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
61 changes: 40 additions & 21 deletions redisbench_admin/run_remote/standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,46 @@ def remote_module_files_cp(
remote_module_files = []
if local_module_files is not None:
for local_module_file in local_module_files:
remote_module_file = "{}/{}".format(
remote_module_file_dir, os.path.basename(local_module_file)
)
# copy the module to the DB machine
copy_file_to_remote_setup(
server_public_ip,
username,
private_key,
local_module_file,
remote_module_file,
None,
port,
)
execute_remote_commands(
server_public_ip,
username,
private_key,
["chmod 755 {}".format(remote_module_file)],
port,
)
remote_module_files.append(remote_module_file)

splitted_module_and_plugins = local_module_file.split(" ")
if len(splitted_module_and_plugins) > 1:
logging.info(
"Detected a module and plugin(s) pairs {}".format(
splitted_module_and_plugins
)
)
abs_splitted_module_and_plugins = [
os.path.abspath(x) for x in splitted_module_and_plugins
]
remote_module_files_in = ""
for pos, local_module_file_and_plugin in enumerate(
abs_splitted_module_and_plugins, start=1
):
remote_module_file = "{}/{}".format(
remote_module_file_dir,
os.path.basename(local_module_file_and_plugin),
)
# copy the module to the DB machine
copy_file_to_remote_setup(
server_public_ip,
username,
private_key,
local_module_file_and_plugin,
remote_module_file,
None,
port,
)
execute_remote_commands(
server_public_ip,
username,
private_key,
["chmod 755 {}".format(remote_module_file)],
port,
)
if pos > 1:
remote_module_files_in = remote_module_files_in + " "
remote_module_files_in = remote_module_files_in + remote_module_file
remote_module_files.append(remote_module_files_in)
return remote_module_files


Expand Down
19 changes: 13 additions & 6 deletions redisbench_admin/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,19 @@
def redis_server_config_module_part(
command, local_module_file, modules_configuration_parameters_map
):
command.extend(
[
"--loadmodule",
os.path.abspath(local_module_file),
]
)
# in the case of modules with plugins we split by space
splitted_module_and_plugins = local_module_file.split(" ")
if len(splitted_module_and_plugins) > 1:
logging.info(
"Detected a module and plugin(s) pairs {}".format(
splitted_module_and_plugins
)
)
abs_splitted_module_and_plugins = [
os.path.abspath(x) for x in splitted_module_and_plugins
]
command.append("--loadmodule")
command.extend(abs_splitted_module_and_plugins)
for (
module_config_modulename,
module_config_dict,
Expand Down

0 comments on commit e86f0c2

Please sign in to comment.