Files
atc-agents/ui/src/lib/infraCatalog.ts
T

211 lines
5.7 KiB
TypeScript
Raw Normal View History

import type { LucideIcon } from 'lucide-react'
import {
Database,
HardDrive,
Layers,
MessageSquare,
Server,
Sparkles,
Workflow,
} from 'lucide-react'
export type InfraApp = {
label: string
url: string
port?: string
}
export type InfraNode = {
id: string
label: string
vm: string
ip: string
zone: string
agentId: string
icon: LucideIcon
accent: string
description: string
ssh: string
apps: InfraApp[]
topoIds: string[]
}
export const INFRA_CATALOG: InfraNode[] = [
{
id: 'db',
label: 'DB Vault',
vm: 'atc-db02',
ip: '10.0.21.51',
zone: 'db',
agentId: 'data-custodian',
icon: Database,
accent: '#34d399',
description: 'PostgreSQL, MySQL, MongoDB, Cassandra, Neo4j — CDC sources',
ssh: 'ssh root@10.0.21.51',
apps: [
{ label: 'Dockhand env 5', url: 'http://10.0.21.45:8082', port: '8082' },
{ label: 'PostgreSQL', url: 'postgresql://10.0.21.51:5432/postgres', port: '5432' },
{ label: 'MongoDB', url: 'mongodb://10.0.21.51:27017/', port: '27017' },
],
topoIds: ['postgresql', 'mysql', 'mongodb', 'cassandra', 'src-postgres', 'src-mysql', 'src-mongo', 'src-cassandra'],
},
{
id: 'airflow',
label: 'Airflow',
vm: 'atc-airflow01',
ip: '10.0.21.55',
zone: 'etl',
agentId: 'etl-guardian',
icon: Workflow,
accent: '#38bdf8',
description: 'DAG orchestration — daily data generation on all sources',
ssh: 'ssh root@10.0.21.55',
apps: [{ label: 'Airflow UI', url: 'http://10.0.21.55:8080', port: '8080' }],
topoIds: ['airflow', 'src-airflow'],
},
{
id: 'kafka',
label: 'Kafka Bus',
vm: 'atc-kafka01',
ip: '10.0.21.36',
zone: 'etl',
agentId: 'etl-guardian',
icon: MessageSquare,
accent: '#4c9aed',
description: 'Event bus — CDC topics & consumer streams',
ssh: 'ssh root@10.0.21.36',
apps: [{ label: 'Kafka UI', url: 'http://10.0.21.36:9000', port: '9000' }],
topoIds: ['kafka', 'stream-kafka'],
},
{
id: 'debezium',
label: 'Debezium CDC',
vm: 'atc-lake01',
ip: '10.0.21.50',
zone: 'lakehouse',
agentId: 'etl-guardian',
icon: Workflow,
accent: '#c77dff',
description: 'Kafka Connect — row-level CDC from source DBs',
ssh: 'ssh root@10.0.21.50',
apps: [{ label: 'Kafka Connect', url: 'http://10.0.21.50:8083', port: '8083' }],
topoIds: ['debezium', 'cdc-postgres', 'cdc-mysql', 'cdc-mongo', 'cdc-cassandra'],
},
{
id: 'lakehouse',
label: 'Lakehouse Hub',
vm: 'atc-lake01',
ip: '10.0.21.50',
zone: 'lakehouse',
agentId: 'lakehouse-ops',
icon: Layers,
accent: '#818cf8',
description: 'Spark, Trino, s3-kafka-consumer, Iceberg catalog',
ssh: 'ssh root@10.0.21.50',
apps: [
{ label: 'Trino', url: 'http://10.0.21.50:8089', port: '8089' },
{ label: 'Spark UI', url: 'http://10.0.21.50:8080', port: '8080' },
{ label: 'Kafka Connect', url: 'http://10.0.21.50:8083', port: '8083' },
],
topoIds: ['spark', 'trino', 'iceberg', 'stream-spark', 'lake-iceberg', 'query-trino', 'cons-notebooks'],
},
{
id: 's3',
label: 'ObjectScale S3',
vm: 'atc-objectscale',
ip: '10.0.20.111',
zone: 's3',
agentId: 'lakehouse-ops',
icon: HardDrive,
accent: '#d4a017',
description: 'Dell ECS S3 — Iceberg landing zone (bucket: data)',
ssh: 'ssh root@10.0.20.111',
apps: [{ label: 'S3 API', url: 'http://10.0.20.111:9020', port: '9020' }],
topoIds: ['s3', 'lake-s3'],
},
{
id: 'docker',
label: 'Docker Rack',
vm: 'atc-docker01',
ip: '10.0.21.45',
zone: 'docker',
agentId: 'infra-sentinel',
icon: Server,
accent: '#94a3b8',
description: 'Homepage, Dockhand, Superset, monitoring stack',
ssh: 'ssh root@10.0.21.45',
apps: [
{ label: 'Homepage', url: 'http://10.0.21.45', port: '80' },
{ label: 'Dockhand', url: 'http://10.0.21.45:8082', port: '8082' },
{ label: 'Superset', url: 'http://10.0.21.45:8088', port: '8088' },
],
topoIds: ['bi', 'cons-bi'],
},
{
id: 'hadoop',
label: 'Hadoop HDFS',
vm: 'atc-hadoop-m01',
ip: '10.0.21.61',
zone: 'hadoop',
agentId: 'hadoop-ranger',
icon: Server,
accent: '#4ade80',
description: '9-node HDFS cluster — parallel storage layer',
ssh: 'ssh root@10.0.21.61',
apps: [{ label: 'NameNode UI', url: 'http://10.0.21.61:9870', port: '9870' }],
topoIds: [],
},
{
id: 'gpu',
label: 'GPU Lab',
vm: 'atc-gpu-dev',
ip: '10.0.20.106',
zone: 'gpu',
agentId: 'infra-sentinel',
icon: Sparkles,
accent: '#3fb950',
description: 'vLLM inference — Llama 3 70B on 4× V100',
ssh: 'ssh root@10.0.20.106',
apps: [
{ label: 'GPU Lab UI', url: 'http://10.0.20.106:9000', port: '9000' },
{ label: 'vLLM API', url: 'http://10.0.20.106:8001/v1', port: '8001' },
],
topoIds: ['llm', 'cons-ml'],
},
{
id: 'command',
label: 'Command Center',
vm: 'MCP · VM304',
ip: '10.0.21.33',
zone: 'command',
agentId: 'mcp-coordinator',
icon: Server,
accent: '#60a5fa',
description: 'This dashboard — agents, approvals, LLM routing',
ssh: 'ssh root@10.0.21.33',
apps: [
{ label: 'Dashboard', url: 'http://10.0.21.33/', port: '80' },
{ label: 'API', url: 'http://10.0.21.33/api', port: '80' },
],
topoIds: [],
},
]
export function resolveInfraNode(nodeId: string | null): InfraNode | null {
if (!nodeId) return null
return (
INFRA_CATALOG.find((n) => n.id === nodeId) ||
INFRA_CATALOG.find((n) => n.topoIds.includes(nodeId)) ||
null
)
}
export async function copyShellCommand(cmd: string) {
try {
await navigator.clipboard.writeText(cmd)
return true
} catch {
return false
}
}