-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Feat: partitionable devices support #8559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Feat: partitionable devices support #8559
Conversation
Signed-off-by: MenD32 <[email protected]>
Signed-off-by: MenD32 <[email protected]>
Signed-off-by: MenD32 <[email protected]>
Signed-off-by: MenD32 <[email protected]>
Signed-off-by: MenD32 <[email protected]>
Signed-off-by: MenD32 <[email protected]>
Signed-off-by: MenD32 <[email protected]>
Signed-off-by: MenD32 <[email protected]>
|
Hi @MenD32. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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 kubernetes-sigs/prow repository. |
ba8303d to
4fa5202
Compare
|
/remove-kind api-change |
Signed-off-by: MenD32 <[email protected]>
65297e3 to
fb70fa4
Compare
| numUnallocated := float64(len(unallocated)) | ||
| return numAllocated / (numAllocated + numUnallocated) | ||
| func calculatePoolUtil(unallocated, allocated []resourceapi.Device, resourceSlices []*resourceapi.ResourceSlice) float64 { | ||
| TotalConsumedCounters := map[string]map[string]resource.Quantity{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: totalConsumedCounters?
Having a capitalized name immediately makes me thinking that it's a global exported variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right! my bad..
| numAllocated := float64(len(allocated)) | ||
| numUnallocated := float64(len(unallocated)) | ||
| return numAllocated / (numAllocated + numUnallocated) | ||
| func calculatePoolUtil(unallocated, allocated []resourceapi.Device, resourceSlices []*resourceapi.ResourceSlice) float64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment explaining how we calculate utilization? Previously it was very easy to reason about its behaviour, right now it's not obvious without throughly reading it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
| Driver: driverName, | ||
| NodeName: &nodeName, | ||
| Pool: resourceapi.ResourcePool{Name: poolName, Generation: int64(poolGen), ResourceSliceCount: 1}, | ||
| Devices: devices, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Devices and shared counters should be isolated in two separate resource slice objects as per KEP:
The SharedCounters field is mutually exlusive with the Devices field, meaning that SharedCounters must always be specified in a different ResourceSlice than devices consuming the counters. They must however be in the same resource pool with the same Generation. The value in Spec.Pool.ResourceSliceCount should include all ResourceSlices in the pool, regardless of whether they include devices, counter sets or neither.
I think that doing tests with hybrid objects would work, but it won't represent the real entities we would be able to get from the API and we may miss some bugs. Would you mind switching to having two separate resource slice objects having devices and shared counters? As I see in the current implementation - this doesn't seem to be the gap, but it may be beneficial in the long run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch! I'll fix the tests
Signed-off-by: MenD32 <[email protected]>
Signed-off-by: MenD32 <[email protected]>
…counters in testResourceSlicesWithPartionableDevices Signed-off-by: MenD32 <[email protected]>
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds support for partitionable devices when calculating DRA utilization
Which issue(s) this PR fixes:
Fixes #8053
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: