Module hw_cluster

Module hw_cluster 

Source
Expand description

Hardware cluster pin/unpin and hw-component add/delete service logic.

Split into three (private) sub-modules:

  • scoring — pure-computation functions for component scarcity, per-node scoring, candidate selection, pattern parsing, and the parallel hw-inventory fetcher. Also hosts resolve_hw_description_to_xnames, which dispatches between pin and unpin.
  • pin_unpin — the calculate_target_hsm_pin / _unpin node selection algorithms plus the shared coordination helpers used by apply_hw_configuration (pattern parsing, target-group existence check, resource-sufficiency validation, group-update orchestration).
  • apply — high-level coordinators called by the server handlers: apply_hw_configuration, add_hw_component, delete_hw_component.

Public types (AddHwResult, DeleteHwResult, ApplyHwResult, NodeHwCountVec, HwClusterMode) and shared constants live here so all three sub-modules can use them.

Structs§

AddHwResult
Result of an add hw-component operation.
ApplyHwConfigurationParams
Pin or unpin nodes between parent_group_name and target_group_name so the target group satisfies pattern.
ApplyHwResult
Result of an apply hw-configuration (pin/unpin) operation.
DeleteHwResult
Result of a delete hw-component operation.

Enums§

HwClusterMode
Whether the hw cluster operation moves nodes into the target (Pin) or releases them back (Unpin).

Functions§

add_hw_component
Move enough nodes out of parent_group_name into target_group_name to add the components described by pattern (<component>:<delta> pairs) to the target.
apply_hw_configuration
Service entry point for POST /hardware-clusters/{target}/configuration.
delete_hw_component
Move enough nodes out of target_group_name back into parent_group_name to remove the components described by pattern from the target.

Type Aliases§

NodeHwCountVec
A list of nodes paired with their per-component counts.