Skip to content

feat(dsx): provider simulator#287

Open
ravisoundar wants to merge 1 commit intomainfrom
rs-latinum
Open

feat(dsx): provider simulator#287
ravisoundar wants to merge 1 commit intomainfrom
rs-latinum

Conversation

@ravisoundar
Copy link
Copy Markdown
Collaborator

Description

Adds a simulator implementation for the latinum provider.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.
  • All commits are signed off per DCO (git commit -s).

@ravisoundar ravisoundar requested a review from dmitsh as a code owner April 22, 2026 00:55
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Apr 22, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 22, 2026

Greptile Summary

This PR adds a dsx provider package with a simulator implementation backed by a YAML model file, following the same pattern as existing sim providers (lambdai-sim, gcp-sim). The simulator correctly filters nodes by the requested nodeIDs, handles all error paths (client factory failure, API error), and is registered in the global provider registry alongside comprehensive unit and integration tests.

Confidence Score: 5/5

Safe to merge; only one minor import-ordering style issue remains.

All previously raised concerns (nil dereference in GetComputeInstances, unused struct fields, nodeIDs filtering) are addressed in this version. The single remaining finding is a P2 import ordering nit that does not affect runtime behaviour.

pkg/registry/registry.go — import ordering nit

Important Files Changed

Filename Overview
pkg/providers/dsx/provider.go Defines the dsx package's public types (Client interface, TopologyResponse, SwitchInfo, NodeInfo), baseProvider, and a stub Loader that returns StatusNotImplemented; clean and straightforward.
pkg/providers/dsx/provider_sim.go Implements simClient and simProvider using a model file; correctly filters nodes by want-map in GetTopology, handles clientFactory errors before the type assertion in GetComputeInstances.
pkg/providers/dsx/instance_topology.go Bridges raw TopologyResponse to ClusterTopology; correctly builds parentOf map for three-tier hierarchy and filters output by the requested instance set.
pkg/providers/dsx/provider_sim_test.go Comprehensive test suite covering error paths (bad model, clientFactory failure, API error), happy paths (small cluster, large cluster, single-node, NVLink), and topology structure validation.
pkg/registry/registry.go Registers dsx.NamedLoaderSim; the new import is misplaced after lambdai instead of before it alphabetically.
pkg/server/http_server_test.go Adds three integration test cases (block, tree, trimmed-tree) for dsx-sim provider using existing shared payloads and expected configs; no issues.

Sequence Diagram

sequenceDiagram
    participant C as Caller
    participant SP as simProvider
    participant BP as baseProvider
    participant CF as clientFactory
    participant SC as simClient
    participant IT as instance_topology

    C->>SP: GenerateTopologyConfig(ctx, pageSize, instances)
    SP->>BP: generateInstanceTopology(ctx, pageSize, instances)
    BP->>CF: clientFactory()
    CF-->>BP: simClient / error
    BP->>SC: GetTopology(ctx, "", nodeIDs, pageSize, "")
    SC-->>BP: TopologyResponse
    BP->>IT: responseToClusterTopology(response, cis)
    IT-->>BP: ClusterTopology
    BP-->>SP: ClusterTopology
    SP->>SP: topo.ToThreeTierGraph(NAME, instances, trimTiers, false)
    SP-->>C: *topology.Vertex

    note over C,SP: GetComputeInstances path (engine support)
    C->>SP: GetComputeInstances(ctx)
    SP->>CF: clientFactory()
    CF-->>SP: simClient / error
    SP->>SC: model.Instances
    SC-->>C: []ComputeInstances
Loading

Reviews (5): Last reviewed commit: "feat(dsx): provider simulator" | Re-trigger Greptile

Comment thread pkg/providers/latinum/provider_sim.go Outdated
Comment thread pkg/providers/dsx/provider_sim.go
Comment thread pkg/providers/latinum/provider_sim.go Outdated
Comment thread pkg/providers/dsx/provider_sim.go
@dmitsh dmitsh changed the title feat(latinum): provider simulator feat(dsx): provider simulator Apr 22, 2026
Signed-off-by: Ravi Shankar <ravish@nvidia.com>
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