Topograph models are YAML files used to simulate discovered topology without querying a real cloud API, NetQ instance, InfiniBand fabric, or Kubernetes cluster. They are primarily used by tests and local development, but they are also useful when validating a scheduler integration against known topology shapes.
A model describes the same canonical topology that real providers eventually produce:
topology/tree output and Kubernetes leaf / spine / core labelsModel loading lives in pkg/models. Model fixtures live under tests/models/.
Models are consumed in two different simulation flows.
The test provider simulates the Topograph API lifecycle itself. It can return successful topology output, delayed completion, malformed-request failures, provider failures, or a request that remains pending.
Use it when testing clients that call:
POST /v1/generateGET /v1/topology?uid=<request-id>For the complete API status-code simulation behavior, see Test Mode and Test Provider.
Several providers also have simulation variants, such as:
aws-simgcp-simoci-simnebius-simlambdai-simdsx-simThese providers load a model file and then simulate that provider’s API responses. This is useful when you want to exercise the normal provider translation logic without real provider credentials or infrastructure.
Simulation providers share these common parameters:
Example request:
A model has three top-level sections:
All three sections are maps. nodes and capacity_blocks are flexible: you can specify node membership in either section, and Topograph completes the missing side during model loading.
The switches map describes the network hierarchy. Each key is the switch ID. Each value may contain:
Example:
Switch rules:
nodes or be generated from capacity_blocks.nodes entries are expanded through the same compact range syntax used elsewhere.The nodes map describes compute nodes directly. Each key is the node name. The value may contain:
Example:
Node rules:
capacity_block_id is optional.capacity_block_id are still valid compute nodes.capacity_block_id is set and capacity_blocks is omitted, Topograph creates the capacity block and adds the node to it.capacity_blocks.<id>.nodes, Topograph fills in the node’s missing capacity_block_id.The capacity_blocks map describes accelerated domains. Each key is the capacity block ID. The value may contain:
Example:
Capacity block rules:
capacity_blocks section may be omitted.nodes.nodes is omitted, capacity_blocks.<id>.nodes creates node entries automatically.nodes is present, capacity_blocks.<id>.nodes must reference nodes in the top-level nodes map.Model node lists support compact ranges:
These expand to:
Ranges are accepted in:
switches.<switch>.nodescapacity_blocks.<id>.nodesAfter YAML parsing, Topograph completes the model before simulation uses it:
capacity_blocks.<id>.nodes.capacity_block_id values.NetLayers is derived from the switch path from leaf to root.Metadata is built by merging switch metadata along the same path.Instances is derived from node names and grouped by metadata.region; nodes without a region use none.These derived fields are not written in YAML.
This compact model omits the nodes section. Nodes are created from capacity block membership.
After loading:
n1 and n2 belong to cb1 and have attributes.nvlink: nvl1n3 belongs to cb2 and has attributes.nvlink: nvl2[leaf, core]This model omits capacity_blocks. Topograph creates cb1 from n1.capacity_block_id.
After loading:
cb1.nodes contains n1cb1.attributes.nvlink is populated from n1.attributes.nvlinkn2 remains a valid node without capacity block membershipThis is valid. It declares a capacity block that currently has no nodes.
After loading:
cb1.nodes contains n1cb2 remains present with no nodesTo simulate the Topograph API lifecycle, configure the test provider:
Then submit a request that names a model:
Expected flow:
POST /v1/generate returns 202 Accepted and a request ID.GET /v1/topology?uid=<request-id> returns 202 Accepted while the request is queued or processing./v1/topology returns 200 OK with the selected engine output.To simulate API failures, set generateResponseCode, topologyResponseCode, and errorMessage in provider.params. For example:
Use the test provider when you want to validate API-client behavior:
Use a *-sim provider when you want to validate provider-specific topology translation:
Before using a new model in a regression test:
nodes or generated from capacity_blocks.capacity_block_id.