P3.2 — Multi-node deployment: - Added node-worker service to docker-compose.node1.yml (NODE_ID=noda1) - NCS NODA1 now has NODE_WORKER_URL for metrics collection - Fixed NODE_ID consistency: router NODA1 uses 'noda1' - NODA2 node-worker/NCS gets NCS_REPORT_URL for latency reporting P3.3 — NATS accounts/auth (opt-in config): - config/nats-server.conf with 3 accounts: SYS, FABRIC, APP - Per-user topic permissions (router, ncs, node_worker) - Leafnode listener :7422 with auth - Not yet activated (requires credential provisioning) P3.4 — Prometheus counters: - Router /fabric_metrics: caps_refresh, caps_stale, model_select, offload_total, breaker_state, score_ms histogram - Node Worker /prom_metrics: jobs_total, inflight gauge, latency_ms histogram - NCS /prom_metrics: runtime_health, runtime_p50/p95, node_wait_ms - All bound to 127.0.0.1 (not externally exposed) Made-with: Cursor
117 lines
2.6 KiB
Plaintext
117 lines
2.6 KiB
Plaintext
# NATS Server config — Fabric v0.3 with accounts
|
|
# Hub node (NODA1). Leafnodes connect to this.
|
|
|
|
listen: 0.0.0.0:4222
|
|
jetstream {
|
|
store_dir: /data/jetstream
|
|
max_mem: 256MB
|
|
max_file: 2GB
|
|
}
|
|
|
|
http_port: 8222
|
|
|
|
# ── Accounts ────────────────────────────────────────────────────────────────
|
|
|
|
accounts {
|
|
SYS {
|
|
users: [
|
|
{ user: sys, password: "$SYS_NATS_PASS" }
|
|
]
|
|
}
|
|
|
|
FABRIC {
|
|
users: [
|
|
# Router — publishes capability queries + offload requests
|
|
{
|
|
user: router
|
|
password: "$FABRIC_NATS_PASS"
|
|
permissions: {
|
|
publish: {
|
|
allow: [
|
|
"node.*.capabilities.get",
|
|
"node.*.llm.request",
|
|
"node.*.vision.request",
|
|
"node.*.stt.request",
|
|
"node.*.tts.request",
|
|
"_INBOX.>"
|
|
]
|
|
}
|
|
subscribe: {
|
|
allow: ["_INBOX.>"]
|
|
}
|
|
}
|
|
}
|
|
# NCS — responds to capability queries
|
|
{
|
|
user: ncs
|
|
password: "$FABRIC_NATS_PASS"
|
|
permissions: {
|
|
publish: {
|
|
allow: ["_INBOX.>"]
|
|
}
|
|
subscribe: {
|
|
allow: [
|
|
"node.*.capabilities.get",
|
|
"node.*.capabilities.report"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
# Node Worker — responds to inference requests
|
|
{
|
|
user: node_worker
|
|
password: "$FABRIC_NATS_PASS"
|
|
permissions: {
|
|
publish: {
|
|
allow: [
|
|
"_INBOX.>",
|
|
"node.*.capabilities.report"
|
|
]
|
|
}
|
|
subscribe: {
|
|
allow: [
|
|
"node.*.llm.request",
|
|
"node.*.vision.request",
|
|
"node.*.stt.request",
|
|
"node.*.tts.request"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
exports: [
|
|
{ stream: ">" }
|
|
]
|
|
}
|
|
|
|
APP {
|
|
users: [
|
|
# Gateway, other services
|
|
{
|
|
user: app
|
|
password: "$APP_NATS_PASS"
|
|
permissions: {
|
|
publish: { allow: [">"] }
|
|
subscribe: { allow: [">"] }
|
|
}
|
|
}
|
|
]
|
|
imports: [
|
|
{ stream: { account: FABRIC, subject: ">" } }
|
|
]
|
|
}
|
|
}
|
|
|
|
system_account: SYS
|
|
|
|
# ── Leafnode listener ───────────────────────────────────────────────────────
|
|
|
|
leafnodes {
|
|
listen: 0.0.0.0:7422
|
|
authorization {
|
|
user: leaf
|
|
password: "$LEAF_NATS_PASS"
|
|
account: FABRIC
|
|
}
|
|
}
|