-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add support for CgroupsPath #397
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
Conversation
b1e24bf to
e50c039
Compare
|
We might have to discuss how |
|
@hqhq Looks like we should remove Parent if it's not in spec. |
|
@LK4D4 Yes that what I had in mind, but should we do it in this PR? Since Docker is using |
|
Thanks for the PR. @hqhq I had a different idea for the cgroupsPath support: #399 |
|
The intention behind cgroupsPath in the spec is that the container joins the path rather than creating a sub cgroup under it. |
@ashahab-altiscale I think you understand the intention of |
|
@hqhq So you're saying that even when the operator passes the cgroup using cgroupsPath, it will be modified(in terms of memory, devices, etc) by runC? |
|
@mrunalp @hqhq @ashahab-altiscale I think |
|
That's what I thought also, Alex.
|
|
On Mon, Nov 16, 2015 at 05:26:10AM -0800, Abin Shahab wrote:
Re-reading the spec 1, whether cgroupsPath can be modified or just |
|
I see 4 cases; 3 of which were discussed in the PR that merged cgroupPath into the spec -
|
|
@mrunalp As discussed, case (2) will work for me if cgroupsPath + no resrouce specification also prevents runC from setting devices.allow and devices.deny. That's what fails when the host launching runC is itself a usernamespaced container( see #350 ). Either I can update my PR or @hqhq can update this. My userns PR(#357) is blocked on this. |
|
On Mon, Nov 16, 2015 at 11:39:11AM -0800, Mrunal Patel wrote:
Ah, good (I hadn't gone back to re-read opencontainers/runtime-spec#137.
Should I file a spec PR to echo this (informative?) Go comment in the |
|
@wking That would be good. Lets not leave it to interpretation. |
|
@wking Yeah, go for it. |
This should help clarify the cgroupsPath setting added in opencontainers#137, which was the subject of some confusion in opencontainers/runc#397. Issues I'm trying to clarify here: * If you specify a cgroupsPath, is the container added to that path or a sub-cgroup underneath it [1]? (This commit rules in favor of "added to that path") * If you specify a cgroupsPath, can the runtime modify that cgroup [2]? (This commit rules "yes, if 'resources' is specified", following [3] and the Go comment from opencontainers#137 [4]). To help make the distinctions clearer, I've added a facet list to help folks think about the difference between cgroup creation, process assignment, and resource configuration. cgroupsPath is just about cgroup creation and process assignment. 'resources' is just about resource configuration. I've listed out Mrunal's first three cases [3] to be even clearer. I stayed away from the "neither are set" case, since I covered that fairly directly in opencontainers#237, which that was punted back to the list [5] and has seen no further interest. So I'm not clear on what the intended semantics are there, although Mrunal's wording in [4] seems to agree with the proposal in opencontainers#237. [1]: opencontainers/runc#397 (comment) [2]: opencontainers/runc#397 (comment) [3]: opencontainers/runc#397 (comment) [4]: opencontainers@429f936#diff-34c30be66233f08b447fb608ea0e66bbR30 [5]: https://groups.google.com/a/opencontainers.org/d/msg/dev/qWHoKs8Fsrk/c9mv6qXtDAAJ Message-ID: <[email protected]> Signed-off-by: W. Trevor King <[email protected]>
It's defined in specs, add the support to runC. Signed-off-by: Qiang Huang <[email protected]>
e50c039 to
70611b6
Compare
|
I understood the intention of @ashahab-altiscale I didn't handle devices cgroup in this PR since I think that's a separate issue. |
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.
If we want to avoid adding an additional field, we could overload Name and treat it as cgroupsPath if it is absolute. That way we don't need to have Parent, Name as well as CgroupsPath. WDYT?
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.
Yes, that's what I planed, when we merge this, we can start removing Parent and Name.
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.
hmm i think we can just start removing them here ? I think it's also clearer when we integrate this with docker too since there will be complication errors :p
This should help clarify the cgroupsPath setting added in opencontainers#137, which was the subject of some confusion in opencontainers/runc#397. Issues I'm trying to clarify here: * If you specify a cgroupsPath, is the container added to that path or a sub-cgroup underneath it [1]? (This commit rules in favor of "added to that path") * If you specify a cgroupsPath, can the runtime modify that cgroup [2]? (This commit rules "yes, if 'resources' is specified", following [3] and the Go comment from opencontainers#137 [4]). To help make the distinctions clearer, I've added a facet list to help folks think about the difference between cgroup creation, process assignment, and resource configuration. cgroupsPath is just about cgroup creation and process assignment. 'resources' is just about resource configuration. I've listed out Mrunal's first three cases [3] to be even clearer. I stayed away from the "neither are set" case, since I covered that fairly directly in opencontainers#237, which that was punted back to the list [5] and has seen no further interest. So I'm not clear on what the intended semantics are there, although Mrunal's wording in [4] seems to agree with the proposal in opencontainers#237. [1]: opencontainers/runc#397 (comment) [2]: opencontainers/runc#397 (comment) [3]: opencontainers/runc#397 (comment) [4]: opencontainers@429f936#diff-34c30be66233f08b447fb608ea0e66bbR30 [5]: https://groups.google.com/a/opencontainers.org/d/msg/dev/qWHoKs8Fsrk/c9mv6qXtDAAJ Message-ID: <[email protected]> Signed-off-by: W. Trevor King <[email protected]>
This should help clarify the cgroupsPath setting added in opencontainers#137, which was the subject of some confusion in opencontainers/runc#397. Issues I'm trying to clarify here: * If you specify a cgroupsPath, is the container added to that path or a sub-cgroup underneath it [1]? (This commit rules in favor of "added to that path") * If you specify a cgroupsPath, can the runtime modify that cgroup [2]? (This commit rules "yes, if 'resources' is specified", following [3] and the Go comment from opencontainers#137 [4]). To help make the distinctions clearer, I've added a facet list to help folks think about the difference between cgroup creation, process assignment, and resource configuration. cgroupsPath is just about cgroup creation and process assignment. 'resources' is just about resource configuration. I've listed out Mrunal's first three cases [3] to be even clearer. I stayed away from the "neither are set" case, since I covered that fairly directly in opencontainers#237, which that was punted back to the list [5] and has seen no further interest. So I'm not clear on what the intended semantics are there, although Mrunal's wording in [4] seems to agree with the proposal in opencontainers#237. [1]: opencontainers/runc#397 (comment) [2]: opencontainers/runc#397 (comment) [3]: opencontainers/runc#397 (comment) [4]: opencontainers@429f936#diff-34c30be66233f08b447fb608ea0e66bbR30 [5]: https://groups.google.com/a/opencontainers.org/d/msg/dev/qWHoKs8Fsrk/c9mv6qXtDAAJ Message-ID: <[email protected]> Signed-off-by: W. Trevor King <[email protected]>
|
IMHO, we should error out if the systemd manager has |
|
Yeah I start thinking maybe we still need to separate |
*: add support for cgroup namespace
It's defined in specs, add the support to runC.
Signed-off-by: Qiang Huang [email protected]