Commit df2fc21
committed
refactor(machine): separate Machine fields into config/status sub-messages
Add `MachineConfig` and `MachineStatus` to `forge.Machine` and the
corresponding structs to `carbide-api-model`.
Protobuf Changes:
- Add `MachineConfig` for operator-set desired state (maintenance,
instance-type assignment, firmware policy, DPF toggle).
- Add `MachineStatus` for system-observed state.
- Populate both in the `From<Machine>` RPC conversion while keeping
all original flat fields as `[deprecated = true]` aliases so
rest-api consumers are unaffected until a follow-up PR migrates
them. See #2793
- Add `LifecycleStatus lifecycle` to `MachineStatus`, making machines
consistent with Rack, Switch, VPC, and every other managed resource
type that already carries a structured lifecycle sub-message.
Ingestion-time fields (`rack_id`, `hw_sku`, `placement_in_rack`,
`bmc_info`, `machine_type`, `inventory`) are set once from the
expected-machine record or hardware topology and are not
operator-mutable. They remain as non-deprecated `Machine` fields
rather than being placed in `MachineConfig` or `MachineStatus`.
api-model changes:
- Extract `MachineConfig` (`config.rs`) and `MachineStatus`
(`status.rs`) from the flat `Machine` struct; all internal
call-sites updated to `machine.config.X` / `machine.status.X`.
- `rack_id`, `hw_sku`, and `placement_in_rack` stay as direct fields
on `Machine` — not in `MachineConfig`
Other changes:
* Pre-compute `rpc_state`, `rpc_state_version`, and `rpc_state_reason`
in `From<Machine>` so they are shared between the deprecated fields and the
new `status.lifecycle` without repeating the derivation. Mirror each
into the `status` sub-message so both paths stay in sync:
`status.health` and `status.lifecycle.sla`alongside `health`/`state_sla`
on the host path; `status.associated_host_machine_id` and `status.lifecycle.sla`
alongside the flat fields on the DPU path.1 parent 874659f commit df2fc21
98 files changed
Lines changed: 1680 additions & 651 deletions
File tree
- crates
- admin-cli/src
- debug_bundle
- dpu
- network
- reprovision
- status
- versions
- host/reprovision
- inventory
- machine
- hardware_info
- metadata
- nvlink_info
- show
- managed_host/show
- api-core/src
- attestation
- dpa
- handlers
- instance
- tests
- common/api_fixtures
- dpf
- api-db/src
- api-model/src
- machine
- api-web/src
- dpa-manager/src/card_handler
- health/src
- ib-fabric/src
- machine-controller/src
- handler
- nvlink-manager/src
- rpc-utils/src
- rpc
- proto
- src/model/machine
- rvs/src/client
- site-explorer
- src
- tests
- ssh-console-mock-api-server/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
| 583 | + | |
583 | 584 | | |
584 | 585 | | |
585 | 586 | | |
| |||
1698 | 1699 | | |
1699 | 1700 | | |
1700 | 1701 | | |
| 1702 | + | |
1701 | 1703 | | |
1702 | 1704 | | |
1703 | 1705 | | |
| |||
1801 | 1803 | | |
1802 | 1804 | | |
1803 | 1805 | | |
| 1806 | + | |
1804 | 1807 | | |
1805 | 1808 | | |
1806 | 1809 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| 148 | + | |
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| |||
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
| 158 | + | |
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
| |||
330 | 333 | | |
331 | 334 | | |
332 | 335 | | |
| 336 | + | |
333 | 337 | | |
334 | 338 | | |
335 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
0 commit comments