Add ctr support for CPUMax and CPUShares#6809
Conversation
|
Hi @jterry75. Thanks for your PR. I'm waiting for a containerd 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/test-infra repository. |
Looks like the unit tests need to be updated too. |
|
Well its kinda a lame test because it doesnt make sense to call WithWindowsCPU* when its LCOW, but either way those methods dont touch Linux so they shouldnt create that resource. I have broken apart |
|
Build succeeded.
|
|
@kevpar - Mind taking a look when you get some time. Thanks! Just a testing change really but it could be used by consumers of the oci package later. Works like a champ though |
| }, | ||
| cli.Uint64Flag{ | ||
| Name: "cpu-max", | ||
| Usage: "The number of processor cycles threads in a container can use per 10,000 cycles. Set to a percentage times 100. Between 0 and 10,000", |
There was a problem hiding this comment.
I think this actually has to be at least 1. Under the hood this translates to setting via JOBOBJECT_CPU_RATE_CONTROL_INFORMATION, and the CpuRate member can't be 0.
There was a problem hiding this comment.
Good catch! Thanks Kevin
kevpar
left a comment
There was a problem hiding this comment.
Minor comment but LGTM. Thanks Justin!
Adds CPU.Maximum and CPU.Shares support to the ctr cmdline for testing Signed-off-by: Justin Terry <[email protected]>
Adds CPU.Maximum and CPU.Shares support to the ctr
cmdline for testing
Signed-off-by: Justin Terry [email protected]