Fix legacy HWP tolerations not injected into ISVCs - #6892
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
7bd310a to
c3f50b1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## stable-2.x #6892 +/- ##
==============================================
- Coverage 67.93% 67.77% -0.16%
==============================================
Files 2238 2238
Lines 50847 50851 +4
Branches 14252 14255 +3
==============================================
- Hits 34541 34464 -77
- Misses 16306 16387 +81
... and 19 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Signed-off-by: Nana Nosirova <10577112+nananosirova@users.noreply.github.com>
c3f50b1 to
7e9dc2e
Compare
DaoDaoNoCode
left a comment
There was a problem hiding this comment.
Good targeted fix for the legacy HWP toleration injection bug. The root cause analysis is solid and the fix correctly addresses the issue by detecting legacy HWPs via missing metadata.uid. All CI checks pass (the E2E failure on dash-e2e-int appears pre-existing).
Left a couple of comments inline -- the main thing is an inconsistency between the two isLegacyHardwareProfile definitions in assembleInferenceService, and a few suggestions on the test coverage.
| if (!podSpecOptions.selectedHardwareProfile) { | ||
| const isLegacyHardwareProfile = | ||
| podSpecOptions.selectedHardwareProfile && | ||
| !podSpecOptions.selectedHardwareProfile.metadata.uid; |
There was a problem hiding this comment.
This definition of isLegacyHardwareProfile only checks !metadata.uid, but the other one up at line 151-153 uses !!selectedAcceleratorProfile || !metadata.uid. In practice they produce the same result because the runtime hook (useModelServingPodSpecOptionsState) never sets both selectedAcceleratorProfile and selectedHardwareProfile at the same time. But it's confusing for future readers and fragile if that invariant ever changes.
Worth aligning the two -- either extract a shared helper or at least use the same condition in both places.
nit: not blocking since it's correct today, but would prevent a subtle future bug.
|
|
||
| expect(result.spec.predictor.tolerations).toEqual( | ||
| legacyHardwareProfile.spec.scheduling?.node?.tolerations, | ||
| ); |
There was a problem hiding this comment.
The test verifies tolerations are injected for legacy HWPs, which is the core fix. Two additional things worth covering:
-
nodeSelector injection -- the test passes
nodeSelector: undefined, so the nodeSelector path in the fix (line 240-242 in the source) is never exercised for the legacy case. Adding a non-undefinednodeSelectorand asserting it appears on the result would cover the full fix. -
legacy-hardware-profile-nameannotation -- the annotation block (lines 158-161 in the source) setsopendatahub.io/legacy-hardware-profile-namefor legacy HWPs, which is how the serving config remembers which legacy profile was used. An assertion on that annotation here would give confidence the full legacy path works end-to-end.
Neither is blocking, but they'd make the test more robust.
Signed-off-by: Nana Nosirova <10577112+nananosirova@users.noreply.github.com>
Co-authored-by: Juntao Wang <37624318+DaoDaoNoCode@users.noreply.github.com>
DaoDaoNoCode
left a comment
There was a problem hiding this comment.
All three comments from the first review are addressed. The isLegacyHardwareProfile inconsistency is resolved by extracting a shared isLegacyHardwareProfileSelected helper in utils.ts that both call sites now use. The delete cast has a clear explanatory comment. The test now covers nodeSelector injection and asserts the legacy-hardware-profile-name annotation value. Unit tests pass locally (85/85). The Cypress failure (ClusterStorage - Add cluster storage with multiple workbench connections) is unrelated to this PR.
Local checks: lint pass, type-check pass, unit tests pass (5 suites, 85 tests)
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DaoDaoNoCode The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
0438a9a
into
opendatahub-io:stable-2.x


https://issues.redhat.com/browse/RHOAIENG-50153
Description
The dashboard controller isn't injecting tolerations from legacy Hardware Profiles (HWPs) into ISVCs in RHOAI 2.25. When creating an ISVC using a legacy HWP, the tolerations are not applied to the ISVC predictor spec.
Root cause: In
assembleInferenceService(), the conditionif (!podSpecOptions.selectedHardwareProfile)skips injecting tolerations whenever any hardware profile is selected. This is correct for native HWPs (where the backend controller handles injection via theopendatahub.io/hardware-profile-nameannotation), but wrong for legacy HWPs; there is no backend controller that injects tolerations for legacy profiles.Fix: Added a legacy HWP detection check based on the absence of
metadata.uid. Legacy HWPs are always in-memory objects (created byuseMigratedHardwareProfiles), never persisted to the K8s API server, so they never have auid. When a legacy HWP is detected, tolerations are injected directly into the ISVC predictor spec.How Has This Been Tested?
Manual testing:
spec.predictor.tolerationsby running:Test Impact
Request review criteria:
Self checklist (all need to be checked):
After the PR is posted & before it merges:
main