Skip to content

Commit c895cbc

Browse files
committed
Ensuring architecture checks are effective
1 parent 7fcffd7 commit c895cbc

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

redisbench_admin/run_remote/remote_env.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,8 @@ def remote_env_setup(
4040
db_ssh_port = args.db_ssh_port
4141
client_ssh_port = args.client_ssh_port
4242
username = args.user
43-
logging.info(f"specified arch for deployment {architecture}")
44-
if architecture != ARCH_X86 and tf_folder_path is not None:
45-
logging.info(
46-
f"Checking if the architecture info is specified on the terraform path {tf_folder_path}"
47-
)
48-
if architecture is ARCH_ARM and ARCH_ARM not in tf_folder_path:
49-
logging.info(f"adding suffix '-{ARCH_ARM}' to {tf_folder_path}")
50-
tf_folder_path = "{tf_folder_path}-{ARCH_ARM}"
51-
else:
52-
logging.info(f"'-{ARCH_ARM}' suffix already in {tf_folder_path}")
5343

44+
logging.info(f"specified arch for deployment {architecture}")
5445
if args.inventory is not None:
5546
logging.info(
5647
f"inventory info passed. avoiding to deploy using terraform {args.inventory}"
@@ -101,6 +92,7 @@ def remote_env_setup(
10192
tf_timeout_secs,
10293
tf_override_name,
10394
tf_folder_spot_path,
95+
architecture,
10496
)
10597
spot_available_and_used = True
10698
spot_price_counter = spot_price_counter + 1
@@ -117,6 +109,9 @@ def remote_env_setup(
117109
"Even though there is a spot instance config, avoiding deploying it."
118110
)
119111
if spot_available_and_used is False:
112+
import pdb
113+
114+
pdb.set_trace()
120115
(
121116
client_public_ip,
122117
_,
@@ -139,6 +134,7 @@ def remote_env_setup(
139134
tf_timeout_secs,
140135
tf_override_name,
141136
tf_folder_path,
137+
architecture,
142138
)
143139
full_price_counter = full_price_counter + 1
144140
logging.info("Using the following connection addresses.")

redisbench_admin/run_remote/terraform.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ def terraform_spin_or_reuse_env(
4444
architecture,
4545
)
4646
logging.info(
47-
"Repetition {} of {}. Deploying test {} on AWS using {}".format(
48-
repetition, BENCHMARK_REPETITIONS, test_name, remote_setup
49-
)
47+
f"Repetition {repetition} of {BENCHMARK_REPETITIONS}. Deploying test {test_name} on AWS using (architecture={architecture}) {remote_setup}"
5048
)
5149
if tf_override_name is None:
5250
tf_setup_name = "{}{}".format(remote_setup, tf_setup_name_sufix)

redisbench_admin/utils/remote.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ def setup_remote_environment(
276276
_, _, _ = tf.init(
277277
capture_output=True,
278278
backend_config={
279-
"key": "benchmarks/infrastructure/{}.tfstate".format(tf_setup_name)
279+
"key": "benchmarks/infrastructure/{}.tfstate".format(
280+
tf_setup_name.replace("/", "-")
281+
)
280282
},
281283
)
282284
_, _, _ = tf.refresh()
@@ -582,6 +584,7 @@ def fetch_remote_setup_from_config(
582584
architecture=ARCH_X86,
583585
):
584586
setup_type = "oss-standalone"
587+
logging.info(f"fetch_remote_setup_from_config, architecture={architecture}")
585588
setup = None
586589
if path is None:
587590
for remote_setup_property in remote_setup_config:
@@ -595,7 +598,7 @@ def fetch_remote_setup_from_config(
595598
logging.info(
596599
f"Checking if the architecture info is specified on the terraform path {path}"
597600
)
598-
if architecture is ARCH_ARM and ARCH_ARM not in path:
601+
if architecture == ARCH_ARM and ARCH_ARM not in path:
599602
logging.info(f"adding suffix '-{ARCH_ARM}' to {path}")
600603
path = f"{path}-{ARCH_ARM}"
601604
else:

0 commit comments

Comments
 (0)