propagation: single registry drives all node references
New bin/netvm-registry.py parses NODES.md (node -> cdp_port); every consumer reads from it instead of hardcoding: - onboard-driver.py: CDP_PORTS dict -> registry lookup (new nodes work) - muse-signin.py: hardcoded 9410 -> --node/--cdp-port args - muse-chat-api.py: hardcoded ACCOUNTS -> registry-built - agent-health.sh: hardcoded muse/pip blocks -> loop over all active nodes (646 and opm now get health coverage too) NODES.md: record opm node (9440).
This commit is contained in:
+17
-7
@@ -16,14 +16,24 @@ Usage:
|
||||
muse-chat-api.py --account <agent> wait [timeout]
|
||||
muse-chat-api.py --account <agent> approvals # check pending approvals
|
||||
"""
|
||||
import json, urllib.request, websocket, time, sys, argparse
|
||||
import json, urllib.request, websocket, time, sys, argparse, importlib.util
|
||||
|
||||
ACCOUNTS = {
|
||||
"muse": ("muse", "http://127.0.0.1:9410/json/list"),
|
||||
"pip": ("pip", "http://127.0.0.1:9420/json/list"),
|
||||
"646": ("646", "http://127.0.0.1:9430/json/list"),
|
||||
"opm": ("opm", "http://127.0.0.1:9440/json/list"),
|
||||
}
|
||||
|
||||
def _load_accounts():
|
||||
"""Build the accounts table from the NODES.md registry — new nodes
|
||||
propagate automatically instead of being hardcoded here."""
|
||||
path = "/home/super/Projects/NetVM/bin/netvm-registry.py"
|
||||
spec = importlib.util.spec_from_file_location("netvm_registry", path)
|
||||
mod = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(mod)
|
||||
accounts = {}
|
||||
for node, rec in mod.load().items():
|
||||
accounts[node] = (node, "http://127.0.0.1:%d/json/list" %
|
||||
rec["cdp_port"])
|
||||
return accounts
|
||||
|
||||
|
||||
ACCOUNTS = _load_accounts()
|
||||
|
||||
# IPs we trust for auto-approval (our infrastructure)
|
||||
TRUSTED_IPS = {
|
||||
|
||||
Reference in New Issue
Block a user