OSAC-3183: update ocp_virt_vm role to read GPU from CR payload - #324
OSAC-3183: update ocp_virt_vm role to read GPU from CR payload#324Tzif-Morgen wants to merge 5 commits into
Conversation
Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Tzif <tmorgens@redhat.com>
…ameter Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Tzif <tmorgens@redhat.com>
Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Tzif <tmorgens@redhat.com>
Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Tzif <tmorgens@redhat.com>
Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Tzif <tmorgens@redhat.com>
|
@Tzif-Morgen: This pull request references OSAC-3183 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Tzif-Morgen The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (13)
💤 Files with no reviewable changes (5)
WalkthroughThe VM role replaces ChangesGPU specification migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to The change moves GPU configuration to the ComputeInstance payload while preserving non-GPU behavior; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant ComputeInstance
participant create_yaml
participant create_build_spec_yaml
participant configure_permitted_host_devices_yaml
participant HyperConverged
ComputeInstance->>create_yaml: provide spec.gpu
create_yaml->>create_build_spec_yaml: build VM template
create_build_spec_yaml->>create_build_spec_yaml: create hostDevices for GPU count
create_yaml->>configure_permitted_host_devices_yaml: configure permitted devices
configure_permitted_host_devices_yaml->>HyperConverged: read and patch PCI host-device state
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
|
🤖 Review · Commit: |
|
🤖 Finished Review · ✅ Success · Started 6:59 PM UTC · Completed 7:14 PM UTC Commit: |
ReviewFindingsLow
|
| @@ -1,13 +1,10 @@ | |||
| --- | |||
| - name: Build desired pciHostDevices entries from gpu_devices | |||
| - name: Build desired pciHostDevices entry from compute_instance.spec.gpu | |||
There was a problem hiding this comment.
[low] naming-convention
Task name says entry (singular) but the variable desired_pci_host_devices is a list and downstream tasks (merge logic, rejectattr) treat it as such. The singular/plural mismatch is inconsistent with the prior naming convention.
Suggested fix: Rename to Build desired pciHostDevices entries from compute_instance.spec.gpu to match the variable type.
OSAC-3183: update ocp_virt_vm role to read GPU from CR payload
Jira: OSAC-3183
Story type: [DEV]
Summary
Updates the
ocp_virt_vmAnsible role to read GPU configuration fromcompute_instance.spec.gpu(the CR payload) instead of the oldgpu_devicesrole parameter. The role now loops overspec.gpu.countto create KubeVirthostDevicesentries, each usingpciDeviceSelectorandresourceNamefrom the GpuSpec struct.Changes
gpu_devicesparameter (32 lines)range(spec.gpu.count)instead of iteratinggpu_deviceslistdesired_pci_host_devicesfrom singlespec.gpuentry; replace allgpu_devicesguards withcompute_instance.spec.gpu is definedconfigure_permitted_host_devicesincludespec.gpublock, switchtemplateIDto base roleTesting
vm_template_specoutput verified identical between branch and main for all 3 scenariosAcceptance Criteria
compute_instance.spec.gpugpu_devicesparameter removedDependencies
Summary by CodeRabbit
New Features
Bug Fixes
Tests