Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.11.26"
version = "0.11.32"
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
authors = ["filipecosta90 <[email protected]>","Redis Performance Group <[email protected]>"]
readme = "README.md"
Expand Down
1 change: 1 addition & 0 deletions redisbench_admin/compare/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def compare_command_logic(args, project_name, project_version):
port=args.redistimeseries_port,
password=args.redistimeseries_pass,
username=args.redistimeseries_user,
retry_on_timeout=True,
)
rts.ping()
default_baseline_branch = None
Expand Down
1 change: 1 addition & 0 deletions redisbench_admin/export/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def export_command_logic(args, project_name, project_version):
host=args.redistimeseries_host,
port=args.redistimeseries_port,
password=args.redistimeseries_pass,
retry_on_timeout=True,
)
try:
rts.ping()
Expand Down
8 changes: 6 additions & 2 deletions redisbench_admin/run/ftsb/ftsb.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,16 @@


def extract_ftsb_extra_links(
benchmark_config, benchmark_tool, config_key="clientconfig"
benchmark_config, benchmark_tool, config_key="clientconfig", architecture="x86_64"
):
remote_tool_link = "/tmp/{}".format(benchmark_tool)
arch_txt = "amd64"
if architecture == "aarch64":
arch_txt = "arm64"

Check warning on line 63 in redisbench_admin/run/ftsb/ftsb.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/run/ftsb/ftsb.py#L61-L63

Added lines #L61 - L63 were not covered by tests

tool_link = (
"https://s3.amazonaws.com/benchmarks.redislabs/"
+ "redisearch/tools/ftsb/{}_linux_amd64".format(benchmark_tool)
+ f"redisearch/tools/ftsb/{benchmark_tool}_linux_{arch_txt}"
)
queries_file_link = None
for entry in benchmark_config[config_key]:
Expand Down
2 changes: 1 addition & 1 deletion redisbench_admin/run/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def define_benchmark_plan(benchmark_definitions, default_specs):
logging.info(f"FINAL DB CONFIG: {final_db_config}")
test_benchmark_config["dbconfig"] = final_db_config

logging.info(
logging.debug(
f"final benchmark config for setup: {setup_name} and test: {test_name}. {test_benchmark_config}"
)
# add benchmark
Expand Down
1 change: 1 addition & 0 deletions redisbench_admin/run_local/run_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def run_local_command_logic(args, project_name, project_version):
host=args.redistimeseries_host,
port=args.redistimeseries_port,
password=args.redistimeseries_pass,
retry_on_timeout=True,
)
rts.ping()

