conductor(checkpoint): Checkpoint end of Phase 2

This commit is contained in:
2026-02-08 07:54:49 -08:00
parent a686c5b225
commit 6d77729a4a
7 changed files with 196 additions and 6 deletions

View File

@@ -4,11 +4,13 @@ import sys
import config
import cluster_aggregator
import output_formatter
import nomad_client
def parse_args():
parser = argparse.ArgumentParser(description="Monitor Navidrome LiteFS/Consul cluster status.")
parser.add_argument("--consul-url", help="Override Consul API URL (default from env or hardcoded)")
parser.add_argument("--no-color", action="store_true", help="Disable colorized output")
parser.add_argument("--restart", help="Restart the allocation on the specified node")
return parser.parse_args()
def main():
@@ -17,6 +19,19 @@ def main():
# Resolve Consul URL
consul_url = config.get_consul_url(args.consul_url)
# Handle restart if requested
if args.restart:
print(f"Attempting to restart allocation on node: {args.restart}...")
alloc_id = nomad_client.get_allocation_id(args.restart, "navidrome-litefs")
if alloc_id:
if nomad_client.restart_allocation(alloc_id):
print(f"Successfully sent restart signal to allocation {alloc_id}")
else:
print(f"Failed to restart allocation {alloc_id}")
else:
print(f"Could not find allocation for node {args.restart}")
print("-" * 30)
try:
# Fetch and aggregate data
cluster_data = cluster_aggregator.get_cluster_status(consul_url)