This repository was archived by the owner on Apr 3, 2018. It is now read-only.
Repository navigation
pkg: oci: support OCI spec cpu quota/period - #344
Merged
Merged
Conversation
sboeuf
suggested changes
Aug 17, 2017
sboeuf
left a comment
Collaborator
There was a problem hiding this comment.
One comment but the change looks fine :)
| quota := *ocispec.Linux.Resources.CPU.Quota | ||
| period := *ocispec.Linux.Resources.CPU.Period | ||
|
|
||
| if quota < 0 { |
Collaborator
There was a problem hiding this comment.
We want to test:
if quota <= 0 {as we did for the memory. Otherwise, in case quota == 0, we are gonna end up with resources.VCPUs = 0 because (period -1) / period will return 0.
Contributor
Author
There was a problem hiding this comment.
Right. I also will check period is not zero.
We should run VM(container) regarding OCI spec config.json cpu quota and period. The number of VM VCPUs is defined by quota/period (round up to 1). Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
Collaborator
|
LGTM |
Collaborator
|
@jodh-intel @grahamwhaley please give us your opinion before I merge this. |
Collaborator
jodh-intel
pushed a commit
to jodh-intel/runtime
that referenced
this pull request
Sep 8, 2017
Mention that although `--cpus` is not supported, `--cpu-quota` and `--cpu-period` are [1]. Fixes clearcontainers#494. [1] - See containers/virtcontainers#344 and clearcontainers#436. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
jodh-intel
pushed a commit
to jodh-intel/runtime
that referenced
this pull request
Sep 8, 2017
Mention that although `--cpus` is not supported, `--cpu-quota` and `--cpu-period` are [1]. Fixes clearcontainers#494. [1] - See containers/virtcontainers#344 and clearcontainers#436. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We should run VM(container) regarding OCI spec config.json cpu quota and
period.
The number of VM VCPUs is defined by quota/period (round up to 1).
Signed-off-by: WANG Chao chao.wang@ucloud.cn
--
Original issues is clearcontainers/runtime#393