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.2.12"
version = "0.2.13"
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>"]
readme = "README.md"
Expand Down
33 changes: 30 additions & 3 deletions redisbench_admin/run_remote/run_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
get_project_ts_tags,
get_overall_dashboard_keynames,
check_ec2_env,
fetch_file_from_remote_setup,
)
from sshtunnel import SSHTunnelForwarder

Expand Down Expand Up @@ -362,20 +363,22 @@ def run_remote_command_logic(args):
# after we've created the env, even on error we should always teardown
# in case of some unexpected error we fail the test
try:

_, _, testcase_start_time_str = get_start_time_vars()
logname = "{}_{}.log".format(test_name, testcase_start_time_str)
(
redis_configuration_parameters,
dataset_load_timeout_secs,
) = extract_redis_dbconfig_parameters(benchmark_config, "dbconfig")
# setup Redis
spin_up_standalone_remote_redis(
full_logfile = spin_up_standalone_remote_redis(
benchmark_config,
server_public_ip,
username,
private_key,
local_module_file,
remote_module_file,
remote_dataset_file,
logname,
dirname,
redis_configuration_parameters,
dbdir_folder,
Expand Down Expand Up @@ -533,7 +536,7 @@ def run_remote_command_logic(args):

benchmark_start_time = datetime.datetime.now()
# run the benchmark
_, stdout, _ = run_remote_benchmark(
remote_run_result, stdout, _ = run_remote_benchmark(
client_public_ip,
username,
private_key,
Expand All @@ -542,6 +545,30 @@ def run_remote_command_logic(args):
command_str,
)
benchmark_end_time = datetime.datetime.now()
if remote_run_result is False:
local_logfile = "{}/{}".format(dirname, logname)
logging.error(
"The benchmark returned an error exit status. Fetching remote logfile {} into {}".format(
full_logfile, local_logfile
)
)
fetch_file_from_remote_setup(
client_public_ip,
username,
private_key,
local_logfile,
full_logfile,
)
if args.upload_results_s3:
logging.info(
"Uploading logfile {} to s3. s3 bucket name: {}. s3 bucket path: {}".format(
local_logfile, s3_bucket_name, s3_bucket_path
)
)
artifacts = [local_logfile]
upload_artifacts_to_s3(
artifacts, s3_bucket_name, s3_bucket_path
)
benchmark_duration_seconds = (
benchmark_end_time - benchmark_start_time
).seconds
Expand Down
9 changes: 5 additions & 4 deletions redisbench_admin/utils/redisgraph_benchmark_go.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def spin_up_standalone_remote_redis(
local_module_file,
remote_module_file,
remote_dataset_file,
logfile,
dirname=".",
redis_configuration_parameters=None,
dbdir_folder=None,
Expand All @@ -35,11 +36,10 @@ def spin_up_standalone_remote_redis(
dirname,
)
temporary_dir = "/tmp"
initial_redis_cmd = (
'redis-server --save "" --dir {} --daemonize yes --protected-mode no'.format(
temporary_dir
)
initial_redis_cmd = 'redis-server --save "" --logfile {} --dir {} --daemonize yes --protected-mode no'.format(
logfile, temporary_dir
)
full_logfile = "{}/{}".format(temporary_dir, logfile)
if dbdir_folder is not None:
logging.info(
"Copying entire content of {} into temporary path: {}".format(
Expand Down Expand Up @@ -77,6 +77,7 @@ def spin_up_standalone_remote_redis(
# start redis-server
commands = [initial_redis_cmd]
execute_remote_commands(server_public_ip, username, private_key, commands)
return full_logfile


def setup_remote_benchmark_tool_redisgraph_benchmark_go(
Expand Down