Expand Down
2 changes: 2 additions & 0 deletions redisbench_admin/run_remote/remote_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def run_remote_client_tool(
redis_conns=[],
do_post_process=True,
redis_password=None,
architecture="x86_64",
):
(
benchmark_min_tool_version,
Expand Down Expand Up @@ -83,6 +84,7 @@ def run_remote_client_tool(
arch_str,
client_ssh_port,
private_key,
architecture,
)
if "ann-benchmarks" in benchmark_tool:
logging.info(
Expand Down
3 changes: 3 additions & 0 deletions redisbench_admin/run_remote/remote_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
ignore_keyspace_errors=False,
continue_on_module_check_error=False,
keyspace_check_timeout=60,
architecture="x86_64",
):
(
_,
Expand Down Expand Up @@ -135,6 +136,7 @@
username,
continue_on_module_check_error,
)
logging.info(f"final remote module files {remote_module_files}...")

Check warning on line 139 in redisbench_admin/run_remote/remote_db.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/run_remote/remote_db.py#L139

Added line #L139 was not covered by tests
# setup Redis
redis_setup_result = True
redis_conns = []
Expand Down Expand Up @@ -337,6 +339,7 @@
[],
False,
redis_password,
architecture,
)
logging.info(
"Finished loading the data via client tool. Took {} seconds. Result={}".format(
Expand Down
9 changes: 7 additions & 2 deletions redisbench_admin/run_remote/remote_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@
arch_str,
client_ssh_port,
private_key,
architecture="x86_64",
):
logging.info("Settting up remote tool {} requirements".format(benchmark_tool))
logging.info(

Check warning on line 71 in redisbench_admin/run_remote/remote_helpers.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/run_remote/remote_helpers.py#L71

Added line #L71 was not covered by tests
f"Settting up remote tool {benchmark_tool} requirements. architecture ={architecture}"
)
if benchmark_tool == "redisgraph-benchmark-go":
setup_remote_benchmark_tool_redisgraph_benchmark_go(
client_public_ip,
Expand All @@ -90,7 +93,9 @@
queries_file_link,
remote_tool_link,
tool_link,
) = extract_ftsb_extra_links(benchmark_config, benchmark_tool, config_key)
) = extract_ftsb_extra_links(
benchmark_config, benchmark_tool, config_key, architecture
)
logging.info(
"FTSB Extracted:\nremote tool input: {}\nremote tool link: {}\ntool path: {}".format(
queries_file_link, remote_tool_link, tool_link
Expand Down
4 changes: 4 additions & 0 deletions redisbench_admin/run_remote/run_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ def run_remote_command_logic(args, project_name, project_version):
host=args.redistimeseries_host,
port=args.redistimeseries_port,
password=args.redistimeseries_pass,
retry_on_timeout=True,
)
rts.ping()

Expand Down Expand Up @@ -553,6 +554,8 @@ def run_remote_command_logic(args, project_name, project_version):
flushall_on_every_test_start,
ignore_keyspace_errors,
continue_on_module_check_error,
60,
architecture,
)
if benchmark_type == "read-only":
ro_benchmark_set(
Expand Down Expand Up @@ -698,6 +701,7 @@ def run_remote_command_logic(args, project_name, project_version):
redis_conns,
True,
redis_password,
architecture,
)

if profilers_enabled:
Expand Down
4 changes: 3 additions & 1 deletion redisbench_admin/run_remote/standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@
continue_on_module_check_error=False,
):
remote_module_files = []

if local_module_files is not None:
logging.info(f"there is a total of {len(local_module_files)} modules")

Check warning on line 80 in redisbench_admin/run_remote/standalone.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/run_remote/standalone.py#L80

Added line #L80 was not covered by tests
for local_module_file in local_module_files:
splitted_module_and_plugins = []
if type(local_module_file) is str:
Expand Down Expand Up @@ -135,7 +137,7 @@
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)
remote_module_files.append(remote_module_files_in)

Check warning on line 140 in redisbench_admin/run_remote/standalone.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/run_remote/standalone.py#L140

Added line #L140 was not covered by tests
logging.info(
"There are a total of {} remote files {}".format(
len(remote_module_files), remote_module_files
Expand Down
94 changes: 57 additions & 37 deletions redisbench_admin/utils/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
import sys
import tempfile

import time
import git
import paramiko
import pysftp
Expand Down Expand Up @@ -93,13 +93,22 @@
cnopts=cnopts,
port=port,
)
srv.put(full_local_path, remote_file, callback=view_bar_simple)
srv.close()
if srv.exists(remote_file):
print(f"Remote file {remote_file} already exists. Skipping the copy.")

Check warning on line 97 in redisbench_admin/utils/remote.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/utils/remote.py#L96-L97

Added lines #L96 - L97 were not covered by tests
else:
uploaded_file = srv.put(

Check warning on line 99 in redisbench_admin/utils/remote.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/utils/remote.py#L99

Added line #L99 was not covered by tests
full_local_path, remote_file, callback=view_bar_simple
)
print(f"File uploaded to: {uploaded_file}")

Check warning on line 102 in redisbench_admin/utils/remote.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/utils/remote.py#L102

Added line #L102 was not covered by tests
logging.info(
"Finished Copying file {} to remote server {} ".format(
full_local_path, remote_file
)
)
file_info = srv.stat(remote_file)
print(f"Remote file size: {file_info.st_size} bytes")
print(f"Remote file permissions: {oct(file_info.st_mode)[-3:]}")
srv.close()

Check warning on line 111 in redisbench_admin/utils/remote.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/utils/remote.py#L108-L111

Added lines #L108 - L111 were not covered by tests
res = True
else:
if continue_on_module_check_error:
Expand Down Expand Up @@ -314,6 +323,9 @@
},
raise_on_error=True,
)
infra_wait_secs = 60
logging.warning(f"Infra ready wait... for {infra_wait_secs} secs")
time.sleep(infra_wait_secs)

