feat(cluster_mgr): Add argument to set path to dragonfly binary (#4695)

Add optional argument to cluster_mgr script so that we can run cluster with different builds.

Signed-off-by: mkaruza <mario@dragonflydb.io>
This commit is contained in:
mkaruza 2025-03-04 12:52:24 +01:00 committed by GitHub
parent b729a268ca
commit debb2eb9e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,12 +34,12 @@ class Master:
self.replicas = []
def start_node(node, threads):
def start_node(node, dragonfly_bin, threads):
f = open(f"/tmp/dfly.cluster.node.{node.port}.log", "w")
print(f"- Log file for node {node.port}: {f.name}")
subprocess.Popen(
[
"../build-opt/dragonfly",
f"{dragonfly_bin}",
f"--port={node.port}",
"--cluster_mode=yes",
f"--proactor_threads={threads}",
@ -140,7 +140,7 @@ def create_locally(args):
print("Starting nodes...")
for node in nodes:
start_node(node, args.threads)
start_node(node, args.dragonfly_bin, args.threads)
print()
if args.replicas_per_master > 0:
@ -444,7 +444,7 @@ Dragonfly Manual Cluster Manager
This tool helps managing a Dragonfly cluster manually.
Cluster can either be local or remote:
- Starting Dragonfly instances must be done locally, binary is assumed to be under ../build-opt
- Starting Dragonfly instances must be done locally, binary path can be set with `--dragonfly_bin` (default: ../build-opt/dragonfly)
- Remote Dragonflies must already be started, and initialized with `--cluster_mode=yes`
Example usage:
@ -538,6 +538,9 @@ WARNING: Be careful! This will close all Dragonfly servers connected to the clus
parser.add_argument(
"--attach_as_replica", type=bool, default=False, help="Is the attached node a replica?"
)
parser.add_argument(
"--dragonfly_bin", default="../build-opt/dragonfly", help="Dragonfly binary path"
)
args = parser.parse_args()
actions = dict(