redisbench-admin 0.11.37__py3-none-any.whl → 0.11.39__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -73,15 +73,7 @@ def deploy_command_logic(args, project_name, project_version):
73
73
  tf_triggering_env = "redisbench-admin-deploy"
74
74
  logging.info("Setting an infra timeout of {} secs".format(infra_timeout_secs))
75
75
  if args.destroy is False:
76
- (
77
- tf_return_code,
78
- _,
79
- _,
80
- _,
81
- _,
82
- _,
83
- _,
84
- ) = setup_remote_environment(
76
+ (tf_return_code, _, _, _, _, _, _,) = setup_remote_environment(
85
77
  tf,
86
78
  tf_github_sha,
87
79
  tf_github_actor,
@@ -42,13 +42,7 @@ def export_command_logic(args, project_name, project_version):
42
42
  deployment_name = args.deployment_name
43
43
  deployment_type = args.deployment_type
44
44
  results_format = args.results_format
45
- (
46
- _,
47
- github_branch,
48
- github_org,
49
- github_repo,
50
- _,
51
- ) = git_vars_crosscheck(
45
+ (_, github_branch, github_org, github_repo, _,) = git_vars_crosscheck(
52
46
  None, args.github_branch, args.github_org, args.github_repo, None
53
47
  )
54
48
  exporter_timemetric_path = None
@@ -400,9 +400,9 @@ class Perf:
400
400
  "Main THREAD Flame Graph: " + use_case, details
401
401
  )
402
402
  if artifact_result is True:
403
- outputs["Main THREAD Flame Graph {}".format(identifier)] = (
404
- flame_graph_output
405
- )
403
+ outputs[
404
+ "Main THREAD Flame Graph {}".format(identifier)
405
+ ] = flame_graph_output
406
406
  result &= artifact_result
407
407
 
408
408
  tid = self.pid
@@ -440,9 +440,9 @@ class Perf:
440
440
  )
441
441
 
442
442
  if artifact_result is True:
443
- outputs["perf report per dso,sym {}".format(identifier)] = (
444
- perf_report_artifact
445
- )
443
+ outputs[
444
+ "perf report per dso,sym {}".format(identifier)
445
+ ] = perf_report_artifact
446
446
  result &= artifact_result
447
447
 
448
448
  # generate perf report per dso,sym
@@ -460,9 +460,9 @@ class Perf:
460
460
  )
461
461
 
462
462
  if artifact_result is True:
463
- outputs["perf report per dso,sym with callgraph {}".format(identifier)] = (
464
- perf_report_artifact
465
- )
463
+ outputs[
464
+ "perf report per dso,sym with callgraph {}".format(identifier)
465
+ ] = perf_report_artifact
466
466
  result &= artifact_result
467
467
 
468
468
  # generate perf report per dso,sym,srcline
@@ -487,9 +487,9 @@ class Perf:
487
487
  )
488
488
 
489
489
  if artifact_result is True:
490
- outputs["perf report per dso,sym,srcline {}".format(identifier)] = (
491
- perf_report_artifact
492
- )
490
+ outputs[
491
+ "perf report per dso,sym,srcline {}".format(identifier)
492
+ ] = perf_report_artifact
493
493
  result &= artifact_result
494
494
 
495
495
  self.logger.info(
@@ -527,9 +527,9 @@ class Perf:
527
527
  )
528
528
 
529
529
  if artifact_result is True:
530
- outputs["perf report top self-cpu {}".format(identifier)] = (
531
- perf_report_artifact
532
- )
530
+ outputs[
531
+ "perf report top self-cpu {}".format(identifier)
532
+ ] = perf_report_artifact
533
533
  result &= artifact_result
534
534
 
535
535
  # generate perf report --stdio report
@@ -546,9 +546,9 @@ class Perf:
546
546
  )
547
547
 
548
548
  if artifact_result is True:
