Repository navigation
fix(framework): default Volcano HighestTierAllowed when unset - #4101
DevaanshPathak wants to merge 2 commits into
Conversation
Avoid a nil pointer panic in Volcano.Build when networkTopology is set without highestTierAllowed, and copy resource quantities before Mul so Build does not mutate the caller's Info. Fixes kubeflow#4100 Signed-off-by: DevaanshPathak <devaanshpathak08@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
|
Hi @johnugeorge, gentle ping for a review and |
|
Thanks @DevaanshPathak. Both changes look correct to me. I looked further into the DeepCopy one since it is the less obvious of the two, and it turns out to be a real bug the current tests cannot see. The mutation is real with ordinary values. A fractional binary quantity like Why the suite does not catch it. With the DeepCopy reverted and your HighestTierAllowed change kept,
Two small test changes pin it: build a fresh if c.expectInfo != nil {
if diff := gocmp.Diff(c.expectInfo.TemplateSpec.PodSets, c.info.TemplateSpec.PodSets); len(diff) != 0 {
t.Errorf("Build mutated info.TemplateSpec.PodSets (-want, +got):\n%s", diff)
}
}With both in place, the existing That is 0.5Gi becoming 2Gi, the 4x multiplier written back into the caller's PodSet. On this branch it passes. The same loop exists in the Coscheduling plugin, which I think your #4105 covers. On HighestTierAllowed: I also checked this against #4127, which touches the priority class block in the same function; the two merge cleanly. How I checked thisWhich parsed values alias. For each value: parse it, take a value copy as the range loop does, call
So the trigger is a fractional binary-suffix value, sub-nano precision, or a value too large for the int64 form. Build itself. A PodSet with
Existing suite. On this branch with only the DeepCopy reverted (HighestTierAllowed change kept), Merge. |
Build a fresh Info per case and assert PodSets are unchanged after Build so fractional binary quantities cannot silently alias across cases. Signed-off-by: DevaanshPathak <devaanshpathak08@gmail.com>
|
Thanks @abhishekKokadwar for digging into the DeepCopy path — that fractional I updated the tests along the lines you suggested:
|
|
Hi @johnugeorge, gentle ping for a review and |
|
Thanks @DevaanshPathak, I went through 2eb7e4e. Both test changes are in as described, and they do their job: on this branch
One thing to fix before this can merge: the branch is based on 44819cf, and since then #4059 added two cases to After rebasing onto master, replacing those four with Since the PR has not run CI yet: /ok-to-test |
Summary
NetworkTopology.HighestTierAllowedto1inVolcano.Buildso runtimes withnetworkTopologyset buthighestTierAllowedomitted no longer panic.Mulso Build does not mutate the caller'sInfo.TemplateSpecresources.HighestTierAllowed.Fixes #4100
Test plan
go test ./pkg/runtime/framework/plugins/volcano/ -count=1