Distributed cluster management with leader election, scheduling, and rebalancing.
- Cluster nodes — register nodes with roles (LEADER, WORKER, STANDBY) and health tracking
- Leader election — automatic leader election with failure recovery
- Task scheduling — distribute tasks across nodes with configurable strategies (round-robin, least-loaded, capability-match)
- Rebalancing — automatically redistribute work when nodes join, leave, or fail
- Mixed language — Rust benches + Python orchestration logic
pip install cluster-orchestratorfrom cluster_orchestrator import Cluster, ClusterNode, NodeRole, Scheduler, LeaderElection
# Create a cluster
cluster = Cluster()
cluster.add_node(ClusterNode(id="node-1", role=NodeRole.LEADER, capabilities=["python", "rust"]))
cluster.add_node(ClusterNode(id="node-2", role=NodeRole.WORKER, capabilities=["python"]))
cluster.add_node(ClusterNode(id="node-3", role=NodeRole.WORKER, capabilities=["docs"]))
# Elect a leader
election = LeaderElection(cluster)
leader = election.run()
print(f"Leader: {leader.id}")
# Schedule tasks
scheduler = Scheduler(cluster)
assignment = scheduler.schedule(task="Build Rust library", strategy="capability-match")
print(f"Assigned to: {assignment.node_id}")
# Rebalance on node failure
cluster.mark_unhealthy("node-2")
from cluster_orchestrator import Rebalancer
rebalancer = Rebalancer(cluster)
rebalancer.rebalance()The cluster management layer for the SuperInstance fleet. Operates above agent-grid (topology) and below captain (fleet command).
- captain — Fleet commanding (delegates to cluster orchestrator)
- agent-grid — Grid topology (node-level)
- fleet-health-monitor — Health monitoring
pytest tests/pip install cluster-orchestratorPython 3.10+. MIT license.