Skip to content

chore(topograph): rename backend switch tiers#208

Merged
dmitsh merged 1 commit into
mainfrom
ds-k8s-labels
Feb 5, 2026
Merged

chore(topograph): rename backend switch tiers#208
dmitsh merged 1 commit into
mainfrom
ds-k8s-labels

Conversation

@dmitsh
Copy link
Copy Markdown
Collaborator

@dmitsh dmitsh commented Feb 5, 2026

No description provided.

Signed-off-by: Dmitry Shmulevich <dshmulevich@nvidia.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 85.18519% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.83%. Comparing base (cad853c) to head (6886b2b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/topograph/main.go 0.00% 4 Missing ⚠️
pkg/providers/oci/provider_imds.go 0.00% 2 Missing ⚠️
pkg/topology/graph.go 92.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #208   +/-   ##
=======================================
  Coverage   65.83%   65.83%           
=======================================
  Files          81       81           
  Lines        4484     4484           
=======================================
  Hits         2952     2952           
  Misses       1419     1419           
  Partials      113      113           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Feb 5, 2026

Greptile Overview

Greptile Summary

This PR performs a comprehensive renaming of network topology terminology across the entire codebase, changing block/datacenter to leaf/core to align with standard networking nomenclature for switch tiers.

Key Changes

  • Data structures: Renamed BlockID/BlockNameLeafID/LeafName and DatacenterID/DatacenterNameCoreID/CoreName in InstanceTopology struct
  • Kubernetes labels: Updated default labels from network.topology.nvidia.com/blocknetwork.topology.nvidia.com/leaf and network.topology.nvidia.com/datacenternetwork.topology.nvidia.com/core
  • CLI flags: Renamed command-line arguments to -k8s-topology-key-leaf and -k8s-topology-key-core
  • Cloud providers: Updated all provider implementations (AWS, GCP, OCI, Nebius, LambdaLabs) to populate the renamed fields
  • Documentation: Updated user-facing documentation to reflect new terminology
  • Tests: Updated all unit tests to use new field names and expected output

Impact

This is a breaking change that affects:

  • Helm chart values configuration
  • Kubernetes node labels applied to clusters
  • CLI command-line arguments
  • Any external integrations relying on the old label names

The renaming is semantically accurate - "leaf" better describes edge switches directly connected to compute nodes, and "core" better describes top-tier switches in a network hierarchy.

Confidence Score: 5/5

  • This PR is safe to merge - it's a well-executed, systematic renaming with no logical changes
  • The changes are purely cosmetic renamings performed consistently across all 17 files. All tests have been updated to match the new terminology, and the renaming improves code clarity by using standard networking terminology (leaf/core instead of block/datacenter).
  • No files require special attention - the renaming is consistent and complete across the entire codebase

Important Files Changed

Filename Overview
pkg/topology/graph.go Renamed BlockID/BlockName to LeafID/LeafName and DatacenterID/DatacenterName to CoreID/CoreName in core topology data structures
pkg/engines/k8s/labeler.go Updated default label constants and variable names from block/datacenter to leaf/core terminology
cmd/topograph/main.go Renamed CLI flags from -k8s-topology-key-block/datacenter to -k8s-topology-key-leaf/core
charts/topograph/values.yaml Updated Helm values topology node label keys from block/datacenter to leaf/core
pkg/providers/aws/instance_topology.go Updated AWS provider to populate LeafID/CoreID fields instead of BlockID/DatacenterID
pkg/providers/gcp/instance_topology.go Updated GCP provider to populate LeafID/CoreID fields instead of BlockID/DatacenterID

Sequence Diagram

sequenceDiagram
    participant User as User/K8s Cluster
    participant Main as cmd/topograph/main.go
    participant K8s as pkg/engines/k8s/labeler.go
    participant Provider as Cloud Provider (AWS/GCP/OCI/etc)
    participant Topology as pkg/topology/graph.go
    participant Node as Kubernetes Node

    User->>Main: Start topograph with CLI flags
    Note over Main: Parse flags:<br/>-k8s-topology-key-leaf<br/>-k8s-topology-key-spine<br/>-k8s-topology-key-core
    Main->>K8s: InitLabels(accelerator, leaf, spine, core)
    Note over K8s: Store label names:<br/>labelLeaf, labelSpine, labelCore
    
    Main->>Provider: Request instance topology
    Provider->>Topology: Create InstanceTopology
    Note over Topology: Populate fields:<br/>LeafID, SpineID, CoreID
    Provider-->>Main: Return ClusterTopology
    
    Main->>Topology: ToThreeTierGraph()
    Note over Topology: Build network hierarchy<br/>using LeafID/SpineID/CoreID
    Topology-->>Main: Return Vertex graph
    
    Main->>K8s: ApplyNodeLabels()
    K8s->>Node: Add labels to nodes
    Note over Node: Apply labels:<br/>network.topology.nvidia.com/leaf<br/>network.topology.nvidia.com/spine<br/>network.topology.nvidia.com/core
    Node-->>K8s: Labels applied
    K8s-->>Main: Success
Loading

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@dmitsh dmitsh merged commit 3abaae8 into main Feb 5, 2026
6 checks passed
@dmitsh dmitsh deleted the ds-k8s-labels branch February 5, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant