Skip to content

Commit 557109f

Browse files
In case of unsuccessful cp of module artifacts to remote path, restore 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
1 parent 8df9082 commit 557109f

File tree

5 files changed

+25
-21
lines changed

5 files changed

+25
-21
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@ Current supported benchmark tools:
2525
- [redisgraph-benchmark-go](https://github.com/RedisGraph/redisgraph-benchmark-go)
2626
- [ftsb_redisearch](https://github.com/RediSearch/ftsb)
2727
- [ann-benchmarks](https://github.com/RedisAI/ann-benchmarks)
28-
- [SOON][aibench](https://github.com/RedisAI/aibench)
2928

3029
## Installation
3130

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

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

poetry.lock

Lines changed: 1 addition & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisbench-admin"
3-
version = "0.10.10"
3+
version = "0.10.15"
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 <filipecosta.90@gmail.com>","Redis Performance Group <performance@redis.com>"]
66
readme = "README.md"
@@ -32,7 +32,6 @@ flask-restx = "^0.5.1"
3232
Flask-HTTPAuth = "^4.4.0"
3333
daemonize = "^2.5.0"
3434
pandas = "^1.0"
35-
ansicolors = "^1.1.8"
3635
matplotlib = "^3.1.2"
3736
psutil = "^5.6.6"
3837
Jinja2 = "^3.0.3"

redisbench_admin/run_remote/standalone.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,15 @@ def remote_module_files_cp(
9595
for pos, local_module_file_and_plugin in enumerate(
9696
abs_splitted_module_and_plugins, start=1
9797
):
98+
file_basename = os.path.basename(local_module_file_and_plugin)
9899
remote_module_file = "{}/{}".format(
99100
remote_module_file_dir,
100-
os.path.basename(local_module_file_and_plugin),
101+
file_basename,
102+
)
103+
logging.info(
104+
"remote_module_file: {}. basename: {}".format(
105+
remote_module_file, file_basename
106+
)
101107
)
102108
# copy the module to the DB machine
103109
cp_res = copy_file_to_remote_setup(
@@ -118,6 +124,14 @@ def remote_module_files_cp(
118124
["chmod 755 {}".format(remote_module_file)],
119125
port,
120126
)
127+
else:
128+
# If the copy was unsuccessful restore path to original basename
129+
remote_module_file = file_basename
130+
logging.info(
131+
"Given the copy was unsuccessful restore path to original basename: {}.".format(
132+
remote_module_file
133+
)
134+
)
121135
if pos > 1:
122136
remote_module_files_in = remote_module_files_in + " "
123137
remote_module_files_in = remote_module_files_in + remote_module_file

redisbench_admin/utils/utils.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ def redis_server_config_module_part(
3636
splitted_module_and_plugins
3737
)
3838
)
39-
abs_splitted_module_and_plugins = [
40-
os.path.abspath(x) for x in splitted_module_and_plugins
41-
]
39+
40+
abs_splitted_module_and_plugins = []
41+
for x in splitted_module_and_plugins:
42+
if os.path.exists(os.path.abspath(x)):
43+
abs_splitted_module_and_plugins.append(os.path.abspath(x))
44+
else:
45+
abs_splitted_module_and_plugins.append(x)
46+
4247
command.append("--loadmodule")
4348
command.extend(abs_splitted_module_and_plugins)
4449
for (

0 commit comments

Comments
 (0)