redisbench-admin 0.11.41__py3-none-any.whl → 0.11.42__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.
@@ -150,5 +150,12 @@ def create_run_remote_arguments(parser):
150
150
  action="store_true",
151
151
  help="Setup standalone Redis server, run INFO SERVER, print output as markdown and exit",
152
152
  )
153
+ parser.add_argument(
154
+ "--spin-test-config",
155
+ required=False,
156
+ default=None,
157
+ type=str,
158
+ help="Optional benchmark configuration file for spin-test mode (to execute install_steps)",
159
+ )
153
160
 
154
161
  return parser
@@ -270,6 +270,18 @@ def run_remote_command_logic(args, project_name, project_version):
270
270
  logging.error("❌ --spin-test requires server_public_ip in --inventory")
271
271
  exit(1)
272
272
 
273
+ # Load benchmark config if provided
274
+ benchmark_config = None
275
+ if args.spin_test_config:
276
+ try:
277
+ import yaml
278
+ with open(args.spin_test_config, 'r') as config_file:
279
+ benchmark_config = yaml.safe_load(config_file)
280
+ logging.info(f"📋 Loaded benchmark config from {args.spin_test_config}")
281
+ except Exception as e:
282
+ logging.error(f"❌ Failed to load benchmark config: {e}")
283
+ exit(1)
284
+
273
285
  # Run spin test
274
286
  success = spin_test_standalone_redis(
275
287
  server_public_ip=server_public_ip,
@@ -282,6 +294,7 @@ def run_remote_command_logic(args, project_name, project_version):
282
294
  modules_configuration_parameters_map=None,
283
295
  custom_redis_conf_path=args.redis_conf,
284
296
  custom_redis_server_path=args.redis_server_binary,
297
+ benchmark_config=benchmark_config,
285
298
  )
286
299
 
287
300
  exit(0 if success else 1)
