Skip to content

Commit

Permalink
Added TF_OVERRIDE_REMOTE to redisbench-admin run-remote (#356)
Browse files Browse the repository at this point in the history
* Added pyperf format to redisbench-admin export

* Added TF_OVERRIDE_REMOTE to redisbench-admin run-remote
  • Loading branch information
filipecosta90 authored May 13, 2022
1 parent 12e2f43 commit b3cb85e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
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.9.0"
version = "0.9.1"
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
1 change: 1 addition & 0 deletions redisbench_admin/run_remote/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

REMOTE_INVENTORY = os.getenv("INVENTORY", None)
TF_OVERRIDE_NAME = os.getenv("TF_OVERRIDE_NAME", None)
TF_OVERRIDE_REMOTE = os.getenv("TF_OVERRIDE_REMOTE", None)
REMOTE_USER = os.getenv("REMOTE_USER", "ubuntu")


Expand Down
2 changes: 2 additions & 0 deletions redisbench_admin/run_remote/remote_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def remote_env_setup(
tf_triggering_env,
tf_timeout_secs=7200,
tf_override_name=None,
tf_folder_path=None,
):
server_plaintext_port = 6379
db_ssh_port = args.db_ssh_port
Expand Down Expand Up @@ -69,6 +70,7 @@ def remote_env_setup(
tf_triggering_env,
tf_timeout_secs,
tf_override_name,
tf_folder_path,
)
return (
client_public_ip,
Expand Down
3 changes: 2 additions & 1 deletion redisbench_admin/run_remote/run_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from redisbench_admin.run.run import define_benchmark_plan
from redisbench_admin.run.s3 import get_test_s3_bucket_path
from redisbench_admin.run.ssh import ssh_pem_check
from redisbench_admin.run_remote.args import TF_OVERRIDE_NAME
from redisbench_admin.run_remote.args import TF_OVERRIDE_NAME, TF_OVERRIDE_REMOTE
from redisbench_admin.run_remote.consts import min_recommended_benchmark_duration
from redisbench_admin.run_remote.notifications import generate_failure_notification
from redisbench_admin.run_remote.remote_client import run_remote_client_tool
Expand Down Expand Up @@ -400,6 +400,7 @@ def run_remote_command_logic(args, project_name, project_version):
tf_triggering_env,
tf_timeout_secs,
TF_OVERRIDE_NAME,
TF_OVERRIDE_REMOTE,
)

# after we've created the env, even on error we should always teardown
Expand Down
12 changes: 7 additions & 5 deletions redisbench_admin/run_remote/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ def terraform_spin_or_reuse_env(
tf_triggering_env,
tf_timeout_secs=7200,
tf_override_name=None,
tf_folder_path=None,
):
(
remote_setup,
deployment_type,
remote_id,
) = fetch_remote_setup_from_config(benchmark_config["remote"])
(remote_setup, deployment_type, remote_id,) = fetch_remote_setup_from_config(
benchmark_config["remote"],
"https://github.com/RedisLabsModules/testing-infrastructure.git",
"master",
tf_folder_path,
)
logging.info(
"Repetition {} of {}. Deploying test {} on AWS using {}".format(
repetition, BENCHMARK_REPETITIONS, test_name, remote_setup
Expand Down
16 changes: 9 additions & 7 deletions redisbench_admin/utils/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,16 +541,18 @@ def fetch_remote_setup_from_config(
remote_setup_config,
repo="https://github.com/RedisLabsModules/testing-infrastructure.git",
branch="master",
path=None,
):
setup_type = None
setup = None
for remote_setup_property in remote_setup_config:
if "type" in remote_setup_property:
setup_type = remote_setup_property["type"]
if "setup" in remote_setup_property:
setup = remote_setup_property["setup"]
# fetch terraform folder
path = "/terraform/{}-{}".format(setup_type, setup)
if path is None:
for remote_setup_property in remote_setup_config:
if "type" in remote_setup_property:
setup_type = remote_setup_property["type"]
if "setup" in remote_setup_property:
setup = remote_setup_property["setup"]
# fetch terraform folder
path = "/terraform/{}-{}".format(setup_type, setup)
terraform_working_dir = common_tf(branch, path, repo)
return terraform_working_dir, setup_type, setup

Expand Down

0 comments on commit b3cb85e

Please sign in to comment.