Skip to content

Add planning docs for SMD group-based BMC target selection#24

Closed
jvd10 wants to merge 3 commits into
OpenCHAMI:mainfrom
jvd10:group-selection-plan
Closed

Add planning docs for SMD group-based BMC target selection#24
jvd10 wants to merge 3 commits into
OpenCHAMI:mainfrom
jvd10:group-selection-plan

Conversation

@jvd10

@jvd10 jvd10 commented Jun 30, 2026

Copy link
Copy Markdown

Introduce GROUP_SELECTION.md and HANDOFF_GROUP_SELECTION.md describing how FirmwareUpdateJob can target a set of BMCs via an SMD user-defined group reference instead of a single TargetAddress.

  • Add optional GroupRef, MaxParallel, and AllowPartialTargets spec fields
  • Make TargetAddress conditionally required via a BMC selector exclusivity rule (exactly one of TargetAddress or GroupRef)
  • Preserve backward compatibility and existing per-BMC component selection (Targets/Component) semantics
  • Consume existing SMD groups only; group lifecycle stays out of scope

Checklist

  • My code follows the style guidelines of this project
  • I have added/updated comments where needed
  • I have added tests that prove my fix is effective or my feature works
  • I have run make test (or equivalent) locally and all tests pass
  • DCO Sign-off: All commits are signed off (git commit -s) with my real name and email
  • REUSE Compliance:
    • Each new/modified source file has SPDX copyright and license headers
    • Any non-commentable files include a <filename>.license sidecar
    • All referenced licenses are present in the LICENSES/ directory

Description

Please include a summary of the change and which issue is fixed.
Also include relevant motivation and context.

Fixes #(issue)

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

For more info, see Contributing Guidelines.

Introduce GROUP_SELECTION.md and HANDOFF_GROUP_SELECTION.md describing how
FirmwareUpdateJob can target a set of BMCs via an SMD user-defined group
reference instead of a single TargetAddress.

- Add optional GroupRef, MaxParallel, and AllowPartialTargets spec fields
- Make TargetAddress conditionally required via a BMC selector exclusivity
  rule (exactly one of TargetAddress or GroupRef)
- Preserve backward compatibility and existing per-BMC component selection
  (Targets/Component) semantics
- Consume existing SMD groups only; group lifecycle stays out of scope

Signed-off-by: jvd10 <jay.depasse@hpe.com>

@bmcdonald3 bmcdonald3 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, really just a question about what that handoff doc here is.

Comment thread planning/HANDOFF_GROUP_SELECTION.md Outdated
@@ -0,0 +1,171 @@
# HANDOFF_GROUP_SELECTION

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I am confused what this file is. The handoff document is supposed to be generated after the implementation (which you have specified in the Output Artifacts section above). This seems like something different.

- Existing single-`TargetAddress` jobs continue to work unchanged.
- No changes to `Targets`, `Component`, `OCIReference`, or `Discovery` semantics.

## 3. SMD Integration and Reconciliation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main thing that's jumping out to me really is like how do we want to handle SMD integration... Given we might be using it for other things down the line, I'm just thinking if there are ways to make it more reusable, but I think that the endpoints really just being /hsm/v2, that does not sound like a difficult integration.

Regardless, I would go with the least amount of code changes for this first pass to get something working and then we can build off that from there.

@mbuchmann-hpe mbuchmann-hpe left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to come up with a plan that can support the multiple hardware in a group.

All SMD calls use base path `/hsm/v2` (validated; see Section 7).

1. Fetch the group and its members:
- `GET /hsm/v2/groups/{GroupRef}` and read `members.ids[]` (HMS component xnames, conventionally Node xnames).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

groups/{GroupRef}/members can also be used to just get the member ids.

Create a firmware update job that targets an SMD group instead of a single BMC:

```bash
curl -sS -X POST http://127.0.0.1:8090/firmwareupdatejobs/ \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Groups, particularly cabinet groups, often consist of hardware featuring multiple models and potentially different vendors. Consequently, you cannot deploy a single binary across an entire group and expect unsupported hardware to handle it. Doing so will result in a failed update at best, or corrupted, non-functional hardware at worst.

jvd10 added 2 commits July 1, 2026 17:05
Signed-off-by: jvd10 <jay.depasse@hpe.com>
Implements planning/GROUP_SELECTION.md: a FirmwareUpdateJob can now target a
set of BMCs via an SMD user-defined group instead of a single BMC. Per-BMC
component selection (targets/component) is unchanged and applied to each member.

Schema (apis/.../firmwareupdatejob_types.go):
- Add spec fields: groupRef, maxParallel, allowPartialTargets
- Make targetAddress optional; enforce targetAddress XOR groupRef in Validate
- Add status fields: resolutionDetail, memberCount, completedCount, failedMembers

SMD integration (internal/smd):
- Read-only HSM v2 client: group fetch + ComponentEndpoint -> BMC FQDN
- Configurable via SMD_BASE_URL (default http://smd:27779/hsm/v2) and optional
  SMD_TOKEN bearer

Reconciler (pkg/reconcilers):
- Resolve group members to BMCs (SMD-authoritative), de-dup by BMC FQDN
- Bounded-parallel fan-out (maxParallel, default 1) reusing the once-resolved
  OCI payload; all-members-must-succeed aggregation
- allowPartialTargets controls strict vs. partial resolution
- isTerminalError now unwraps wrapped errors via errors.As

Tests: validation selector rules, SMD client contract mapping, group
resolution, and parallelism-bound tests. Backward compatible: single
targetAddress jobs are unchanged.

Handoff (planning/HANDOFF_GROUP_SELECTION.md):
- Status: implemented + verified; fabrica generate, go mod tidy, go vet,
  go build, and go test ./... all pass
- Documents group selection logic, verified curl commands (validation 400/201,
  group-mode Resolving->Failed progression, terminal "group not found"),
  operational/debugging notes, and exact SMD endpoints + error->state mapping
- Records 12 plan deviations/decisions made autonomously (open items in plan
  Section 8, user unavailable), notably: username/password kept required and
  shared across members (resolves a plan/schema conflict); maxParallel=0 treated
  as unset->default 1; static-token/no-passthrough SMD auth; malformed SMD
  response handled as transient-then-failed; ?partition filtering and SMD lock
  gating not implemented (lock deferred to LOCKING_SUPPORT.md per the plan)
- All seven acceptance criteria marked satisfied

Signed-off-by: jvd10 <jay.depasse@hpe.com>
@jvd10 jvd10 closed this Jul 9, 2026
@jvd10
jvd10 deleted the group-selection-plan branch July 9, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants