domains
Experimental. For evaluation. Interfaces, configuration, and behavior may change incompatibly.
Coordinates operations across nodes that share infrastructure domains. Available topology depends on the configured provider.
Prerequisites
- Configured Slurm or Kubernetes with populated topology.
Setup
- Loads automatically with a configured provider; no
[modules.domains]table is needed.
Domain-level operations for managing groups of nodes that share infrastructure (e.g., NVSwitch domains).
Members
cancel_workflows
domains.cancel_workflows(hostname, script_name?, exclude_triggering?)Cancel running workflows for nodes in a domain. Matches workflows whose ID contains the hostname as a ’-‘-delimited segment (e.g., on_taint, on_cordon, on_drain workflows). Optionally filter by script_name to cancel only workflows from a specific script. Blocks until each workflow’s cancel handler completes.
hostnamestringAny hostname in the target domain.script_name?optionalstringOnly cancel workflows from this script (e.g., ‘breakfix.star’). If empty, cancels all matching workflows.exclude_triggering?optionalboolIf true, skip cancelling the workflow for the triggering hostname.cancelled_countintNumber of workflows cancelled.get
domains.get(name)Read a domain row (state + metadata) from the domains table. Returns a DomainResult with name, state, and metadata. Errors if the row does not exist.
namestringDomain name (e.g., ‘nvl72D008’).domaindomains.DomainResultDomainResult with name, state, and metadata.get_nodes
domains.get_nodes(hostname)Get all node hostnames in the same domain as the given hostname.
hostnamestringAny hostname in the target domain.hostnameslist[string]List of all hostnames in the domain.get_racks
domains.get_racks(domain_name)Get the racks and their node membership within a domain from one topology snapshot.
domain_namestringDomain whose direct Rack children should be returned.rackslist[domains.RackResult]RackResult values sorted by Rack name.join_domain_coordinator
domains.join_domain_coordinator(domain_key, expected_acks, member_key?, coordinator_script_name?, coordinator_function_name?, ack_timeout?, proceed_timeout?)Join the workflow coordinator for a domain at fixed id domain-coordinator-{domain_key}: the first member starts that coordinator if needed, every member sends an ACK, then each blocks until the coordinator signals proceed.
domain_keystringDomain identifier; same for all members. Workflow id is domain-coordinator-{domain_key}.expected_acksintMembers that must ACK (e.g. len(domains.get_nodes(h))).member_key?optionalstringDedupe key, usually hostname. Empty uses this workflow run id.coordinator_script_name?optionalstringScript that defines the coordinator-side Starlark function (e.g. breakfix.star). Empty disables coordinator Starlark.coordinator_function_name?optionalstringTop-level function run on the coordinator; Args doc must use the Remediation Orchestrator argument format name: dict\[string:any\], ... (not name (type):). Empty disables.ack_timeout?optionalstringMax time the coordinator waits for ACKs (e.g. ‘2h’). Defaults to ” (wait forever). On timeout it proceeds with whoever acked.proceed_timeout?optionalstringMax time this member waits for the coordinator’s proceed signal (e.g. ‘4h’). Defaults to ” (wait forever). On timeout this member proceeds without it.resultdomains.JoinCoordinatorResultJoinCoordinatorResult with acked_count and timed_out.list
domains.list()List all domain names persisted in the domains table for a cluster.
nameslist[string]Domain names, sorted ascending.perform
domains.perform(hostname, fn, exclude_triggering?, timeout?)Apply a function to each node in a domain. Retries failed nodes with exponential backoff until all succeed or the timeout is reached. Returns a PerformResult with succeeded/failed lists on success. Raises an error if the timeout is reached with nodes still failing. Example: domains.perform(node.node_id, lambda node_id: slurm.drain_node(node_id, reason), timeout=‘10m’)
hostnamestringAny hostname in the target domain. Used to look up which domain to operate on.fncallableFunction to apply to each node in the domain. Called once per node with the node’s hostname.exclude_triggering?optionalboolIf true, skip the triggering hostname.timeout?optionalstringMax time to retry failed nodes (e.g., ‘10m’, ‘30m’). Defaults to ‘10m’.resultdomains.PerformResultPerformResult with succeeded and failed hostname lists.set
domains.set(name, state?, metadata?)Upsert a domain’s state and/or metadata. An empty state leaves the existing state unchanged; an empty metadata dict leaves existing metadata unchanged. Example: domains.set(‘nvl72D008’, state=‘draining’, metadata={‘reason’: ‘NVSwitch failure’})
namestringDomain name (e.g., ‘nvl72D008’).state?optionalstringNew state. Valid values: degraded, draining, healthy, with_provider. Empty string leaves it unchanged.metadata?optionaldict[string:any]Metadata dict. Empty dict leaves existing metadata unchanged.okboolTrue on success.