549
- outputs["perf report top self-cpu (dso={})".format(binary)] = (
550
- perf_report_artifact
551
- )
549
+ outputs[
550
+ "perf report top self-cpu (dso={})".format(binary)
551
+ ] = perf_report_artifact
552
552
  result &= artifact_result
553
553
 
554
554
  if self.callgraph_mode == "dwarf":
@@ -590,9 +590,9 @@ class Perf:
590
590
  )
591
591
  result &= artifact_result
592
592
  if artifact_result is True:
593
- outputs["Top entries in text form by LOC"] = (
594
- pprof_artifact_text_output
595
- )
593
+ outputs[
594
+ "Top entries in text form by LOC"
595
+ ] = pprof_artifact_text_output
596
596
  tabular_data_map["text-lines"] = tabular_data
597
597
  self.logger.info("Generating pprof png output")
598
598
  pprof_png_output = self.output + ".pprof.png"
@@ -604,9 +604,9 @@ class Perf:
604
604
  self.output,
605
605
  )
606
606
  if artifact_result is True:
607
- outputs["Output graph image in PNG format"] = (
608
- pprof_artifact_png_output
609
- )
607
+ outputs[
608
+ "Output graph image in PNG format"
609
+ ] = pprof_artifact_png_output
610
610
  result &= artifact_result
611
611
 
612
612
  # save stack collapsed
@@ -115,6 +115,12 @@ def spin_up_redis_cluster_remote_redis(
115
115
  logname,
116
116
  redis_7=True,
117
117
  ):
118
+ # Import the function from standalone module
119
+ from redisbench_admin.run_remote.standalone import ensure_redis_server_available
120
+
121
+ # Ensure redis-server is available before trying to start cluster
122
+ ensure_redis_server_available(server_public_ip, username, private_key, ssh_port)
123
+
118
124
  logging.info("Generating the remote redis-server command arguments")
119
125
  redis_process_commands = []
120
126
  logfiles = []
