Closed tylerslaton closed 9 months ago
This will have overlap with https://github.com/acorn-io/runtime/pull/2454. I will merge that one first but want to open this up for review.
@thedadams The resolved offerings get recalculated only when the app's generation changes. I believe that means that, after this change goes in, there will be apps that don't have CPUScaler (because it is being removed) nor CPU (because it's not being set). Are we OK with this? Should we handle this case?
The resolvedOfferings CPUScaler is currently not utilized anywhere in our codebase, including any dependencies of runtime. Therefore, removing it will have no impact on existing applications. It's worth noting that while there will be instances where resolvedOfferings.CPU is not set for an application, this is acceptable because the scheduling section will ensure the retention of the previously defined request. Once that application updates it will go through the process of getting resolvedOfferings.CPU instead.
Forgive me if my memory is failing, but even though I previously approved this PR, I find this choice confusing. I think it makes the most sense to just continue using the scheduling
field for quota stuff instead of resolvedOfferings
. I also don't know why we want CPU (or CPUScaler for that matter) on resolvedOfferings, because I think that is irrelevant to the user...
Forgive me if my memory is failing, but even though I previously approved this PR, I find this choice confusing. I think it makes the most sense to just continue using the
scheduling
field for quota stuff instead ofresolvedOfferings
.
This all revolves around a recent field addition that we made to defining memory in ComputeClasses, requestScaler
for memory. Let's look at an example of this in action to help illustrate the need here. Say that we define a ComputeClass where it has a memory requestScaler
or 0.5
. If a user requests 1Gi
of memory then what they will actually have scheduled here is 512Mi
of memory. Since quota reads from the scheduling section this means we will quota for 512Mi
of memory. However, we really want to quota for 1Gi
of memory here. Our options were:
limits
section of scheduling (already vetoed)ResolvedOfferings
section of statusI also don't know why we want CPU (or CPUScaler for that matter) on resolvedOfferings, because I think that is irrelevant to the user...
I added this mainly since it is nicer to have ResolvedOfferings
field tell me what the CPU should be as opposed to using the cpuScaler
to determine what the CPU should be. In either situation I need to have an additional field tell me what (or how to calculate what) the CPU should be.
Thanks for the explanation. That makes sense now. Idk why I got so confused on Saturday lol.
This PR adjusts two main things.
cpuScaler
field from ResolvedOfferings in favor of a newcpu
field.These two things are necessary for ComputeClasses that define a requestScaler on memory as we want to quota against the requested amount, not the incoming scaled down amount.
Checklist
This is a title (#1216)
. Here's an example