-
Notifications
You must be signed in to change notification settings - Fork 100
Add resources field to computeclass #2380 #2384
Conversation
Context is this slack thread: https://acorn-users.slack.com/archives/C03R9ME0SKC/p1702567598185389 @ibuildthecloud effectively blessed the approach conceptually |
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.
Thank you for your contribution!
Additional to my comments, I believe you also need to check in the changes generated from running make generate
. The CI would have caught that had it run.
// // Raise error to avoid conflicts with | ||
// // the "first class" fields for memory and cpu scaling | ||
// { | ||
// name: "invalid-custom-resources-limits", | ||
// resources: corev1.ResourceRequirements{ | ||
// Limits: corev1.ResourceList{ | ||
// "cpu": resource.MustParse("1"), | ||
// }, | ||
// }, | ||
// fail: true, | ||
// }, | ||
// { | ||
// name: "invalid-custom-resources-requests", | ||
// resources: corev1.ResourceRequirements{ | ||
// Requests: corev1.ResourceList{ | ||
// "memory": resource.MustParse("1"), | ||
// }, | ||
// }, | ||
// fail: true, | ||
// }, |
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 this be removed?
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.
sure, it was there because I tried to raise errors for the admin when specifying CPU and Memory in the resources field instead that on the Memory and CPU Scale fields. I don't see an easy/useful way to enforce it, since the definition of compute classes does not pass through the acorn client afaiu.
If you have any suggestion I'll give it a try, otherwise I'll go ahead removing this
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.
removed, and put into the docs the description of the behavior in case of memory/cpu passed in this field
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.
Hello @dciangot. Back from the holiday break. Now that I am properly rested, I better understand what you are saying here. If you would like to add validation for this scenario such that the above (now removed) integration test passes, you would need to add some validation logic here and here.
Adding validation logic in both places would ensure that an admin wouldn't be able to set the memory and cpu on the resources field at the API level.
Would you like to take the time to add this validation now?
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.
Sure no problem. I'll add the validation then.
pkg/controller/appdefinition/testdata/computeclass/generic-resources/existing.yaml
Show resolved
Hide resolved
Thank you @thedadams , indeed I missed that make step, sorry about that. Although there are two open comments, I pushed the changes that I found more in line with my understanding. Also, I added the update to the admin documentation, that I completely missed before. |
Enabling admins to create computeclass with GPU and accelarators in general. Signed-off-by: dciangot <[email protected]>
Signed-off-by: dciangot <[email protected]>
ac81366
to
29bb0a2
Compare
the recent commit broke the new tests for computeclass, I have rebased on the current main, hope it is ok for you |
resolve offerings introduced in acorn-io#2377 Signed-off-by: dciangot <[email protected]>
29bb0a2
to
26e076d
Compare
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.
Thank you for the contribution! Super excited to see this get in.
Insert test and validation for computeclass `resources` field. Avoiding conflicts with spec.memory and spec.cpuScaler fields Signed-off-by: Diego Ciangottini <[email protected]>
Looks like a new commit came in. WIll need rereviewed @thedadams @tylerslaton Tyler, once this is good, can you own getting it merged and shepherding it along internally (whatever that may mean...actually dont think theres much to do there other than merge) |
Yeah, it was on the latest @thedadams request. Now integration is failing, not related to the changes I made though. I can take a look later, meanwhile any hint is welcome. |
we'll rekick the tests after it officially fails to see if it was a flake |
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.
check limits and requests on one go Signed-off-by: Diego Ciangottini <[email protected]>
Merging now, thanks for the contribution @dciangot! |
The edited version of the computeclass will allow to specify any kind of resources allowed by K8s corev1.ResourceRequirements.
In principle that should be enough to enable admins to create computeclass with GPU and accelarators in general.
NOTES/QUESTIONS
Checklist
This is a title (#1216)
. Here's an example