@@ -206,10 +206,7 @@ def prepare_benchmark_parameters_specif_tooling(
206
206
  if isremote is True:
207
207
  benchmark_tool = "/tmp/{}".format(benchmark_tool)
208
208
  input_data_file = "/tmp/input.data"
209
- (
210
- command_arr,
211
- command_str,
212
- ) = prepare_tsbs_benchmark_command(
209
+ (command_arr, command_str,) = prepare_tsbs_benchmark_command(
213
210
  benchmark_tool,
214
211
  server_private_ip,
215
212
  server_plaintext_port,
@@ -221,10 +218,7 @@ def prepare_benchmark_parameters_specif_tooling(
221
218
  cluster_api_enabled,
222
219
  )
223
220
  if "memtier_benchmark" in benchmark_tool:
224
- (
225
- command_arr,
226
- command_str,
227
- ) = prepare_memtier_benchmark_command(
221
+ (command_arr, command_str,) = prepare_memtier_benchmark_command(
228
222
  benchmark_tool,
229
223
  server_private_ip,
230
224
  server_plaintext_port,
@@ -242,10 +236,7 @@ def prepare_benchmark_parameters_specif_tooling(
242
236
  ann_path = stdout[0].strip() + "/run/ann/pkg/multirun.py"
243
237
  logging.info("Remote ann-benchmark path: {}".format(ann_path))
244
238
 
245
- (
246
- command_arr,
247
- command_str,
248
- ) = prepare_ann_benchmark_command(
239
+ (command_arr, command_str,) = prepare_ann_benchmark_command(
249
240
  server_private_ip,
250
241
  server_plaintext_port,
251
242
  cluster_api_enabled,
@@ -259,10 +250,7 @@ def prepare_benchmark_parameters_specif_tooling(
259
250
  if isremote is True:
260
251
  benchmark_tool = "/tmp/{}".format(benchmark_tool)
261
252
  input_data_file = "/tmp/input.data"
262
- (
263
- command_arr,
264
- command_str,
265
- ) = prepare_ftsb_benchmark_command(
253
+ (command_arr, command_str,) = prepare_ftsb_benchmark_command(
266
254
  benchmark_tool,
267
255
  server_private_ip,
268
256
  server_plaintext_port,
@@ -279,10 +267,7 @@ def prepare_benchmark_parameters_specif_tooling(
279
267
  if isremote is True:
280
268
  benchmark_tool = "/tmp/{}".format(benchmark_tool)
281
269
  input_data_file = "/tmp/input.data"
282
- (
283
- command_arr,
284
- command_str,
285
- ) = prepare_aibench_benchmark_command(
270
+ (command_arr, command_str,) = prepare_aibench_benchmark_command(
286
271
  benchmark_tool,
287
272
  server_private_ip,
288
273
  server_plaintext_port,
@@ -787,10 +772,7 @@ def print_results_table_stdout(
787
772
  metric_names=[],
788
773
  ):
789
774
  # check which metrics to extract
790
- (
791
- _,
792
- metrics,
793
- ) = merge_default_and_config_metrics(
775
+ (_, metrics,) = merge_default_and_config_metrics(
794
776
  benchmark_config,
795
777
  default_metrics,
796
778
  None,
@@ -114,11 +114,7 @@ class TerraformClass:
114
114
  def async_runner_setup(
115
115
  self,
116
116
  ):
117
- (
118
- remote_setup,
119
- deployment_type,
120
- remote_id,
121
- ) = fetch_remote_setup_from_config(
117
+ (remote_setup, deployment_type, remote_id,) = fetch_remote_setup_from_config(
122
118
  [{"type": "async", "setup": "runner"}],
123
119
  "https://github.com/RedisLabsModules/testing-infrastructure.git",
124
120
  "master",
@@ -233,11 +229,7 @@ def terraform_spin_or_reuse_env(
233
229
  tf_override_name=None,
234
230
  tf_folder_path=None,
235
231
  ):
236
- (
237
- remote_setup,
238
- deployment_type,
239
- remote_id,
240
- ) = fetch_remote_setup_from_config(
232
+ (remote_setup, deployment_type, remote_id,) = fetch_remote_setup_from_config(
241
233
  benchmark_config["remote"],
242
234
  "https://github.com/RedisLabsModules/testing-infrastructure.git",
243
235
  "master",
@@ -28,9 +28,9 @@ WantedBy=multi-user.target
28
28
  argv.append("--private_key")
29
29
  argv.append("/home/ubuntu/work_dir/tests/benchmarks/benchmarks.redislabs.pem")
30
30
  else:
31
- argv[argv.index(args.private_key)] = (
32
- "/home/ubuntu/work_dir/tests/benchmarks/benchmarks.redislabs.pem"
33
- )
31
+ argv[
32
+ argv.index(args.private_key)
33
+ ] = "/home/ubuntu/work_dir/tests/benchmarks/benchmarks.redislabs.pem"
34
34
  if len(args.module_path) != 0:
35
35
  argv[argv.index(args.module_path[0])] = (
36
36
  "/home/ubuntu/work_dir/tests/benchmarks/"
@@ -687,17 +687,17 @@ def commandstats_latencystats_process_name(
687
687
  branch = variant_labels_dict["branch"]
688
688
 
689
689
  if version is not None:
690
- variant_labels_dict["command_and_metric_and_version"] = (
691
- "{} - {} - {}".format(command, metric, version)
692
- )
693
- variant_labels_dict["command_and_metric_and_setup_and_version"] = (
694
- "{} - {} - {} - {}".format(command, metric, setup_name, version)
695
- )
690
+ variant_labels_dict[
691
+ "command_and_metric_and_version"
692
+ ] = "{} - {} - {}".format(command, metric, version)
693
+ variant_labels_dict[
694
+ "command_and_metric_and_setup_and_version"
695
+ ] = "{} - {} - {} - {}".format(command, metric, setup_name, version)
696
696
 
697
697
  if branch is not None:
698
- variant_labels_dict["command_and_metric_and_branch"] = (
699
- "{} - {} - {}".format(command, metric, branch)
700
- )
701
- variant_labels_dict["command_and_metric_and_setup_and_branch"] = (
702
- "{} - {} - {} - {}".format(command, metric, setup_name, branch)
703
- )
698
+ variant_labels_dict[
699
+ "command_and_metric_and_branch"
700
+ ] = "{} - {} - {}".format(command, metric, branch)
701
+ variant_labels_dict[
702
+ "command_and_metric_and_setup_and_branch"
703
+ ] = "{} - {} - {} - {}".format(command, metric, setup_name, branch)
@@ -406,9 +406,17 @@ def db_error_artifacts(
406
406
  upload_s3,
407
407
  username,
408
408
  ):
409
+ # Import the zip check function
410
+ from redisbench_admin.run_remote.standalone import ensure_zip_available
411
+
412
+ # Ensure zip is available before trying to use it
413
+ ensure_zip_available(server_public_ip, username, private_key, db_ssh_port)
414
+
409
415
  local_zipfile = "{}.zip".format(logname)
410
416
  remote_zipfile = "/home/{}/{}".format(username, local_zipfile)
411
- execute_remote_commands(
417
+
418
+ # Create zip file
419
+ zip_result = execute_remote_commands(
412
420
  server_public_ip,
413
421
  username,
414
422
  private_key,
@@ -417,26 +425,57 @@ def db_error_artifacts(
417
425
  ],
418
426
  db_ssh_port,
419
427
  )
420
- failed_remote_run_artifact_store(
421
- upload_s3,
422
- server_public_ip,
423
- dirname,
424
- remote_zipfile,
425
- local_zipfile,
426
- s3_bucket_name,
427
- s3_bucket_path,
428
- username,
429
- private_key,
430
- )
428
+
429
+ # Check if zip creation was successful
430
+ zip_success = True
431
+ for pos, res_pos in enumerate(zip_result):
432
+ [recv_exit_status, stdout, stderr] = res_pos
433
+ if recv_exit_status != 0:
434
+ logging.warning(
435
+ "Zip creation failed with exit code {}. stdout: {}. stderr: {}".format(
436
+ recv_exit_status, stdout, stderr
437
+ )
438
+ )
439
+ zip_success = False
440
+
441
+ # Only try to upload if zip was created successfully
442
+ if zip_success:
443
+ try:
444
+ failed_remote_run_artifact_store(
445
+ upload_s3,
446
+ server_public_ip,
447
+ dirname,
448
+ remote_zipfile,
449
+ local_zipfile,
450
+ s3_bucket_name,
451
+ s3_bucket_path,
452
+ username,
453
+ private_key,
454
+ )
455
+ except Exception as e:
456
+ logging.warning(
457
+ "Failed to upload zip file to S3: {}. Continuing without upload.".format(
458
+ e
459
+ )
460
+ )
461
+ else:
462
+ logging.warning("Skipping S3 upload due to zip creation failure")
431
463
  if len(full_logfiles) > 0:
432
- failed_remote_run_artifact_store(
433
- upload_s3,
434
- server_public_ip,
435
- dirname,
436
- full_logfiles[0],
437
- logname,
438
- s3_bucket_name,
439
- s3_bucket_path,
440
- username,
441
- private_key,
442
- )
464
+ try:
465
+ failed_remote_run_artifact_store(
466
+ upload_s3,
467
+ server_public_ip,
468
+ dirname,
469
+ full_logfiles[0],
470
+ logname,
471
+ s3_bucket_name,
472
+ s3_bucket_path,
473
+ username,
474
+ private_key,
475
+ )
476
+ except Exception as e:
477
+ logging.warning(
478
+ "Failed to upload logfile to S3: {}. Continuing without upload.".format(
479
+ e
480
+ )
481
+ )
@@ -71,6 +71,23 @@ def remote_tool_pre_bench_step(
71
71
  logging.info(
72
72
  f"Settting up remote tool {benchmark_tool} requirements. architecture ={architecture}"
73
73
  )
74
+
75
+ # Check and install benchmark tools if needed
76
+ if benchmark_tool == "memtier_benchmark":
77
+ from redisbench_admin.run_remote.standalone import (
78
+ ensure_memtier_benchmark_available,
79
+ )
80
+
81
+ ensure_memtier_benchmark_available(
82
+ client_public_ip, username, private_key, client_ssh_port
83
+ )
84
+ elif benchmark_tool == "redis-benchmark":
85
+ from redisbench_admin.run_remote.standalone import ensure_redis_server_available
86
+
87
+ # redis-benchmark comes with redis-server, so ensure redis-server is installed
88
+ ensure_redis_server_available(
89
+ client_public_ip, username, private_key, client_ssh_port
90
+ )
74
91
  if benchmark_tool == "redisgraph-benchmark-go":
75
92
  setup_remote_benchmark_tool_redisgraph_benchmark_go(
76
93
  client_public_ip,
@@ -89,11 +106,7 @@ def remote_tool_pre_bench_step(
89
106
  )
90
107
 
91
108
  if "ftsb_" in benchmark_tool:
92
- (
93
- queries_file_link,
94
- remote_tool_link,
95
- tool_link,
96
- ) = extract_ftsb_extra_links(
109
+ (queries_file_link, remote_tool_link, tool_link,) = extract_ftsb_extra_links(
97
110
  benchmark_config, benchmark_tool, config_key, architecture
98
111
  )
99
112
  logging.info(
@@ -161,7 +161,24 @@ def run_remote_command_logic(args, project_name, project_version):
161
161
  )
162
162
  webhook_client_slack = WebhookClient(webhook_url)
163
163
 
164
- if args.skip_env_vars_verify is False:
164
+ # Only check AWS credentials when actually needed
165
+ needs_aws_for_infrastructure = (
166
+ args.inventory is None
167
+ ) # No inventory = need to deploy with Terraform
168
+ needs_aws_for_s3 = args.upload_results_s3 # S3 upload enabled
169
+
170
+ if args.skip_env_vars_verify is False and (
171
+ needs_aws_for_infrastructure or needs_aws_for_s3
172
+ ):
173
+ # Log why AWS credentials are being checked
174
+ aws_reasons = []
175
+ if needs_aws_for_infrastructure:
176
+ aws_reasons.append("infrastructure deployment (no --inventory provided)")
177
+ if needs_aws_for_s3:
178
+ aws_reasons.append("S3 upload (--upload_results_s3 enabled)")
179
+
180
+ logging.info("AWS credentials required for: {}".format(", ".join(aws_reasons)))
181
+
165
182
  env_check_status, failure_reason = check_ec2_env()
166
183
  if env_check_status is False:
167
184
  if webhook_notifications_active:
@@ -177,6 +194,10 @@ def run_remote_command_logic(args, project_name, project_version):
177
194
  )
178
195
  logging.critical("{}. Exiting right away!".format(failure_reason))
179
196
  exit(1)
197
+ elif args.skip_env_vars_verify is False:
198
+ logging.info(
199
+ "AWS credentials check skipped (using --inventory and S3 upload disabled)"
200
+ )
180
201
 
181
202
  continue_on_module_check_error = args.continue_on_module_check_error
182
203
  module_check_status, error_message = redis_modules_check(local_module_files)
@@ -1408,20 +1429,20 @@ def commandstats_latencystats_process_name(
1408
1429
  branch = variant_labels_dict["branch"]
1409
1430
 
1410
1431
  if version is not None:
1411
- variant_labels_dict["command_and_metric_and_version"] = (
1412
- "{} - {} - {}".format(command, metric, version)
1413
- )
1414
- variant_labels_dict["command_and_metric_and_setup_and_version"] = (
1415
- "{} - {} - {} - {}".format(command, metric, setup_name, version)
1416
- )
1432
+ variant_labels_dict[
1433
+ "command_and_metric_and_version"
1434
+ ] = "{} - {} - {}".format(command, metric, version)
1435
+ variant_labels_dict[
1436
+ "command_and_metric_and_setup_and_version"
1437
+ ] = "{} - {} - {} - {}".format(command, metric, setup_name, version)
1417
1438
 
1418
1439
  if branch is not None:
1419
- variant_labels_dict["command_and_metric_and_branch"] = (
1420
- "{} - {} - {}".format(command, metric, branch)
1421
- )
1422
- variant_labels_dict["command_and_metric_and_setup_and_branch"] = (
1423
- "{} - {} - {} - {}".format(command, metric, setup_name, branch)
1424
- )
1440
+ variant_labels_dict[
1441
+ "command_and_metric_and_branch"
1442
+ ] = "{} - {} - {}".format(command, metric, branch)
1443
+ variant_labels_dict[
1444
+ "command_and_metric_and_setup_and_branch"
1445
+ ] = "{} - {} - {} - {}".format(command, metric, setup_name, branch)
1425
1446
 
1426
1447
 
1427
1448
  def shutdown_remote_redis(redis_conns, ssh_tunnel):
@@ -15,6 +15,139 @@ from redisbench_admin.utils.ssh import SSHSession
15
15
  from redisbench_admin.utils.utils import redis_server_config_module_part
16
16
 
17
17
 
18
+ def ensure_redis_server_available(server_public_ip, username, private_key, port=22):
19
+ """Check if redis-server is available, install if not"""
20
+ logging.info("Checking if redis-server is available on remote server...")
21
+
22
+ # Check if redis-server exists
23
+ check_result = execute_remote_commands(
24
+ server_public_ip, username, private_key, ["which redis-server"], port
25
+ )
26
+
27
+ # Check the result
28
+ if len(check_result) > 0:
29
+ [recv_exit_status, stdout, stderr] = check_result[0]
30
+ if recv_exit_status != 0:
31
+ logging.info("redis-server not found, installing Redis...")
32
+
33
+ # Install Redis using the provided commands
34
+ install_commands = [
35
+ "sudo apt-get install lsb-release curl gpg -y",
36
+ "curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg",
37
+ "sudo chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg",
38
+ 'echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list',
39
+ "sudo apt-get update",
40
+ "sudo apt-get install redis -y",
41
+ "sudo systemctl disable redis-server",
42
+ ]
43
+
44
+ install_result = execute_remote_commands(
45
+ server_public_ip, username, private_key, install_commands, port
46
+ )
47
+
48
+ # Check if installation was successful
49
+ for pos, res_pos in enumerate(install_result):
50
+ [recv_exit_status, stdout, stderr] = res_pos
51
+ if recv_exit_status != 0:
52
+ logging.warning(
53
+ "Redis installation command {} returned exit code {}. stdout: {}. stderr: {}".format(
54
+ pos, recv_exit_status, stdout, stderr
55
+ )
56
+ )
57
+
58
+ logging.info("Redis installation completed and auto-start disabled")
59
+ else:
60
+ logging.info("redis-server is already available")
61
+ else:
62
+ logging.error("Failed to check redis-server availability")
63
+
64
+
65
+ def ensure_zip_available(server_public_ip, username, private_key, port=22):
66
+ """Check if zip is available, install if not"""
67
+ logging.info("Checking if zip is available on remote server...")
68
+
69
+ # Check if zip exists
70
+ check_result = execute_remote_commands(
71
+ server_public_ip, username, private_key, ["which zip"], port
72
+ )
73
+
74
+ # Check the result
75
+ if len(check_result) > 0:
76
+ [recv_exit_status, stdout, stderr] = check_result[0]
77
+ if recv_exit_status != 0:
78
+ logging.info("zip not found, installing...")
79
+
80
+ # Install zip
81
+ install_commands = ["sudo apt-get install zip -y"]
82
+
83
+ install_result = execute_remote_commands(
84
+ server_public_ip, username, private_key, install_commands, port
85
+ )
86
+
87
+ # Check if installation was successful
88
+ for pos, res_pos in enumerate(install_result):
89
+ [recv_exit_status, stdout, stderr] = res_pos
90
+ if recv_exit_status != 0:
91
+ logging.warning(
92
+ "Zip installation command {} returned exit code {}. stdout: {}. stderr: {}".format(
93
+ pos, recv_exit_status, stdout, stderr
94
+ )
95
+ )
96
+
97
+ logging.info("Zip installation completed")
98
+ else:
99
+ logging.info("zip is already available")
100
+ else:
101
+ logging.error("Failed to check zip availability")
102
+
103
+
104
+ def ensure_memtier_benchmark_available(
105
+ client_public_ip, username, private_key, port=22
106
+ ):
107
+ """Check if memtier_benchmark is available, install if not"""
108
+ logging.info("Checking if memtier_benchmark is available on remote client...")
109
+
110
+ # Check if memtier_benchmark exists
111
+ check_result = execute_remote_commands(
112
+ client_public_ip, username, private_key, ["which memtier_benchmark"], port
113
+ )
114
+
115
+ # Check the result
116
+ if len(check_result) > 0:
117
+ [recv_exit_status, stdout, stderr] = check_result[0]
118
+ if recv_exit_status != 0:
119
+ logging.info("memtier_benchmark not found, installing...")
120
+
121
+ # Install memtier_benchmark using the provided commands
122
+ install_commands = [
123
+ "sudo apt install lsb-release curl gpg -y",
124
+ "curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg",
125
+ 'echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list',
126
+ "sudo apt-get update",
127
+ "sudo apt-get install memtier-benchmark -y",
128
+ ]
129
+
130
+ install_result = execute_remote_commands(
131
+ client_public_ip, username, private_key, install_commands, port
132
+ )
133
+
134
+ # Check if installation was successful
135
+ for pos, res_pos in enumerate(install_result):
136
+ [recv_exit_status, stdout, stderr] = res_pos
137
+ if recv_exit_status != 0:
138
+ logging.warning(
139
+ "memtier_benchmark installation command {} returned exit code {}. stdout: {}. stderr: {}".format(
140
+ pos, recv_exit_status, stdout, stderr
141
+ )
142
+ )
143
+
144
+ logging.info("memtier_benchmark installation completed")
145
+ else:
146
+ logging.info("memtier_benchmark is already available")
147
+ else:
148
+ logging.error("Failed to check memtier_benchmark availability")
149
+
150
+
18
151
  def spin_up_standalone_remote_redis(
19
152
  temporary_dir,
20
153
  server_public_ip,
@@ -27,6 +160,9 @@ def spin_up_standalone_remote_redis(
27
160
  modules_configuration_parameters_map={},
28
161
  redis_7=True,
29
162
  ):
163
+ # Ensure redis-server is available before trying to start it
164
+ ensure_redis_server_available(server_public_ip, username, private_key, port)
165
+
30
166
  full_logfile, initial_redis_cmd = generate_remote_standalone_redis_cmd(
31
167
  logfile,
32
168
  redis_configuration_parameters,
@@ -32,11 +32,7 @@ def terraform_spin_or_reuse_env(
32
32
  tf_folder_path=None,
33
33
  architecture="x86_64",
34
34
  ):
35
- (
36
- remote_setup,
37
- deployment_type,
38
- remote_id,
39
- ) = fetch_remote_setup_from_config(
35
+ (remote_setup, deployment_type, remote_id,) = fetch_remote_setup_from_config(
40
36
  benchmark_config["remote"],
41
37
  "https://github.com/redis-performance/testing-infrastructure.git",
42
38
  "master",