Skip to content

Commit b8eee46

Browse files
Enabled keeping local env up via KEEP_ENV var; Fixed profilers always on (#248)
* [add] Added target tables grafana logic * [fix] Fixes based on beelit94/python-terraform#108 * Bumping version from 0.5.21 to 0.5.22 * [add] Enabled keeping local env up via KEEP_ENV var * [fix] Fixed profilers always on * Bumping version from 0.5.22 to 0.5.23
1 parent 08c6460 commit b8eee46

File tree

4 files changed

+33
-17
lines changed

4 files changed

+33
-17
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisbench-admin"
3-
version = "0.5.22"
3+
version = "0.5.23"
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 <[email protected]>","Redis Performance Group <[email protected]>"]
66
readme = "README.md"

redisbench_admin/run/args.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,21 @@
2626
S3_BUCKET_NAME = os.getenv("S3_BUCKET_NAME", "ci.benchmarks.redislabs")
2727
PUSH_S3 = bool(os.getenv("PUSH_S3", False))
2828
PROFILERS_DSO = os.getenv("PROFILERS_DSO", None)
29-
PROFILERS_ENABLED = bool(os.getenv("PROFILE", 0))
29+
PROFILERS_ENABLED = bool(int(os.getenv("PROFILE", 0)))
3030
PROFILERS = os.getenv("PROFILERS", PROFILERS_DEFAULT)
3131
MAX_PROFILERS_PER_TYPE = int(os.getenv("MAX_PROFILERS", 1))
3232
PROFILE_FREQ = os.getenv("PROFILE_FREQ", PROFILE_FREQ_DEFAULT)
33+
KEEP_ENV = bool(os.getenv("KEEP_ENV", False))
3334

3435

3536
def common_run_args(parser):
37+
parser.add_argument(
38+
"--keep_env_and_topo",
39+
required=False,
40+
default=KEEP_ENV,
41+
action="store_true",
42+
help="Keep environment and topology up after benchmark.",
43+
)
3644
parser.add_argument(
3745
"--dbdir_folder",
3846
type=str,

redisbench_admin/run_local/run_local.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,14 @@ def run_local_command_logic(args, project_name, project_version):
340340
benchmark_config, results_dict, return_code
341341
)
342342
if setup_details["env"] is None:
343-
for conn in redis_conns:
344-
conn.shutdown(save=False)
343+
if args.keep_env_and_topo is False:
344+
for conn in redis_conns:
345+
conn.shutdown(save=False)
346+
else:
347+
logging.info(
348+
"Keeping environment and topology active upon request."
349+
)
350+
345351
except:
346352
return_code |= 1
347353
logging.critical(
@@ -356,9 +362,14 @@ def run_local_command_logic(args, project_name, project_version):
356362

357363
# tear-down
358364
if setup_details["env"] is None:
359-
teardown_local_setup(
360-
redis_conns, redis_processes, setup_name
361-
)
365+
if args.keep_env_and_topo is False:
366+
teardown_local_setup(
367+
redis_conns, redis_processes, setup_name
368+
)
369+
else:
370+
logging.info(
371+
"Keeping environment and topology active upon request."
372+
)
362373

363374
else:
364375
logging.info(
@@ -367,8 +378,13 @@ def run_local_command_logic(args, project_name, project_version):
367378
)
368379
)
369380
if setup_details["env"] is not None:
370-
teardown_local_setup(redis_conns, redis_processes, setup_name)
371-
setup_details["env"] = None
381+
if args.keep_env_and_topo is False:
382+
teardown_local_setup(redis_conns, redis_processes, setup_name)
383+
setup_details["env"] = None
384+
else:
385+
logging.info(
386+
"Keeping environment and topology active upon request."
387+
)
372388

373389
if profilers_enabled:
374390
local_profilers_print_artifacts_table(profilers_artifacts_matrix)

redisbench_admin/run_remote/args.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
REMOTE_INVENTORY = os.getenv("INVENTORY", None)
2020
REMOTE_USER = os.getenv("REMOTE_USER", "ubuntu")
21-
KEEP_ENV = bool(os.getenv("KEEP_ENV", False))
2221

2322

2423
def create_run_remote_arguments(parser):
@@ -42,13 +41,6 @@ def create_run_remote_arguments(parser):
4241
type=str,
4342
help="connect as this user.",
4443
)
45-
parser.add_argument(
46-
"--keep_env_and_topo",
47-
required=False,
48-
default=KEEP_ENV,
49-
action="store_true",
50-
help="Keep environment and topology up after benchmark.",
51-
)
5244
parser.add_argument(
5345
"--db_ssh_port",
5446
required=False,

0 commit comments

Comments
 (0)