diff --git a/pyproject.toml b/pyproject.toml index eb7d557..f91c2cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 ","Redis Performance Group "] readme = "README.md" diff --git a/redisbench_admin/run_remote/standalone.py b/redisbench_admin/run_remote/standalone.py index 9b24e49..1e7cea4 100644 --- a/redisbench_admin/run_remote/standalone.py +++ b/redisbench_admin/run_remote/standalone.py @@ -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 diff --git a/redisbench_admin/utils/utils.py b/redisbench_admin/utils/utils.py index d6ac98c..4cd44be 100644 --- a/redisbench_admin/utils/utils.py +++ b/redisbench_admin/utils/utils.py @@ -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,