@@ -457,6 +457,82 @@ def generate_remote_standalone_redis_cmd(
457
457
  return full_logfile, initial_redis_cmd
458
458
 
459
459
 
460
+ def execute_install_steps(benchmark_config, server_public_ip, username, private_key, db_ssh_port):
461
+ """
462
+ Execute install_steps from dbconfig and clientconfig sections.
463
+
464
+ Args:
465
+ benchmark_config: The benchmark configuration dictionary
466
+ server_public_ip: IP address of the remote server
467
+ username: SSH username
468
+ private_key: Path to SSH private key
469
+ db_ssh_port: SSH port
470
+ """
471
+ install_commands = []
472
+
473
+ # Extract install_steps from dbconfig
474
+ if "dbconfig" in benchmark_config:
475
+ dbconfig = benchmark_config["dbconfig"]
476
+ if isinstance(dbconfig, list):
477
+ for config_item in dbconfig:
478
+ if "install_steps" in config_item:
479
+ steps = config_item["install_steps"]
480
+ if isinstance(steps, list):
481
+ install_commands.extend(steps)
482
+ logging.info(f"📦 Found {len(steps)} install steps in dbconfig")
483
+ elif isinstance(dbconfig, dict):
484
+ if "install_steps" in dbconfig:
485
+ steps = dbconfig["install_steps"]
486
+ if isinstance(steps, list):
487
+ install_commands.extend(steps)
488
+ logging.info(f"📦 Found {len(steps)} install steps in dbconfig")
489
+
490
+ # Extract install_steps from clientconfig
491
+ if "clientconfig" in benchmark_config:
492
+ clientconfig = benchmark_config["clientconfig"]
493
+ if isinstance(clientconfig, list):
494
+ for config_item in clientconfig:
495
+ if "install_steps" in config_item:
496
+ steps = config_item["install_steps"]
497
+ if isinstance(steps, list):
498
+ install_commands.extend(steps)
499
+ logging.info(f"📦 Found {len(steps)} install steps in clientconfig")
500
+ elif isinstance(clientconfig, dict):
501
+ if "install_steps" in clientconfig:
502
+ steps = clientconfig["install_steps"]
503
+ if isinstance(steps, list):
504
+ install_commands.extend(steps)
505
+ logging.info(f"📦 Found {len(steps)} install steps in clientconfig")
506
+
507
+ # Execute all install commands
508
+ if install_commands:
509
+ logging.info(f"🔧 Executing {len(install_commands)} installation commands...")
510
+ for i, command in enumerate(install_commands, 1):
511
+ logging.info(f"📋 Step {i}/{len(install_commands)}: {command}")
512
+
513
+ install_result = execute_remote_commands(
514
+ server_public_ip, username, private_key, install_commands, db_ssh_port
515
+ )
516
+
517
+ # Check results
518
+ for i, (recv_exit_status, stdout, stderr) in enumerate(install_result):
519
+ if recv_exit_status != 0:
520
+ logging.warning(
521
+ f"⚠️ Install step {i+1} returned exit code {recv_exit_status}"
522
+ )
523
+ logging.warning(f"Command: {install_commands[i]}")
524
+ if stderr:
525
+ logging.warning(f"STDERR: {''.join(stderr).strip()}")
526
+ if stdout:
527
+ logging.warning(f"STDOUT: {''.join(stdout).strip()}")
528
+ else:
529
+ logging.info(f"✅ Install step {i+1} completed successfully")
530
+
531
+ logging.info("🎯 All installation steps completed")
532
+ else:
533
+ logging.info("📦 No install_steps found in configuration")
534
+
535
+
460
536
  def spin_test_standalone_redis(
461
537
  server_public_ip,
462
538
  username,
@@ -468,6 +544,7 @@ def spin_test_standalone_redis(
468
544
  modules_configuration_parameters_map=None,
469
545
  custom_redis_conf_path=None,
470
546
  custom_redis_server_path=None,
547
+ benchmark_config=None,
471
548
  ):
472
549
  """
473
550
  Setup standalone Redis server, run INFO SERVER, print output as markdown and exit.
@@ -494,6 +571,12 @@ def spin_test_standalone_redis(
494
571
  server_public_ip, username, private_key, create_dir_commands, db_ssh_port
495
572
  )
496
573
 
574
+ # Execute install_steps from dbconfig and clientconfig if present
575
+ if benchmark_config is not None:
576
+ execute_install_steps(
577
+ benchmark_config, server_public_ip, username, private_key, db_ssh_port
578
+ )
579
+
497
580
  # Ensure Redis server is available (only if not using custom binary)
498
581
  if custom_redis_server_path is None:
499
582
  ensure_redis_server_available(
@@ -597,7 +680,7 @@ def spin_test_standalone_redis(
597
680
 
598
681
  # Generate Redis startup command
599
682
  logfile = "redis-spin-test.log"
600
- full_logfile, redis_cmd = generate_remote_standalone_redis_cmd(
683
+ _, redis_cmd = generate_remote_standalone_redis_cmd(
601
684
  logfile,
602
685
  redis_configuration_parameters,
603
686
  remote_module_files,
@@ -689,8 +772,8 @@ def spin_test_standalone_redis(
689
772
  "Disk Space",
690
773
  ]
691
774
 
692
- for i, (label, (recv_exit_status, stdout, stderr)) in enumerate(
693
- zip(system_labels, system_results)
775
+ for label, (recv_exit_status, stdout, stderr) in zip(
776
+ system_labels, system_results
694
777
  ):
695
778
  if recv_exit_status == 0 and stdout:
696
779
  output = "".join(stdout).strip()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: redisbench-admin
3
- Version: 0.11.41
3
+ Version: 0.11.42
4
4
  Summary: Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... ).
5
5
  Author: filipecosta90
6
6
  Author-email: filipecosta.90@gmail.com
@@ -211,7 +211,7 @@ redisbench_admin/run_local/local_db.py,sha256=9vINqKOs-wDMFEuEHT0I8KO9YnEo_h4NWN
211
211
  redisbench_admin/run_local/local_helpers.py,sha256=JyqLW2-Sbm35BXjxxfOB1yK7ADdLfcVrq08NLNdIwac,7026
212
212
  redisbench_admin/run_local/run_local.py,sha256=QHnGfVAaVuct7t0WrWyQpbirC3MWX7fQF5-kXU_pJBs,34834
213
213
  redisbench_admin/run_remote/__init__.py,sha256=DtBXRp0Q01XgCFmY-1OIePMyyYihVNAjZ1Y8zwqSDN0,101
214
- redisbench_admin/run_remote/args.py,sha256=Ef32mg1yNYYHL5g59SzIWZqFB__RNLLriPqiucVyoNg,4826
214
+ redisbench_admin/run_remote/args.py,sha256=gJux_1udR6d5BUMMnIewl62hS0b2WnQ_7WQF4hElX7c,5051
215
215
  redisbench_admin/run_remote/consts.py,sha256=bCMkwyeBD-EmOpoHKni7LjWy5WuaxGJhGhqpi4AL0RQ,386
216
216
  redisbench_admin/run_remote/log.py,sha256=cD7zfXt0VEmy0b7452HvcAxX_9kVj6Vm213yNdUHP20,95
217
217
  redisbench_admin/run_remote/notifications.py,sha256=-W9fLaftEFNfplBl2clHk37jbYxliDbHftQ62khN31k,2157
@@ -220,8 +220,8 @@ redisbench_admin/run_remote/remote_db.py,sha256=EEDeiOZk-godr5EINscEkOJLGWUN3gFf
220
220
  redisbench_admin/run_remote/remote_env.py,sha256=Ux_0QT1unNRlKl3cakzjG5Px1uuxOOfBoF_pnalx_T8,4936
221
221
  redisbench_admin/run_remote/remote_failures.py,sha256=IOo6DyxarcwwMPCeN4gWB2JrhuC9iBLwq0nCROqr5ak,1567
222
222
  redisbench_admin/run_remote/remote_helpers.py,sha256=skWeGyDJBmyx_UwUekT3N3_nOJvF2-Hvu-E7vKlO9gg,10598
223
- redisbench_admin/run_remote/run_remote.py,sha256=tZqCu1fTfB5gWooVIEsSDoaVfnVRfxeCpn-RLmYI3IM,75476
224
- redisbench_admin/run_remote/standalone.py,sha256=OGau_7MpQihbn0U4qa0QmGZnwQ_gJhuxuWiQm9zpp7M,27970
223
+ redisbench_admin/run_remote/run_remote.py,sha256=7B-x-AI1pVon8ccfRio8q6EXTXaqPPMj_PxytpiICUs,76045
224
+ redisbench_admin/run_remote/standalone.py,sha256=Or2GaSccxEyIl0z833RWi-fylSQ71Z6E1R2vbN0rHMM,31593
225
225
  redisbench_admin/run_remote/terraform.py,sha256=vV3eWXNwj7vsnFNqUgCir5ueZS4VYopEyzWiTtoSq0Q,4018
226
226
  redisbench_admin/utils/__init__.py,sha256=DtBXRp0Q01XgCFmY-1OIePMyyYihVNAjZ1Y8zwqSDN0,101
227
227
  redisbench_admin/utils/benchmark_config.py,sha256=bC2C6rnj89wkkSlOXyyfe0N15unn_M1t1zfskfVkb98,21387
@@ -235,8 +235,8 @@ redisbench_admin/utils/utils.py,sha256=XVSvo1_DdcYwk2jOxL3VPVPbnDnhGYt8ieYfANo6r
235
235
  redisbench_admin/watchdog/__init__.py,sha256=cD7zfXt0VEmy0b7452HvcAxX_9kVj6Vm213yNdUHP20,95
236
236
  redisbench_admin/watchdog/args.py,sha256=nKsG1G6ATOZlAMHMtT9u3kXxduKCbejSZ5x8oB_ynZ8,1312
237
237
  redisbench_admin/watchdog/watchdog.py,sha256=0wWYge3x_OMxWrzazNhJif2NK4tKsI963HVZqjczRag,6189
238
- redisbench_admin-0.11.41.dist-info/LICENSE,sha256=AAMtfs82zOOvmG68vILivm6lxi2rcOlGObmA8jzxQvw,10768
239
- redisbench_admin-0.11.41.dist-info/METADATA,sha256=doOixz08d09LZGCuGz9OsIuNdcP_1fYqxaiLwUacBCY,5596
240
- redisbench_admin-0.11.41.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
241
- redisbench_admin-0.11.41.dist-info/entry_points.txt,sha256=UUawXk_AS-PlieKJ1QxPQXGsRLb6OW_F0MtmA1W0KE8,113
242
- redisbench_admin-0.11.41.dist-info/RECORD,,
238
+ redisbench_admin-0.11.42.dist-info/LICENSE,sha256=AAMtfs82zOOvmG68vILivm6lxi2rcOlGObmA8jzxQvw,10768
239
+ redisbench_admin-0.11.42.dist-info/METADATA,sha256=s_waYOA4L1z-YQOS-p7DPaW8QWK2zzr2rsMSEAIVD7Y,5596
240
+ redisbench_admin-0.11.42.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
241
+ redisbench_admin-0.11.42.dist-info/entry_points.txt,sha256=UUawXk_AS-PlieKJ1QxPQXGsRLb6OW_F0MtmA1W0KE8,113
242
+ redisbench_admin-0.11.42.dist-info/RECORD,,