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
Add --cpu-quota, --cpu-period flag to ctr #4456
Conversation
Build succeeded.
|
Build succeeded.
|
Build succeeded.
|
cmd/ctr/commands/run/run_unix.go
Outdated
@@ -220,6 +220,11 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli | |||
if limit != 0 { | |||
opts = append(opts, oci.WithMemoryLimit(limit)) | |||
} | |||
quota := context.Int64("cpu-quota") | |||
period := context.Uint64("cpu-period") | |||
if quota != -1 || period != 0 { |
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.
Let's add them near the context.Float64("cpus")
line for readability
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 should error out when --cpus
is specified together
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.
thanks for your guide.
I move descriptions to near the cpus, and change to check if cpus is used, skip applying cpu-quota and cpu-period.
Signed-off-by: Kenneth Kang <kenneth.kang@lge.com>
Build succeeded.
|
@AkihiroSuda |
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.
LGTM
Signed-off-by: Kenneth Kang kenneth.kang@lge.com