Check warning on line 328 in redisbench_admin/utils/remote.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/utils/remote.py#L326-L328

Added lines #L326 - L328 were not covered by tests
return retrieve_tf_connection_vars(return_code, tf)


Expand Down Expand Up @@ -616,42 +628,50 @@
unit="benchmark time-series", total=len(time_series_dict.values())
)
for timeseries_name, time_series in time_series_dict.items():
exporter_create_ts(rts, time_series, timeseries_name)
for timestamp, value in time_series["data"].items():
try:
if timestamp is None:
logging.warning("The provided timestamp is null. Using auto-ts")
rts.ts().add(
timeseries_name,
value,
duplicate_policy="last",
)
else:
rts.ts().add(
timeseries_name,
timestamp,
value,
duplicate_policy="last",
try:
exporter_create_ts(rts, time_series, timeseries_name)
for timestamp, value in time_series["data"].items():
try:
if timestamp is None:
logging.warning(

Check warning on line 636 in redisbench_admin/utils/remote.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/utils/remote.py#L631-L636

Added lines #L631 - L636 were not covered by tests
"The provided timestamp is null. Using auto-ts"
)
rts.ts().add(

Check warning on line 639 in redisbench_admin/utils/remote.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/utils/remote.py#L639

Added line #L639 was not covered by tests
timeseries_name,
value,
duplicate_policy="last",
)
else:
rts.ts().add(

Check warning on line 645 in redisbench_admin/utils/remote.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/utils/remote.py#L645

Added line #L645 was not covered by tests
timeseries_name,
timestamp,
value,
duplicate_policy="last",
)
datapoint_inserts += 1
except redis.exceptions.DataError:
logging.warning(

Check warning on line 653 in redisbench_admin/utils/remote.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/utils/remote.py#L651-L653

Added lines #L651 - L653 were not covered by tests
"Error while inserting datapoint ({} : {}) in timeseries named {}. ".format(
timestamp, value, timeseries_name
)
)
datapoint_inserts += 1
except redis.exceptions.DataError:
logging.warning(
"Error while inserting datapoint ({} : {}) in timeseries named {}. ".format(
timestamp, value, timeseries_name
datapoint_errors += 1
pass
except redis.exceptions.ResponseError:
logging.warning(

Check warning on line 661 in redisbench_admin/utils/remote.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/utils/remote.py#L658-L661

Added lines #L658 - L661 were not covered by tests
"Error while inserting datapoint ({} : {}) in timeseries named {}. ".format(
timestamp, value, timeseries_name
)
)
)
datapoint_errors += 1
pass
except redis.exceptions.ResponseError:
logging.warning(
"Error while inserting datapoint ({} : {}) in timeseries named {}. ".format(
timestamp, value, timeseries_name
)
)
datapoint_errors += 1
pass
if expire_msecs > 0:
rts.pexpire(timeseries_name, expire_msecs)
datapoint_errors += 1
pass
if expire_msecs > 0:
rts.pexpire(timeseries_name, expire_msecs)
except redis.exceptions.TimeoutError:
logging.error(

Check warning on line 671 in redisbench_admin/utils/remote.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/utils/remote.py#L666-L671

Added lines #L666 - L671 were not covered by tests
f"Error while working in timeseries named {timeseries_name}. "
)
datapoint_errors += 1

Check warning on line 674 in redisbench_admin/utils/remote.py

View check run for this annotation

Codecov / codecov/patch

redisbench_admin/utils/remote.py#L674

Added line #L674 was not covered by tests
progress.update()
return datapoint_errors, datapoint_inserts

Expand Down
1 change: 1 addition & 0 deletions redisbench_admin/watchdog/watchdog.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def watchdog_command_logic(args, project_name, project_version):
host=args.redistimeseries_host,
port=args.redistimeseries_port,
password=args.redistimeseries_pass,
retry_on_timeout=True,
)
rts.ping()
ec2_client = boto3.client("ec2")
Expand Down