This repository was archived by the owner on Jun 2, 2026. It is now read-only.
Commit 1f318d4
committed
feat: Add tray-level firmware sub-target selection
Lets callers restrict a firmware update to a subset of sub-parts within
each targeted tray (e.g. just BMC + NVOS for switch trays, just PSU for
powershelf trays) instead of always installing the whole bundle.
REST surface
------------
- OpenAPI: new optional `targets` array on `FirmwareUpdateRequest` and
`BatchTrayFirmwareUpdateRequest`. Lowercase names; empty/omitted keeps
the historical "update everything in the bundle" behavior; unknown
names are rejected. Requires `version` to be set when non-empty.
Field is named `targets` (not `components`) to avoid colliding with
carbide's tray-level "Component" resource vocabulary.
- API model: `APIUpdateFirmwareRequest.Targets`,
`APIBatchTrayFirmwareUpdateRequest.Targets`, `validateFirmwareTargets`.
- Handlers: `tray.go` (single + batch) plumbs `apiRequest.Targets`
through `common.ExecuteFirmwareUpdateWorkflow`. `rack.go` continues
to pass nil (no rack-level sub-target selection - rack requests are
fanned out to individual tray operations downstream).
- SDK regenerated.
Flow gRPC + Go internals
------------------------
- `flow/proto/v1/flow.proto`: new `repeated string sub_targets = 8;` on
`UpgradeFirmwareRequest`. Named `sub_targets` (not `components`)
because `OperationTargetSpec.components` already exists on the same
request and means "tray INSTANCES to hit"; keeping both as
`components` would have been ambiguous.
- Regenerated `flow/pkg/proto/v1/flow.pb.go` and
`workflow-schema/flow/protobuf/v1/flow.pb.go`.
- `operations.FirmwareControlTaskInfo` gains `SubTargets []string`
(JSON tag `sub_targets`). Populated from `req.GetSubTargets()` in
`service/server_impl.go` and `converter/protobuf/converter.go`.
- All 5 component-manager FirmwareControl implementations consume
`info.SubTargets`:
- nvlswitch/nsm -> NSM QueueUpdates
- nvlswitch/nico -> UpdateSwitchFirmwareTarget.Components
- powershelf/psm -> UpdatePowershelfFirmwareRequest.Components
- powershelf/nico -> UpdatePowerShelfFirmwareTarget.Components
(defaults to PMC when empty, preserving prior
behavior)
- compute/nico -> currently logs a warning and applies the full
bundle; the SetFirmwareUpdateTimeWindow +
SetMachineAutoUpdate path has no per-sub-target
selection. Will be honored once compute moves
to UpdateComponentFirmware.
Centralized name -> enum mapping
--------------------------------
- New package `flow/pkg/common/firmwarecomponents` owns the
string -> tray-type-specific component-manager-enum mapping for all
three tray types (NSM NVSwitch, PSM PowerShelf, and the three NICo
*Component enums). Mappings are explicit hand-written maps rather
than auto-derived from proto, so adding a new enum value in Core
requires a deliberate decision about its REST-facing name.
- Completeness-guard unit tests (TestNICo*MapIsComplete) fail if Core
adds a non-UNKNOWN enum value that the mapping forgot to cover.
- Package name keeps "Component" because it is the semantic destination
of the parse - the enums in Core are named NvSwitchComponent /
PowerShelfComponent / ComputeTrayComponent.
Compatibility
-------------
- Proto field number 8 is new (added in this commit), so there are no
in-flight Temporal workflows or existing gRPC consumers depending on
any prior name; the JSON-tag/field-name choices are risk-free.
- gRPC wire format only depends on field numbers; the name `sub_targets`
changes nothing on the wire.
- Empty/omitted `targets` is the legacy behavior, so existing callers
are unaffected.
Example
-------
PATCH /v2/tray/{id}/firmware
{ "version": "24.11.0", "targets": ["bmc", "nvos"] }
POST /v2/tray/firmware/batch
{ "siteId": "...", "filter": {"type": "switch"},
"version": "24.11.0", "targets": ["bmc", "nvos"] }1 parent 538260d commit 1f318d4
24 files changed
Lines changed: 794 additions & 27 deletions
File tree
- api/pkg/api
- handler
- util/common
- model
- flow
- internal
- converter/protobuf
- service
- task
- componentmanager
- compute/nico
- nvlswitch
- nico
- nvswitchmanager
- powershelf
- nico
- psm
- operations
- pkg
- common/firmwarecomponents
- proto/v1
- proto/v1
- openapi
- sdk/standard
- workflow-schema/flow
- protobuf/v1
- proto/v1
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1150 | 1150 | | |
1151 | 1151 | | |
1152 | 1152 | | |
1153 | | - | |
| 1153 | + | |
1154 | 1154 | | |
1155 | 1155 | | |
1156 | 1156 | | |
| |||
1268 | 1268 | | |
1269 | 1269 | | |
1270 | 1270 | | |
1271 | | - | |
| 1271 | + | |
1272 | 1272 | | |
1273 | 1273 | | |
1274 | 1274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1144 | 1144 | | |
1145 | 1145 | | |
1146 | 1146 | | |
1147 | | - | |
| 1147 | + | |
1148 | 1148 | | |
1149 | 1149 | | |
1150 | 1150 | | |
| |||
1259 | 1259 | | |
1260 | 1260 | | |
1261 | 1261 | | |
1262 | | - | |
| 1262 | + | |
1263 | 1263 | | |
1264 | 1264 | | |
1265 | 1265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1762 | 1762 | | |
1763 | 1763 | | |
1764 | 1764 | | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
1765 | 1772 | | |
1766 | 1773 | | |
1767 | 1774 | | |
1768 | 1775 | | |
1769 | 1776 | | |
1770 | 1777 | | |
1771 | 1778 | | |
| 1779 | + | |
1772 | 1780 | | |
1773 | 1781 | | |
1774 | 1782 | | |
1775 | 1783 | | |
1776 | 1784 | | |
1777 | 1785 | | |
| 1786 | + | |
1778 | 1787 | | |
1779 | 1788 | | |
1780 | 1789 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
32 | 47 | | |
33 | 48 | | |
34 | 49 | | |
35 | 50 | | |
36 | 51 | | |
37 | 52 | | |
38 | 53 | | |
39 | | - | |
| 54 | + | |
40 | 55 | | |
41 | 56 | | |
42 | 57 | | |
| |||
89 | 104 | | |
90 | 105 | | |
91 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
92 | 111 | | |
93 | 112 | | |
94 | 113 | | |
95 | 114 | | |
96 | 115 | | |
97 | 116 | | |
98 | 117 | | |
99 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
100 | 141 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
48 | 130 | | |
49 | 131 | | |
50 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1239 | 1239 | | |
1240 | 1240 | | |
1241 | 1241 | | |
| 1242 | + | |
1242 | 1243 | | |
1243 | 1244 | | |
1244 | 1245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1241 | 1241 | | |
1242 | 1242 | | |
1243 | 1243 | | |
| 1244 | + | |
1244 | 1245 | | |
1245 | 1246 | | |
1246 | 1247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
| 318 | + | |
318 | 319 | | |
319 | 320 | | |
320 | 321 | | |
| |||
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
328 | 342 | | |
329 | 343 | | |
330 | 344 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
105 | 138 | | |
106 | 139 | | |
107 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
242 | 243 | | |
243 | 244 | | |
244 | 245 | | |
| 246 | + | |
245 | 247 | | |
246 | 248 | | |
247 | 249 | | |
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
251 | 258 | | |
252 | 259 | | |
253 | 260 | | |
| |||
263 | 270 | | |
264 | 271 | | |
265 | 272 | | |
266 | | - | |
| 273 | + | |
| 274 | + | |
267 | 275 | | |
268 | 276 | | |
269 | 277 | | |
| |||
0 commit comments