-
Notifications
You must be signed in to change notification settings - Fork 249
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
remove requirement for CPU and memory #218
base: master
Are you sure you want to change the base?
remove requirement for CPU and memory #218
Conversation
Signed-off-by: Matt Butcher <[email protected]>
| `cpu` | [`CPU`](#cpu) | Y | | Specifies the attributes of the cpu resource required for the container. | | ||
| `memory` | [`Memory`](#memory) | Y | | Specifies the attributes of the memory resource required for the container. | | ||
| `cpu` | [`CPU`](#cpu) | N | | Specifies the attributes of the cpu resource required for the container. | | ||
| `memory` | [`Memory`](#memory) | N | | Specifies the attributes of the memory resource required for the container. | |
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.
I think that making platform assume defaults for CPU and Memory can lead to difficult to debug container activation issues for the application operator.
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.
Also, if we allow relying on platforms defaults, then we should add a way by which the operator can specify resources in the application configuration so that the component can be deployed to a platform whose defaults are too low for that component.
In reply to: 335190832 [](ancestors = 335190832)
I think the premise of #182 is wrong. Resources is not optional on CPU and memory are both currently required no matter what. The As @BharatNarasimman mentioned, we'd probably want to make the entire |
The problem is that devs have NO IDEA what to set those fields to. What percentage of a CPU does the |
I closed 182, and we can continue here the discussion on whether CPU and memory should be required |
Well, in our production experience, dev has no sense of setting the right amount of CPU/MEM. Most of the time the ops can override them. It holds true that CPU and memory are both required no matter what. But what if it is set by the ops? I imagine it is predefined by an application profile (high SLO, low latency => 8 cores) or automatically set by historical estimates. |
The point of the But to make it required is probably a bad idea. I am concerned that devs will default to too-high values. Like asking for 1 CPU when they only need 0.2. |
Yes, what we have is the requirement - min resources needed to provide the intended functionality. Since the developer hands off the component.yaml to the operator, expecting that the developer specifies the minimum's needed to make the service functional is correct IMO. I agree that developer can default to higher than necessary values, but I think at that point this becomes sort of similar to the developer writing bad/ really inefficient code for his service. |
The developer probably has the best understanding of minimums required. For example, as a developer I might pull in some libraries that specify a minimum memory requirement. This concept can be extended to other hardware requirements as well. For example, as a developer, if I use a camera access library, I know that my component needs camera hardware access (although I'm not sure how this could translate to minimums, except by some custom-defined resource requirements - maybe we need a more structured extension system for this). Essentially it's the developer declaring, optionally, that this component will not work work unless you give me these minimums. I think that's an important statement for a developer to be able to make, optionally. |
On the flip side of it, the operator should be able to override the minimum requirement provided in the spec since the operator would in best position to determine the scale of the workload and the environment. Also, the developer specifies only the minimum requirement, not the real requirement. Based on this, we should provide a way for operator to override the requirements in the ops config even when the requirements in the spec are not exposed as a parameter. |
@iyyappam Ops will use a "Resource" or "Scaler" Trait to achieve this. I'd suggest leave the flexibility to ops capabilities rather than simply making this filed overwritable . To wrap up with my thoughts:
@BharatNarasimman I believe the practice is relying on "Resource" or "Scaler" Trait to step in. Default value is only "Back-up Plan" for platforms require explicit resource boundary set (e.g. VM). We should claim it better in this PR. |
This was pulled from #199 into its own issue so we could continue this dicsussion
Closes #182
Signed-off-by: Matt Butcher [email protected]