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

config-linux.md: add cgroupsPath entry and some modifications #823

Merged

Conversation

Mashimiao
Copy link

Signed-off-by: Ma Shimiao mashimiao.fnst@cn.fujitsu.com

config-linux.md Outdated
* ... an absolute path (starting with `/`), the runtime MUST take the path to be relative to the cgroup mount point.
* ... a relative path (not starting with `/`), the runtime MAY interpret the path relative to a runtime-determined location in the cgroup hierarchy.
* ... not specified, the runtime MAY define the default cgroup path.
#### <a name="configLinuxCgroupsPath" />Cgroups Path
Copy link
Contributor

Choose a reason for hiding this comment

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

The previous section is ## Control groups, so you only need ### here (not ####).

Copy link
Author

Choose a reason for hiding this comment

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

I just want keep consistent with blkio, cpu, and so on. Those sections all start with ####.
Do you mean we should modify them?

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean we should modify them?

Yes, and I've filed #832 to do that independent of content changes.

config-linux.md Outdated
* ... not specified, the runtime MAY define the default cgroup path.
#### <a name="configLinuxCgroupsPath" />Cgroups Path

**`cgroupsPath`** (string, OPTIONAL) path to the cgroups. It can be used to either control the cgroups hierarchy for containers or to run a new process in an existing container.The value of `cgroupsPath` is either an absolute path or a relative path.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend one sentence per line, e..g see #811 where you split multi-sentence lines in a few places. And if you don't split the sentences onto their own lines, you'll want a space before “The value”.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed, thanks

Copy link
Contributor

@wking wking left a comment

Choose a reason for hiding this comment

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

Also “smome” → “some” in the commit message summary and PR topic.

config-linux.md Outdated
* an absolute path (starting with `/`), the runtime MUST take the path to be relative to the cgroups mount point.
* a relative path (not starting with `/`), the runtime MAY interpret the path relative to a runtime-determined location in the cgroups hierarchy.

If the value is specified, the runtime MUST consistently attach to the same place in the cgroup hierarchy given the same value of `cgroupsPath`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I have no preference on “cgroup hierarchy” vs “cgroups hierarchy”, but you have “cgroup hierarchy” here and “cgroups hierarchy” on line 177 (as of f871f49).

@Mashimiao Mashimiao changed the title config-linux.md: add cgroupsPath entry and smome modifications config-linux.md: add cgroupsPath entry and some modifications May 17, 2017
config-linux.md Outdated
It can be used to either control the cgroups hierarchy for containers or to run a new process in an existing container.

The value of `cgroupsPath` is either an absolute path or a relative path.
* an absolute path (starting with `/`), the runtime MUST take the path to be relative to the cgroups mount point.

Choose a reason for hiding this comment

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

Suggest adding "In the case of" in front of this and the next line.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, updated

config-linux.md Outdated
**`cgroupsPath`** (string, OPTIONAL) path to the cgroups.
It can be used to either control the cgroups hierarchy for containers or to run a new process in an existing container.

The value of `cgroupsPath` is either an absolute path or a relative path.
Copy link
Contributor

Choose a reason for hiding this comment

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

“is” → “MUST be”? And we can punt to POSIX for formal definitions of absolute and relative paths.

And do we want to clarify how the empty string is handled ("cgroupsPath": "")? POSIX doesn't come down firmly on this point, and allows empty-string paths which may result in errors or be synonyms for .. I'd rather avoid that ambiguity in this spec and forbid explicit empty strings here (although see similar discussion in the rejected #843).

Copy link
Author

Choose a reason for hiding this comment

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

empty string means the cgroupsPath is not specified, runtime MAY define the default cgroups path as the following sentence says

Copy link
Contributor

Choose a reason for hiding this comment

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

empty string means the cgroupsPath is not specified…

Does the spec support that? I think "cgroupsPath": "" is specifying cgroupsPath, because the cgroupsPath key exists in the linux object. If we want to conflate "" with “unset” for this property (or in general?), we'd need to land spec wording to that effect.

Personally, I think life is just as easy for config authors and simpler for runtimes if we forbid empty-string values where they don't make sense. Runtimes don't have to validate configs if they don't want, so making empty strings illegal would mean that runtimes could handle those configs however they like (erroring out or conflating them with whatever other case they liked).

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request May 26, 2017
There seems to be confusion about whether the empty string (and
possible other values that match Go's zero values) qualifies as "set"
or not [1].  This commit clarifies that Go zero values are not
relevant to the spec, but it does not address how they should be
handled (I'm leaving that to follow-up work).

[1]: opencontainers#823 (comment)

Signed-off-by: W. Trevor King <wking@tremily.us>
wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request Jun 1, 2017
There seems to be confusion about whether the empty string (and
possible other values that match Go's zero values) qualifies as "set"
or not [1].  This commit clarifies that Go zero values are not
relevant to the spec, but it does not address how they should be
handled (I'm leaving that to follow-up work).

[1]: opencontainers#823 (comment)

Signed-off-by: W. Trevor King <wking@tremily.us>
@crosbymichael
Copy link
Member

We are currently reworking the cgroupsPath description #834.

@Mashimiao
Copy link
Author

@crosbymichael yeah, I noticed that, but I don't think we should close this PR. In this PR, I mainly want to add cgroupsPath entry. As you know, there is not it yet in the spec.

@crosbymichael crosbymichael reopened this Jun 2, 2017
@crosbymichael crosbymichael added this to the 1.0.0 milestone Jun 2, 2017
@hqhq
Copy link
Contributor

hqhq commented Jun 26, 2017

LGTM

Approved with PullApprove

1 similar comment
@crosbymichael
Copy link
Member

crosbymichael commented Jun 26, 2017

LGTM

Approved with PullApprove

@crosbymichael crosbymichael merged commit c3ed25a into opencontainers:master Jun 26, 2017
@vbatts vbatts mentioned this pull request Jul 5, 2017
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.

5 participants