multiple profiles run

This commit is contained in:
Peter Howell 2025-10-16 00:38:48 +00:00
parent 95e00121a3
commit d9646d729d
3 changed files with 2057 additions and 1209 deletions

View File

@ -381,11 +381,121 @@ async function loadGraphAndBuildElements(region = 'us-west-1') {
return elements; return elements;
} }
// Initialize: fetch graph, add elements, run layout, set up HTML labels and helpers // Safely add nodes and edges to Cytoscape, skipping edges that reference
(async function init(){ // endpoints we do not have data for so the layout keeps running.
function addElementsSafely(targetCy, elements) {
const nodes = [];
const edges = [];
for (const element of elements) {
const data = element && element.data;
if (data && (data.source != null || data.target != null)) {
edges.push(element);
} else {
nodes.push(element);
}
}
const availableNodeIds = new Set();
targetCy.nodes().forEach(n => availableNodeIds.add(n.id()));
for (const node of nodes) {
const data = node && node.data;
if (data && data.id != null) availableNodeIds.add(String(data.id));
}
const skippedNodes = [];
try {
targetCy.add(nodes);
} catch (err) {
console.error('Failed adding nodes to Cytoscape in bulk, retrying individually.', err);
for (const node of nodes) {
try {
targetCy.add(node);
} catch (nodeErr) {
const data = node && node.data;
skippedNodes.push({
id: data && data.id,
reason: nodeErr && nodeErr.message ? nodeErr.message : 'node add failed'
});
if (data && data.id != null) {
const idStr = String(data.id);
const stillExists = !targetCy.getElementById(idStr).empty();
if (!stillExists) availableNodeIds.delete(idStr);
}
}
}
}
const validEdges = [];
const skippedEdges = [];
for (const edge of edges) {
const data = edge && edge.data;
const source = data && data.source;
const target = data && data.target;
let reason = '';
if (!source && !target) {
reason = 'missing source and target ids';
} else if (!source) {
reason = 'missing source id';
} else if (!target) {
reason = 'missing target id';
} else if (!availableNodeIds.has(String(source)) && !availableNodeIds.has(String(target))) {
reason = 'missing source and target nodes';
} else if (!availableNodeIds.has(String(source))) {
reason = `missing source node: ${source}`;
} else if (!availableNodeIds.has(String(target))) {
reason = `missing target node: ${target}`;
}
if (reason) {
skippedEdges.push({
id: data && data.id,
source,
target,
reason
});
continue;
}
validEdges.push(edge);
}
if (validEdges.length) {
try {
targetCy.add(validEdges);
} catch (err) {
console.error('Failed adding some edges to Cytoscape.', err);
for (const edge of validEdges) {
try {
targetCy.add(edge);
} catch (edgeErr) {
const data = edge && edge.data;
skippedEdges.push({
id: data && data.id,
source: data && data.source,
target: data && data.target,
reason: edgeErr && edgeErr.message ? edgeErr.message : 'edge add failed'
});
}
}
}
}
if (skippedNodes.length) {
console.warn('Skipped nodes due to add errors:', skippedNodes);
}
if (skippedEdges.length) {
console.warn('Skipped edges due to missing endpoints or add errors:', skippedEdges);
}
return { skippedNodes, skippedEdges };
}
// Initialize: fetch graph, add elements, run layout, set up HTML labels and helpers
(async function init(){
await loadDiagramConfig(); await loadDiagramConfig();
const elements = await loadGraphAndBuildElements('us-west-1'); const elements = await loadGraphAndBuildElements('us-west-1');
cy.add(elements); addElementsSafely(cy, elements);
cy.nodes().forEach(n => { if (n.data('lx') == null) n.data('lx',0); if (n.data('ly') == null) n.data('ly',0); }); cy.nodes().forEach(n => { if (n.data('lx') == null) n.data('lx',0); if (n.data('ly') == null) n.data('ly',0); });
runLayout(); runLayout();

1296
graph.json Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,441 +1,633 @@
{ {
"nodes": { "nodes": {
"account:acct-shared": { "account:874922373146": {
"position": { "position": {
"x": 2005.5164890789051, "x": -1043.0833581134266,
"y": 1112.2739169237752 "y": 1106.3445375122078
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"account:acct-prod": { "account:233470958222": {
"position": { "position": {
"x": -814.0708768306696, "x": 2201.134712892114,
"y": 1653.4126921251755 "y": 122.20468249596621
},
"lx": 0,
"ly": 0
},
"account:368939514974": {
"position": {
"x": 2279.3173977752394,
"y": 1221.4591721337483
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"vpc-87832de2": { "vpc-87832de2": {
"position": { "position": {
"x": 1659.7133575233456, "x": -285.2946165882403,
"y": 513.9754219463099 "y": 160.80488192250868
}, },
"lx": 73.49444680832619, "lx": 73.49444680832619,
"ly": 209.94473204635727 "ly": 209.94473204635727
}, },
"vpc-c84eabad": { "vpc-c84eabad": {
"position": { "position": {
"x": -47.25, "x": -1383.3839486836919,
"y": -18.25 "y": 2413.0707327306486
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"vpc-331ad056": { "vpc-331ad056": {
"position": { "position": {
"x": -967.4533224282068, "x": -2139.7279547537837,
"y": 907.0632390302223 "y": 585.577595815337
}, },
"lx": -134.22057243218103, "lx": -134.22057243218103,
"ly": 551.6318031828098 "ly": 551.6318031828098
}, },
"vpc-afe722ca": { "vpc-afe722ca": {
"position": { "position": {
"x": -563.6312192940503, "x": -2895.9923434832026,
"y": 2990.9848437681812 "y": 2131.201547542134
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"vpc-03f799f47b766798c": { "vpc-03f799f47b766798c": {
"position": { "position": {
"x": 1926.2412804626993, "x": -426.3006648943611,
"y": 874.4789294499092 "y": 1257.4026694118322
},
"lx": 0,
"ly": 0
},
"vpc-b5ac9ed2": {
"position": {
"x": 2673.3906370035616,
"y": 134.2046824959662
},
"lx": 0,
"ly": 0
},
"vpc-1a8dba7d": {
"position": {
"x": 2587.489786983655,
"y": 1145.224939916271
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"subnet-260ee27f": { "subnet-260ee27f": {
"position": { "position": {
"x": -1370.4494604541483, "x": -2561.974092779725,
"y": 1184.4611007903993 "y": 868.2254575755139
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"subnet-f73afeae": { "subnet-f73afeae": {
"position": { "position": {
"x": 0, "x": -1191.5246323255776,
"y": 0 "y": -316.2356432148855
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"subnet-ebc4188e": { "subnet-ebc4188e": {
"position": { "position": {
"x": -514.6233235686249, "x": -2846.984447757777,
"y": 2693.894303286011 "y": 1834.1110070599643
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"subnet-005bfd58e719e031f": { "subnet-005bfd58e719e031f": {
"position": { "position": {
"x": 3237.329690501032, "x": 106.52478438142475,
"y": 365.41687861255815 "y": -110.44629924838836
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"subnet-035f81142068bf961": { "subnet-035f81142068bf961": {
"position": { "position": {
"x": 2410.1141180477457, "x": -102.58259880403784,
"y": 1742.7078588998183 "y": 1040.4795337290602
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"subnet-d137fd88": { "subnet-d137fd88": {
"position": { "position": {
"x": 3334.1563633285305, "x": 203.35145720892342,
"y": 855.6631466915302 "y": 379.7999688305838
}, },
"lx": -95.54884268669878, "lx": -95.54884268669878,
"ly": -183.7839139599664 "ly": -183.7839139599664
}, },
"subnet-e98e088c": { "subnet-e98e088c": {
"position": { "position": {
"x": -914.4098453851616, "x": -2105.9344777107394,
"y": 1819.8764780604447 "y": 1503.6408348455595
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"subnet-08e40dcdc103438b8": { "subnet-08e40dcdc103438b8": {
"position": { "position": {
"x": 0, "x": -765.9920091508945,
"y": 0 "y": 485.53271950483816
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"subnet-0cb2aa7457413f5fe": { "subnet-0cb2aa7457413f5fe": {
"position": { "position": {
"x": 0, "x": -670.1452283760766,
"y": 0 "y": 930.8221876740131
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"subnet-247a9341": { "subnet-247a9341": {
"position": { "position": {
"x": 0, "x": -1343.457549155559,
"y": 0 "y": 2297.216747221996
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"subnet-34173f72": { "subnet-34173f72": {
"position": { "position": {
"x": 0, "x": -1327.3103482118247,
"y": 0 "y": 2565.4247182393015
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"subnet-05b5dcdc91a8d3da2": { "subnet-05b5dcdc91a8d3da2": {
"position": { "position": {
"x": 0, "x": -313.6285024517165,
"y": 0 "y": 533.2656599668961
}, },
"lx": -56.280967047329966, "lx": -56.280967047329966,
"ly": 12.354358620145604 "ly": 12.354358620145604
}, },
"subnet-16594550": { "subnet-16594550": {
"position": { "position": {
"x": -519.1391150194758, "x": -2851.500239208628,
"y": 3247.768130147494 "y": 2387.984833921447
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"subnet-051f6d705e415834d": { "subnet-051f6d705e415834d": {
"position": { "position": {
"x": 3705.1773007679885, "x": -390.38129559580125,
"y": 1712.2760735536046 "y": 1505.577228196818
},
"lx": 0,
"ly": 0
},
"subnet-9f4ca1f9": {
"position": {
"x": 2735.9606438724304,
"y": -195.12396230895013
},
"lx": 0,
"ly": 0
},
"subnet-9bb881c0": {
"position": {
"x": 2720.1406370035616,
"y": 402.3693819208183
},
"lx": 0,
"ly": 0
},
"subnet-0090a25b": {
"position": {
"x": 2872.577349693165,
"y": 1163.474939916271
},
"lx": 0,
"ly": 0
},
"subnet-82a544e4": {
"position": {
"x": 2312.1522242741453,
"y": 1252.505247360287
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-642cf701": { "sg-642cf701": {
"position": { "position": {
"x": 66.55145954133057, "x": -2209.372601581369,
"y": 3199.7588837084936 "y": 2175.22412993363
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-00600deefd8e47cd0": { "sg-00600deefd8e47cd0": {
"position": { "position": {
"x": 1748.8526871589222, "x": -1277.866725223081,
"y": 769.1351955087487 "y": 2011.1847264855069
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-da75adbf": { "sg-da75adbf": {
"position": { "position": {
"x": 248.59404935168357, "x": -1800.9427240326197,
"y": 2806.708961570234 "y": 1841.868222040777
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-c05a2ba5": { "sg-c05a2ba5": {
"position": { "position": {
"x": 1780.7154695082147, "x": -939.5500418522877,
"y": 960.4027949655301 "y": 1873.2557826817854
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-0c00315bbb744b876": { "sg-0c00315bbb744b876": {
"position": { "position": {
"x": 2005.9176505811133, "x": -1297.0649506991042,
"y": 463.7441588404479 "y": 1744.4705362629554
}, },
"lx": 201.20483557975695, "lx": 201.20483557975695,
"ly": 251.50604447469595 "ly": 251.50604447469595
}, },
"sg-495ab32c": { "sg-495ab32c": {
"position": { "position": {
"x": 1735.1781125296234, "x": -936.198872974305,
"y": 1151.7724351676054 "y": 1774.105726069106
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-0f2465c4421c2d5c2": { "sg-0f2465c4421c2d5c2": {
"position": { "position": {
"x": 4197.03297815781, "x": 1003.6250172456973,
"y": 934.4545348587603 "y": 465.5472519747584
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-8b746aec": { "sg-8b746aec": {
"position": { "position": {
"x": 1708.0576008049065, "x": -1274.4597013533833,
"y": 562.0915192477415 "y": 1853.8684242261777
}, },
"lx": -46.67202145388339, "lx": -46.67202145388339,
"ly": 75.49885823422312 "ly": 75.49885823422312
}, },
"sg-0a872ac3a6d9132a6": { "sg-0a872ac3a6d9132a6": {
"position": { "position": {
"x": 3233.545980714329, "x": 596.6096179578217,
"y": 2324.5478338475505 "y": 1375.6837975543397
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-076d2ea1df0054074": { "sg-076d2ea1df0054074": {
"position": { "position": {
"x": 3394.3395292963014, "x": 939.4048420506512,
"y": 1948.7832081872007 "y": 1607.467460269567
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-b45a2bd1": { "sg-b45a2bd1": {
"position": { "position": {
"x": 4049.2497015379804, "x": 1057.5626949572745,
"y": 665.4137035511877 "y": 92.16799601300966
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-4235ee27": { "sg-4235ee27": {
"position": { "position": {
"x": 471.4854636272555, "x": -1905.2681816478155,
"y": 3322.697640031519 "y": 2374.11694687043
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-04167d2e18ba15e45": { "sg-04167d2e18ba15e45": {
"position": { "position": {
"x": 3195.468001006085, "x": 1024.5766017048984,
"y": 2109.5037824422498 "y": 1021.5218466101364
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-06348763": { "sg-06348763": {
"position": { "position": {
"x": -385.8437743498514, "x": -1557.2877717359272,
"y": 801.5675421441275 "y": 916.5405207336557
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-08fb4b412f90d5913": { "sg-08fb4b412f90d5913": {
"position": { "position": {
"x": -430.38365938247586, "x": -1555.9602415797,
"y": 1413.7977731519345 "y": 710.8018475402707
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"sg-09621eafa81d9554d": { "sg-09621eafa81d9554d": {
"position": { "position": {
"x": 4048.701400244682, "x": 1140.4851333873178,
"y": 269.85723972518815 "y": -219.91772808964902
},
"lx": 0,
"ly": 0
},
"sg-6317ec1e": {
"position": {
"x": 2073.9859753574847,
"y": -130.66656966610023
},
"lx": 0,
"ly": 0
},
"sg-05cf310368b61be20": {
"position": {
"x": 2083.437552135737,
"y": -267.55921136758997
},
"lx": 0,
"ly": 0
},
"sg-08194bbe676179262": {
"position": {
"x": 1682.6287887806661,
"y": 293.44604455991737
},
"lx": 0,
"ly": 0
},
"sg-05ca1dcd081d988ff": {
"position": {
"x": 2068.7911625963147,
"y": 150.86759386269938
},
"lx": 0,
"ly": 0
},
"sg-06d52d70ccdb560a6": {
"position": {
"x": 2174.802794325509,
"y": 388.91282918360304
},
"lx": 0,
"ly": 0
},
"sg-0382952aff01cd163": {
"position": {
"x": 1792.0574458573142,
"y": 1325.52045520572
},
"lx": 0,
"ly": 0
},
"sg-09058813f2805dfb4": {
"position": {
"x": 2168.322265487351,
"y": 1603.5609945362062
},
"lx": 0,
"ly": 0
},
"sg-95e8bbef": {
"position": {
"x": 1811.429623785863,
"y": 1118.2088921652032
},
"lx": 0,
"ly": 0
},
"sg-03ef79edd5b31b5b5": {
"position": {
"x": 1876.015398437253,
"y": 1484.36936967588
},
"lx": 0,
"ly": 0
},
"sg-06d496ee007c5e416": {
"position": {
"x": 1730.3992080949959,
"y": 1607.0989059029391
},
"lx": 0,
"ly": 0
},
"sg-0134f2ca7a8d7ada8": {
"position": {
"x": 1735.3479851878003,
"y": 950.9673359935543
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"i-0dc281f8d162602c8": { "i-0dc281f8d162602c8": {
"position": { "position": {
"x": -1643.4066448564133, "x": -2834.93127718199,
"y": 1212.155742320591 "y": 895.9200991057055
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"i-0997a73b08f6e5862": { "i-0997a73b08f6e5862": {
"position": { "position": {
"x": -460.38911501947575, "x": -2792.750239208628,
"y": 3195.210876044637 "y": 2335.42757981859
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"i-0c8100e3460fa8fd0": { "i-0c8100e3460fa8fd0": {
"position": { "position": {
"x": -971.992276051883, "x": -2163.5169083774604,
"y": 1529.2067712196117 "y": 1212.9711280047263
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"i-041021cd89e15282c": { "i-041021cd89e15282c": {
"position": { "position": {
"x": -454.87332356862487, "x": -2787.234447757777,
"y": 2718.144303286011 "y": 1858.3610070599643
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"i-073b97cbda2b200c3": { "i-073b97cbda2b200c3": {
"position": { "position": {
"x": 3331.10504456304, "x": 200.30013844343284,
"y": 713.8754494904406 "y": 238.01227162949414
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"i-0669f35ab2d0fc444": { "i-0669f35ab2d0fc444": {
"position": { "position": {
"x": 3328.689237128793, "x": 197.8843310091861,
"y": 887.2701263029628 "y": 411.4069484420163
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"i-01b3f3cd57976bdf3": { "i-01b3f3cd57976bdf3": {
"position": { "position": {
"x": 3456.707682094021, "x": 325.902775974414,
"y": 1045.9508438926198 "y": 570.0876660316735
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"i-0272763b46610ac1b": { "i-0272763b46610ac1b": {
"position": { "position": {
"x": -1645.7470314804548, "x": -2837.2716638060324,
"y": 895.2110395755153 "y": 578.9753963606299
}, },
"lx": 238.46757499625102, "lx": 238.46757499625102,
"ly": -50.2036999992107 "ly": -50.2036999992107
}, },
"i-0c82adf476c7c5e32": { "i-0c82adf476c7c5e32": {
"position": { "position": {
"x": -1635.2804587602707, "x": -2826.805091085848,
"y": 1051.938382319946 "y": 735.7027391050606
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"i-0636fd0b033c9b32a": { "i-0636fd0b033c9b32a": {
"position": { "position": {
"x": -1327.719116265829, "x": -2519.243748591406,
"y": 1572.414862004494 "y": 1256.1792187896085
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"i-09241599c2590b66a": { "i-09241599c2590b66a": {
"position": { "position": {
"x": -1409.5590614880932, "x": -2601.0836938136704,
"y": 1392.4230681322329 "y": 1076.1874249173475
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"i-0d7f643cb9d960645": { "i-0d7f643cb9d960645": {
"position": { "position": {
"x": 3927.4825609253985, "x": -120.49386020691819,
"y": 1714.8122689424063 "y": 1447.1713052439845
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"i-082b27477bbe6d8b5": { "i-082b27477bbe6d8b5": {
"position": { "position": {
"x": 2471.8641180477457, "x": -40.83259880403786,
"y": 1766.9578588998183 "y": 1064.7295337290602
},
"lx": 0,
"ly": 0
},
"i-08bf81d76abf97f02": {
"position": {
"x": 2797.914848614436,
"y": 340.955436540754
},
"lx": 0,
"ly": 0
},
"i-0f5f20f2395ceea0c": {
"position": {
"x": 2921.2978821547836,
"y": 1002.8194383645575
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"f8-db-01": { "f8-db-01": {
"position": { "position": {
"x": -876.6598453851616, "x": -2068.1844777107394,
"y": 1832.1264780604447 "y": 1515.8908348455595
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"logon-db-02": { "logon-db-02": {
"position": { "position": {
"x": -462.4521981632432, "x": -2794.8133223523955,
"y": 3348.8253842503505 "y": 2489.042088024303
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"vault-db-production-v2": { "vault-db-production-v2": {
"position": { "position": {
"x": 3290.0119974062445, "x": 159.20709128663725,
"y": 294.42142074168316 "y": -181.44175711926334
}, },
"lx": 134.807239838437, "lx": 134.807239838437,
"ly": -6.036145067392795 "ly": -6.036145067392795
}, },
"vault-db-staging-v2": { "vault-db-staging-v2": {
"position": { "position": {
"x": 3288.1473835958195, "x": 157.34247747621225,
"y": 466.94848155082593 "y": -8.914696310120576
},
"lx": 0,
"ly": 0
},
"production-v2": {
"position": {
"x": 2772.7106438724304,
"y": -182.87396230895013
},
"lx": 0,
"ly": 0
},
"staging-v2": {
"position": {
"x": 2347.9022242741453,
"y": 1264.755247360287
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0
}, },
"NodeAppALB": { "NodeAppALB": {
"position": { "position": {
"x": 3572.372040610579, "x": -526.2687309846843,
"y": 1757.739878164803 "y": 1611.9831511496511
},
"lx": 0,
"ly": 0
},
"hbrts-LoadB-CBQFQ581AN5O": {
"position": {
"x": 2802.6406370035616,
"y": 511.7833273008826
},
"lx": 0,
"ly": 0
},
"hbrts--LoadB-f4zLVghIMuBx": {
"position": {
"x": 2948.077349693165,
"y": 1372.1304414679846
}, },
"lx": 0, "lx": 0,
"ly": 0 "ly": 0