redisbench-admin 0.11.73__py3-none-any.whl → 0.11.74__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.
@@ -4,6 +4,7 @@
4
4
  # All rights reserved.
5
5
  #
6
6
  import logging
7
+ import os
7
8
  import tempfile
8
9
  import datetime
9
10
 
@@ -32,6 +33,7 @@ from redisbench_admin.utils.local import (
32
33
  check_dataset_local_requirements,
33
34
  is_process_alive,
34
35
  )
36
+ from redisbench_admin.utils.utils import setup_search_clusterset
35
37
 
36
38
 
37
39
  def local_db_spin(
@@ -163,6 +165,9 @@ def local_db_spin(
163
165
  r.client_setname("redisbench-admin-standalone")
164
166
  redis_conns.append(r)
165
167
 
168
+ # Setup search CLUSTERSET if enabled (after all servers are started and cluster is set up)
169
+ setup_search_clusterset(redis_conns, args.host, args.port, args.password)
170
+
166
171
  if dataset is None:
167
172
  if flushall_on_every_test_start:
168
173
  logging.info("Will flush all data at test start...")
@@ -213,8 +218,13 @@ def local_db_spin(
213
218
  )
214
219
  dbconfig_keyspacelen_check(benchmark_config, redis_conns, ignore_keyspace_errors)
215
220
 
216
- artifact_version = run_redis_pre_steps(
217
- benchmark_config, redis_conns[0], required_modules
218
- )
221
+ if 'SEARCH_CLUSTERSET' in os.environ:
222
+ logging.info("SEARCH_CLUSTERSET is set. Running run_redis_pre_steps for each shard")
223
+ for conn in redis_conns:
224
+ artifact_version = run_redis_pre_steps(benchmark_config, conn, required_modules)
225
+ else:
226
+ artifact_version = run_redis_pre_steps(
227
+ benchmark_config, redis_conns[0], required_modules
228
+ )
219
229
 
220
230
  return result, artifact_version, cluster_api_enabled, redis_conns, redis_processes
@@ -5,7 +5,7 @@
5
5
  #
6
6
  import datetime
7
7
  import logging
8
-
8
+ import os
9
9
  import redis
10
10
 
11
11
  from redisbench_admin.environments.oss_cluster import setup_redis_cluster_from_conns
@@ -37,6 +37,7 @@ from redisbench_admin.utils.remote import (
37
37
  check_dataset_remote_requirements,
38
38
  get_run_full_filename,
39
39
  )
40
+ from redisbench_admin.utils.utils import setup_search_clusterset
40
41
 
41
42
 
42
43
  def remote_tmpdir_prune(
@@ -277,6 +278,14 @@ def remote_db_spin(
277
278
  )
278
279
  server_plaintext_port = cluster_start_port
279
280
 
281
+ # Setup BigRedis CLUSTERSET if enabled (after all servers are started and cluster is set up)
282
+ setup_search_clusterset(
283
+ redis_conns,
284
+ server_private_ip,
285
+ cluster_start_port if cluster_enabled else server_plaintext_port,
286
+ redis_password,
287
+ )
288
+
280
289
  topology_setup_end_time = datetime.datetime.now()
281
290
  topology_setup_duration_seconds = (
282
291
  topology_setup_end_time - topology_setup_start_time
@@ -406,9 +415,12 @@ def remote_db_spin(
406
415
  ignore_keyspace_errors,
407
416
  keyspace_check_timeout,
408
417
  )
409
- artifact_version = run_redis_pre_steps(
410
- benchmark_config, redis_conns[0], required_modules
411
- )
418
+ if 'SEARCH_CLUSTERSET' in os.environ:
419
+ logging.info("SEARCH_CLUSTERSET is set. Running run_redis_pre_steps for each shard")
420
+ for conn in redis_conns:
421
+ artifact_version = run_redis_pre_steps(benchmark_config, conn, required_modules)
422
+ else:
423
+ artifact_version = run_redis_pre_steps(benchmark_config, redis_conns[0], required_modules)
412
424
  return (
413
425
  artifact_version,
414
426
  cluster_enabled,
@@ -583,6 +583,17 @@ def generate_remote_standalone_redis_cmd(
583
583
  )
584
584
  if remote_module_files is not None:
585
585
  initial_redis_cmd += " " + " ".join(command)
586
+
587
+ # Add BigRedis configuration if enabled via environment variable
588
+ if os.getenv("BIGREDIS_ENABLED") is not None:
589
+ bigredis_path = os.getenv("BIGREDIS_PATH", f"{temporary_dir}/redis.big")
590
+ bigredis_use_async = os.getenv("BIGREDIS_USE_ASYNC", "no")
591
+ logging.info(f"BigRedis enabled. Using bigredis-path: {bigredis_path}")
592
+ initial_redis_cmd += " --bigredis-enabled yes"
593
+ initial_redis_cmd += " --bigredis-driver speedb"
594
+ initial_redis_cmd += f" --bigredis-use-async {bigredis_use_async}"
595
+ initial_redis_cmd += f" --bigredis-path {bigredis_path}"
596
+
586
597
  return full_logfile, initial_redis_cmd
587
598
 
588
599
 
@@ -137,6 +137,75 @@ def generate_common_server_args(
137
137
  return command
138
138
 
139
139
 
140
+ def setup_search_clusterset(redis_conns, host="127.0.0.1", start_port=6379, password=None):
141
+ """
142
+ Configure SEARCH.CLUSTERSET for Redis instances.
143
+ This is required when SEARCH_CLUSTERSET is set to configure the search module
144
+ to work with BigRedis. Supports both standalone (single conn) and cluster (multiple conns).
145
+
146
+ Args:
147
+ redis_conns: List of Redis connection objects (or single connection)
148
+ host: Redis host address (default: 127.0.0.1)
149
+ start_port: Starting port number (default: 6379)
150
+ password: Redis password (optional)
151
+ """
152
+ if os.getenv("SEARCH_CLUSTERSET") is None:
153
+ return
154
+
155
+ # Handle single connection case
156
+ if not isinstance(redis_conns, list):
157
+ redis_conns = [redis_conns]
158
+
159
+ shard_count = len(redis_conns)
160
+ logging.info(f"Search Clusterset enabled - configuring SEARCH.CLUSTERSET for {shard_count} shard(s)")
161
+
162
+ # Calculate slots per shard
163
+ total_slots = 16384
164
+ slots_per_shard = total_slots // shard_count
165
+
166
+ for shard_id, conn in enumerate(redis_conns, start=1):
167
+ port = start_port + shard_id - 1
168
+
169
+ # Calculate slot range for this shard
170
+ slot_start = (shard_id - 1) * slots_per_shard
171
+ if shard_id == shard_count:
172
+ # Last shard gets remaining slots
173
+ slot_end = total_slots - 1
174
+ else:
175
+ slot_end = shard_id * slots_per_shard - 1
176
+
177
+ # Build the address string with optional password
178
+ if password:
179
+ addr = f"{password}@{host}:{port}"
180
+ else:
181
+ addr = f"{host}:{port}"
182
+
183
+ logging.info(
184
+ f"Sending SEARCH.CLUSTERSET to shard {shard_id}: "
185
+ f"slots {slot_start}-{slot_end}, addr {host}:{port}"
186
+ )
187
+
188
+ try:
189
+ conn.execute_command(
190
+ "SEARCH.CLUSTERSET",
191
+ "MYID",
192
+ str(shard_id),
193
+ "RANGES",
194
+ "1",
195
+ "SHARD",
196
+ str(shard_id),
197
+ "SLOTRANGE",
198
+ str(slot_start),
199
+ str(slot_end),
200
+ "ADDR",
201
+ addr,
202
+ "MASTER",
203
+ )
204
+ logging.info(f"SEARCH.CLUSTERSET command executed successfully for shard {shard_id}")
205
+ except Exception as e:
206
+ logging.warning(f"Failed to execute SEARCH.CLUSTERSET for shard {shard_id}: {e}")
207
+
208
+
140
209
  def upload_artifacts_to_s3(
141
210
  artifacts,
142
211
  s3_bucket_name,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: redisbench-admin
3
- Version: 0.11.73
3
+ Version: 0.11.74
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
  License-File: LICENSE
6
6
  Author: filipecosta90
@@ -82,7 +82,7 @@ redisbench_admin/run_async/run_async.py,sha256=nyOT-wx92NPW56zzoP9q4-T8U8utdqJAr
82
82
  redisbench_admin/run_local/__init__.py,sha256=DtBXRp0Q01XgCFmY-1OIePMyyYihVNAjZ1Y8zwqSDN0,101
83
83
  redisbench_admin/run_local/args.py,sha256=LPpqtx1cH1dkkeHjYlaFnAp_TijxnzPZFO2CmYD9ikU,1906
84
84
  redisbench_admin/run_local/local_client.py,sha256=gwawMDOBrf7m--uyxu8kMZC5LBiLjbUBSKvzVOdOAas,124
85
- redisbench_admin/run_local/local_db.py,sha256=9vINqKOs-wDMFEuEHT0I8KO9YnEo_h4NWNk5da3LwSY,7518
85
+ redisbench_admin/run_local/local_db.py,sha256=aIaGGxbv8ZqQSVKDOJsZomOBDebXf04aK5O2F-ZgAHk,8050
86
86
  redisbench_admin/run_local/local_helpers.py,sha256=JyqLW2-Sbm35BXjxxfOB1yK7ADdLfcVrq08NLNdIwac,7026
87
87
  redisbench_admin/run_local/run_local.py,sha256=tqnxpbP-yDT45Ai55liwsBo15FokxEXTAV-9tGuBjZU,35331
88
88
  redisbench_admin/run_remote/__init__.py,sha256=DtBXRp0Q01XgCFmY-1OIePMyyYihVNAjZ1Y8zwqSDN0,101
@@ -91,12 +91,12 @@ redisbench_admin/run_remote/consts.py,sha256=bCMkwyeBD-EmOpoHKni7LjWy5WuaxGJhGhq
91
91
  redisbench_admin/run_remote/log.py,sha256=cD7zfXt0VEmy0b7452HvcAxX_9kVj6Vm213yNdUHP20,95
92
92
  redisbench_admin/run_remote/notifications.py,sha256=-W9fLaftEFNfplBl2clHk37jbYxliDbHftQ62khN31k,2157
93
93
  redisbench_admin/run_remote/remote_client.py,sha256=rRmDro1weto01wzqYpId8NMPoizEzSyudXBCjYrBVMs,14128
94
- redisbench_admin/run_remote/remote_db.py,sha256=iDcIqDPskl2hgZm1yP2DTBnSnwvpze8hEmim97uKJ3Y,15643
94
+ redisbench_admin/run_remote/remote_db.py,sha256=jmnUZEM36vb6RKRik9i3d_v6CMkuMoJXyjcaBFTqyRk,16257
95
95
  redisbench_admin/run_remote/remote_env.py,sha256=Ux_0QT1unNRlKl3cakzjG5Px1uuxOOfBoF_pnalx_T8,4936
96
96
  redisbench_admin/run_remote/remote_failures.py,sha256=IOo6DyxarcwwMPCeN4gWB2JrhuC9iBLwq0nCROqr5ak,1567
97
97
  redisbench_admin/run_remote/remote_helpers.py,sha256=nuTGasAfDarkZajrSt36a8QCEB0vycAyR8qbOqwlrXI,13717
98
98
  redisbench_admin/run_remote/run_remote.py,sha256=PVNfdaa8jW8Pjn0zknNSVcMA0fvv-Y8Y3waaL3xp6cw,78745
99
- redisbench_admin/run_remote/standalone.py,sha256=JzB-YPKkCp7IwNqULHBn4oRItn4bDHfyTGesTLLh5O0,34813
99
+ redisbench_admin/run_remote/standalone.py,sha256=8wX2W8MPTUvFUWzYVXcM-llSu454pqg3h3BD1jrGxNQ,35414
100
100
  redisbench_admin/run_remote/terraform.py,sha256=vV3eWXNwj7vsnFNqUgCir5ueZS4VYopEyzWiTtoSq0Q,4018
101
101
  redisbench_admin/utils/__init__.py,sha256=DtBXRp0Q01XgCFmY-1OIePMyyYihVNAjZ1Y8zwqSDN0,101
102
102
  redisbench_admin/utils/benchmark_config.py,sha256=BDUGKLekFPWJC1cZN7oNZPtf-zKbXEE0jHk0rnPh8Go,22787
@@ -106,12 +106,12 @@ redisbench_admin/utils/redisgraph_benchmark_go.py,sha256=os7EJt6kBxsFJLKkSoANbjM
106
106
  redisbench_admin/utils/remote.py,sha256=Kjz1VQfy1Y7jQwef26vz5KYhHrUxMHtMXXvgPmTjGy4,45206
107
107
  redisbench_admin/utils/results.py,sha256=uKk3uNJ--bSXlUj_HGQ2OaV6MVqmXJVM8xTzFV6EOw4,3267
108
108
  redisbench_admin/utils/ssh.py,sha256=QW4AwlocMHJt05QMdN_4f8WeDmxiEwR80ny8VBThq6k,6533
109
- redisbench_admin/utils/utils.py,sha256=YG7I8bXlxA4RO6NUp9UyPCl0MaXYlYGFqCCIg2PvUjA,17824
109
+ redisbench_admin/utils/utils.py,sha256=g6bhaFrKYmQS5_SEADLqgRmn74CL9RyyieO7N8PvoxA,20208
110
110
  redisbench_admin/watchdog/__init__.py,sha256=cD7zfXt0VEmy0b7452HvcAxX_9kVj6Vm213yNdUHP20,95
111
111
  redisbench_admin/watchdog/args.py,sha256=nKsG1G6ATOZlAMHMtT9u3kXxduKCbejSZ5x8oB_ynZ8,1312
112
112
  redisbench_admin/watchdog/watchdog.py,sha256=0wWYge3x_OMxWrzazNhJif2NK4tKsI963HVZqjczRag,6189
113
- redisbench_admin-0.11.73.dist-info/METADATA,sha256=Wa6nGTUYi878yMi3PPtjNruXYilxfQNQo8xhhH_WfRw,5724
114
- redisbench_admin-0.11.73.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
115
- redisbench_admin-0.11.73.dist-info/entry_points.txt,sha256=UUawXk_AS-PlieKJ1QxPQXGsRLb6OW_F0MtmA1W0KE8,113
116
- redisbench_admin-0.11.73.dist-info/licenses/LICENSE,sha256=AAMtfs82zOOvmG68vILivm6lxi2rcOlGObmA8jzxQvw,10768
117
- redisbench_admin-0.11.73.dist-info/RECORD,,
113
+ redisbench_admin-0.11.74.dist-info/METADATA,sha256=JeE5GmltS1NydTz7FWimzRF-jHZuNBGJS7BcdnXH3CM,5724
114
+ redisbench_admin-0.11.74.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
115
+ redisbench_admin-0.11.74.dist-info/entry_points.txt,sha256=UUawXk_AS-PlieKJ1QxPQXGsRLb6OW_F0MtmA1W0KE8,113
116
+ redisbench_admin-0.11.74.dist-info/licenses/LICENSE,sha256=AAMtfs82zOOvmG68vILivm6lxi2rcOlGObmA8jzxQvw,10768
117
+ redisbench_admin-0.11.74.dist-info/RECORD,,