Skip to content
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

Merged
merged 1 commit into from Aug 12, 2020

Conversation

crisesw
Copy link

@crisesw crisesw commented Aug 5, 2020

Signed-off-by: Kenneth Kang kenneth.kang@lge.com

@theopenlab-ci
Copy link

theopenlab-ci bot commented Aug 5, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Aug 5, 2020

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Aug 5, 2020

Build succeeded.

@@ -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 {
Copy link
Member

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

Copy link
Member

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

Copy link
Author

@crisesw crisesw Aug 6, 2020

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>
@theopenlab-ci
Copy link

theopenlab-ci bot commented Aug 6, 2020

Build succeeded.

@crisesw
Copy link
Author

crisesw commented Aug 6, 2020

@AkihiroSuda
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.

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fuweid fuweid merged commit 4336625 into containerd:master Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants