Skip to content

Commit c3a20ca

Browse files
authored
fix: correct build-push workflow tag names (#58)
--------- Signed-off-by: Gerard Vanloo <gerard.vanloo@ibm.com>
1 parent e692bb7 commit c3a20ca

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

.github/workflows/sre-build-push-images.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
linux/arm64
3434
push: true
3535
tags: |
36-
it-bench/topology-monitor:0.0.1
37-
it-bench/topology-monitor:latest
36+
quay.io/it-bench/topology-monitor:0.0.1
37+
quay.io/it-bench/topology-monitor:latest
3838
unsupported-checkout-service:
3939
runs-on: ubuntu-latest
4040
steps:
@@ -58,8 +58,8 @@ jobs:
5858
linux/amd64
5959
push: true
6060
tags: |
61-
it-bench/unsupported-checkout-service-amd64:0.0.1
62-
it-bench/unsupported-checkout-service-amd64:latest
61+
quay.io/it-bench/unsupported-checkout-service-amd64:0.0.1
62+
quay.io/it-bench/unsupported-checkout-service-amd64:latest
6363
- name: Build and push Unsupported Astronomy Shop Checkout Service image (arm)
6464
uses: docker/build-push-action@v6
6565
with:
@@ -68,5 +68,5 @@ jobs:
6868
linux/arm64
6969
push: true
7070
tags: |
71-
it-bench/unsupported-checkout-service-arm64:0.0.1
72-
it-bench/unsupported-checkout-service-arm64:latest
71+
quay.io/it-bench/unsupported-checkout-service-arm64:0.0.1
72+
quay.io/it-bench/unsupported-checkout-service-arm64:latest

sre/tools/kubernetes-topology-mapper/topology_analyzer.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,56 +12,56 @@ class TopologyAnalyzer:
1212
def __init__(self, topology_data: Dict):
1313
"""
1414
Initialize the analyzer with topology data.
15-
15+
1616
Args:
1717
topology_data (dict): Dictionary containing nodes and edges information
1818
"""
1919
self.topology_data = topology_data
2020
self.graph = nx.DiGraph()
2121
self._build_graph()
22-
22+
2323
def _build_graph(self):
2424
"""Build the directed graph from topology data."""
2525
# Create a set of all node IDs for quick lookup
2626
node_ids = {node["id"] for node in self.topology_data.get("nodes", [])}
27-
27+
2828
# Add nodes with their attributes
2929
for node in self.topology_data.get("nodes", []):
3030
self.graph.add_node(node["id"], **node.get("attributes", {}))
31-
31+
3232
# Track missing nodes referenced in edges
3333
missing_nodes = set()
34-
34+
3535
# Add edges with their attributes
3636
for edge in self.topology_data.get("edges", []):
3737
source = edge["source"]
3838
target = edge["target"]
39-
39+
4040
# Check if both source and target nodes exist
4141
if source not in node_ids:
4242
missing_nodes.add(source)
4343
logger.warning(f"Edge references missing source node: {source}")
4444
if target not in node_ids:
4545
missing_nodes.add(target)
4646
logger.warning(f"Edge references missing target node: {target}")
47-
47+
4848
# Add the edge even if nodes are missing - we'll handle them as placeholder nodes
4949
if source not in self.graph:
5050
self.graph.add_node(source, kind="Unknown", name=f"missing-{source}")
5151
if target not in self.graph:
5252
self.graph.add_node(target, kind="Unknown", name=f"missing-{target}")
53-
53+
5454
self.graph.add_edge(source, target, **edge.get("attributes", {}))
55-
55+
5656
if missing_nodes:
5757
logger.warning(f"Found {len(missing_nodes)} nodes referenced in edges but not in nodes list")
58-
58+
5959
logger.info(f"Graph built with {self.graph.number_of_nodes()} nodes and {self.graph.number_of_edges()} edges")
60-
60+
6161
def _determine_position(self, node: str, subgraph: nx.DiGraph) -> str:
6262
in_degree = subgraph.in_degree(node)
6363
out_degree = subgraph.out_degree(node)
64-
64+
6565
# Parent: No incoming edges but has outgoing edges, OR isolated node
6666
if in_degree == 0:
6767
return "parent"
@@ -71,37 +71,37 @@ def _determine_position(self, node: str, subgraph: nx.DiGraph) -> str:
7171
# Leaf: Has incoming edges but no outgoing edges
7272
elif in_degree > 0 and out_degree == 0:
7373
return "leaf"
74-
74+
7575
return "parent" # Default case for any unhandled scenarios
76-
76+
7777
def analyze(self) -> List[Dict]:
7878
# Get weakly connected components
7979
components = list(nx.weakly_connected_components(self.graph))
8080
result = []
81-
81+
8282
logger.info(f"Found {len(components)} disconnected components")
83-
83+
8484
for i, component in enumerate(components, 1):
8585
# Create subgraph for each component
8686
subgraph = self.graph.subgraph(component)
8787
logger.info(f"Processing component {i} with {len(component)} nodes and {subgraph.number_of_edges()} edges")
88-
88+
8989
# Process nodes with position classification
9090
nodes = []
9191
node_positions = {} # Keep track of positions for debugging
9292
for node in subgraph.nodes():
9393
position = self._determine_position(node, subgraph)
9494
node_positions[position] = node_positions.get(position, 0) + 1
95-
95+
9696
node_data = {
9797
"id": node,
9898
"attributes": dict(subgraph.nodes[node]),
9999
"position": position
100100
}
101101
nodes.append(node_data)
102-
102+
103103
logger.info(f"Component {i} node positions: {node_positions}")
104-
104+
105105
# Process edges
106106
edges = []
107107
for source, target, data in subgraph.edges(data=True):
@@ -111,7 +111,7 @@ def analyze(self) -> List[Dict]:
111111
"attributes": data
112112
}
113113
edges.append(edge_data)
114-
114+
115115
# Create component data
116116
component_data = {
117117
"nodes": sorted(nodes, key=lambda x: (
@@ -120,11 +120,11 @@ def analyze(self) -> List[Dict]:
120120
)),
121121
"edges": edges
122122
}
123-
123+
124124
result.append(component_data)
125-
125+
126126
return result
127-
127+
128128
def export_to_json(self, filename: str):
129129
analysis_results = self.analyze()
130130
with open(filename, 'w') as f:
@@ -140,20 +140,20 @@ def main():
140140
help='Output JSON file for analyzed results')
141141
parser.add_argument('--debug', action='store_true',
142142
help='Enable debug logging')
143-
143+
144144
args = parser.parse_args()
145-
145+
146146
if args.debug:
147147
logging.getLogger().setLevel(logging.DEBUG)
148-
148+
149149
try:
150150
with open(args.input_file, 'r') as f:
151151
topology_data = json.load(f)
152-
152+
153153
analyzer = TopologyAnalyzer(topology_data)
154-
154+
155155
analyzer.export_to_json(args.output_file)
156-
156+
157157
except FileNotFoundError as e:
158158
logger.error(f"Could not find file - {e.filename}")
159159
sys.exit(1)
@@ -165,4 +165,4 @@ def main():
165165
sys.exit(1)
166166

167167
if __name__ == "__main__":
168-
main()
168+
main()

0 commit comments

Comments
 (0)