|
51 | 51 | remote_db_spin,
|
52 | 52 | db_error_artifacts,
|
53 | 53 | )
|
| 54 | +from redisbench_admin.run_remote.standalone import spin_test_standalone_redis |
54 | 55 | from redisbench_admin.run_remote.remote_env import remote_env_setup
|
55 | 56 | from redisbench_admin.run_remote.remote_failures import failed_remote_run_artifact_store
|
56 | 57 | from redisbench_admin.run_remote.terraform import (
|
@@ -122,12 +123,15 @@ def run_remote_command_logic(args, project_name, project_version):
|
122 | 123 | tf_setup_name_sufix = "{}-{}".format(args.setup_name_sufix, tf_github_sha)
|
123 | 124 | s3_bucket_name = args.s3_bucket_name
|
124 | 125 | local_module_files = args.module_path
|
125 |
| - for pos, module_file in enumerate(local_module_files): |
126 |
| - if " " in module_file: |
127 |
| - logging.info( |
128 |
| - "Detected multiple files in single module path {}".format(module_file) |
129 |
| - ) |
130 |
| - local_module_files[pos] = module_file.split(" ") |
| 126 | + if local_module_files is not None: |
| 127 | + for pos, module_file in enumerate(local_module_files): |
| 128 | + if " " in module_file: |
| 129 | + logging.info( |
| 130 | + "Detected multiple files in single module path {}".format( |
| 131 | + module_file |
| 132 | + ) |
| 133 | + ) |
| 134 | + local_module_files[pos] = module_file.split(" ") |
131 | 135 | dbdir_folder = args.dbdir_folder
|
132 | 136 | private_key = args.private_key
|
133 | 137 | grafana_profile_dashboard = args.grafana_profile_dashboard
|
@@ -238,6 +242,50 @@ def run_remote_command_logic(args, project_name, project_version):
|
238 | 242 |
|
239 | 243 | ssh_pem_check(EC2_PRIVATE_PEM, private_key)
|
240 | 244 |
|
| 245 | + # Handle spin-test mode |
| 246 | + if args.spin_test: |
| 247 | + logging.info( |
| 248 | + "🚀 Spin-test mode detected - setting up standalone Redis and running INFO SERVER" |
| 249 | + ) |
| 250 | + |
| 251 | + # Parse inventory to get server details |
| 252 | + if args.inventory is None: |
| 253 | + logging.error( |
| 254 | + "❌ --spin-test requires --inventory to specify the remote server" |
| 255 | + ) |
| 256 | + exit(1) |
| 257 | + |
| 258 | + # Parse inventory string |
| 259 | + inventory_parts = args.inventory.split(",") |
| 260 | + server_public_ip = None |
| 261 | + |
| 262 | + for part in inventory_parts: |
| 263 | + if "=" in part: |
| 264 | + key, value = part.split("=", 1) |
| 265 | + if key.strip() == "server_public_ip": |
| 266 | + server_public_ip = value.strip() |
| 267 | + break |
| 268 | + |
| 269 | + if server_public_ip is None: |
| 270 | + logging.error("❌ --spin-test requires server_public_ip in --inventory") |
| 271 | + exit(1) |
| 272 | + |
| 273 | + # Run spin test |
| 274 | + success = spin_test_standalone_redis( |
| 275 | + server_public_ip=server_public_ip, |
| 276 | + username=args.user, |
| 277 | + private_key=private_key, |
| 278 | + db_ssh_port=args.db_ssh_port, |
| 279 | + redis_port=args.db_port, |
| 280 | + local_module_files=local_module_files, |
| 281 | + redis_configuration_parameters=None, |
| 282 | + modules_configuration_parameters_map=None, |
| 283 | + custom_redis_conf_path=args.redis_conf, |
| 284 | + custom_redis_server_path=args.redis_server_binary, |
| 285 | + ) |
| 286 | + |
| 287 | + exit(0 if success else 1) |
| 288 | + |
241 | 289 | (
|
242 | 290 | benchmark_defs_result,
|
243 | 291 | benchmark_definitions,
|
|
0 commit comments