Skip to content

Commit

Permalink
In case of unsuccessful cp of module artifacts to remote path, restor…
Browse files Browse the repository at this point in the history
…e the original path (#418)

* In case of unsuccessful cp of module artifacts to remote path, restore the original path

* Removed ansicolors

* Updated Readme to remove outdated requirements

* If the copy was unsuccessful restore path to original basename

* Extra logging in case of missing module elements
  • Loading branch information
filipecosta90 authored May 2, 2023
1 parent 8df9082 commit 557109f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ Current supported benchmark tools:
- [redisgraph-benchmark-go](https://github.com/RedisGraph/redisgraph-benchmark-go)
- [ftsb_redisearch](https://github.com/RediSearch/ftsb)
- [ann-benchmarks](https://github.com/RedisAI/ann-benchmarks)
- [SOON][aibench](https://github.com/RedisAI/aibench)

## Installation

Installation is done using pip, the package installer for Python, in the following manner:

```bash
python3 -m pip install https://codeload.github.com/redis/redis-py/zip/refs/tags/v4.2.0rc3
python3 -m pip install redisbench-admin
```

Expand Down
14 changes: 1 addition & 13 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "redisbench-admin"
version = "0.10.10"
version = "0.10.15"
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 Expand Up @@ -32,7 +32,6 @@ flask-restx = "^0.5.1"
Flask-HTTPAuth = "^4.4.0"
daemonize = "^2.5.0"
pandas = "^1.0"
ansicolors = "^1.1.8"
matplotlib = "^3.1.2"
psutil = "^5.6.6"
Jinja2 = "^3.0.3"
Expand Down
16 changes: 15 additions & 1 deletion redisbench_admin/run_remote/standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,15 @@ def remote_module_files_cp(
for pos, local_module_file_and_plugin in enumerate(
abs_splitted_module_and_plugins, start=1
):
file_basename = os.path.basename(local_module_file_and_plugin)
remote_module_file = "{}/{}".format(
remote_module_file_dir,
os.path.basename(local_module_file_and_plugin),
file_basename,
)
logging.info(
"remote_module_file: {}. basename: {}".format(
remote_module_file, file_basename
)
)
# copy the module to the DB machine
cp_res = copy_file_to_remote_setup(
Expand All @@ -118,6 +124,14 @@ def remote_module_files_cp(
["chmod 755 {}".format(remote_module_file)],
port,
)
else:
# If the copy was unsuccessful restore path to original basename
remote_module_file = file_basename
logging.info(
"Given the copy was unsuccessful restore path to original basename: {}.".format(
remote_module_file
)
)
if pos > 1:
remote_module_files_in = remote_module_files_in + " "
remote_module_files_in = remote_module_files_in + remote_module_file
Expand Down
11 changes: 8 additions & 3 deletions redisbench_admin/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@ def redis_server_config_module_part(
splitted_module_and_plugins
)
)
abs_splitted_module_and_plugins = [
os.path.abspath(x) for x in splitted_module_and_plugins
]

abs_splitted_module_and_plugins = []
for x in splitted_module_and_plugins:
if os.path.exists(os.path.abspath(x)):
abs_splitted_module_and_plugins.append(os.path.abspath(x))
else:
abs_splitted_module_and_plugins.append(x)

command.append("--loadmodule")
command.extend(abs_splitted_module_and_plugins)
for (
Expand Down

0 comments on commit 557109f

Please sign in to comment.