-
Notifications
You must be signed in to change notification settings - Fork 553
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
Update cgroupsPath to cgroupName and clarify the semantics around that. #270
Conversation
Underscores (_) | ||
Dashes (-) | ||
Periods (.) | ||
In general and unless otherwise specified, regular filesystem path rules apply. |
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.
Do we need the explicit allowed-character restrictions if we're punting to “regular filesystem rules” (which are a bit more relaxed than the character restrictions you list here)?
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.
Yeah, a link would be better.
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.
In terms of characters, only the ones mentioned above are supported. But path construction follow filesystem path rules.
@hqhq: What link do you need?
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.
On Mon, Dec 28, 2015 at 11:56:49AM -0800, Vish Kannan wrote:
+In general and unless otherwise specified, regular filesystem path rules apply.
In terms of characters, only the ones mentioned above are
supported. But path construction follow filesystem path rules.
@hqhq: What link do you need?
I can't find a reference to this in the Linux kernel docs, but POSIX
says pretty clearly that everything except the null and slash bytes
are fair game as long as the full byte name isn't ‘.’ or ‘..’ 1.
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.
@vishh I was thinking of a link about the definition of "what is the allowable characters of a regular filesystem path", if that does exist. Or I'm also OK if we can't find a proper link because I think that's common enough to be accepted.
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.
Note that this is false for systemd, /
within the parent path are rejected by the dbus service.
I left a few nits inline, but except for 1 this PR is a wash for me. |
Cgroup names mimic filesystem paths closely since they express a hierarchy of cgroups. | ||
`cgroupsName` is expected to be absolute. | ||
An absolute name is one that is defined from the root cgroup `/`. | ||
For example, `/foo/bar` is acceptible. `foo/bar` is not acceptible. |
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.
s/acceptible/acceptable/
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.
Fixed.
Any thoughts about how systemd implementation should perform on this? (not a question for this PR, but for the general cgroupsPath/Name definition) |
@hqhq systemd api work with a slice and a scope name, so would have to split the name into those parts and make the call to create a scope. |
@mrunalp So we want users on systemd cgroup specify the exactly right |
Signed-off-by: Vishnu kannan <vishnuk@google.com>
// CgroupsName specifies the name of to cgroups that are created and/or joined by the container. | ||
// The name is expected to be absolute. | ||
// If resources are specified, the CgroupsName cgroups will be updated based on resources. | ||
CgroupsName string `json:"cgroupsName,omitempty"` |
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.
This should keep the *string
from #233.
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.
Why? There are only two options here, an empty string "" or a valid name.
There isn't a third system default.
On Mon, Dec 28, 2015 at 12:11 PM, W. Trevor King notifications@github.com
wrote:
In runtime_config_linux.go
#270 (comment):@@ -25,10 +25,10 @@ type LinuxRuntime struct {
// Resources contain cgroup information for handling resource constraints
// for the container
Resources *Resourcesjson:"resources,omitempty"
- // CgroupsPath specifies the path to cgroups that are created and/or joined by the container.
- // The path is expected to be relative to the cgroups mountpoint.
- // If resources are specified, the cgroups at CgroupsPath will be updated based on resources.
- CgroupsPath *string
json:"cgroupsPath,omitempty"
- // CgroupsName specifies the name of to cgroups that are created and/or joined by the container.
- // The name is expected to be absolute.
- // If resources are specified, the CgroupsName cgroups will be updated based on resources.
- CgroupsName string
json:"cgroupsName,omitempty"
This should keep the *string from #233
#233.—
Reply to this email directly or view it on GitHub
/~https://github.com/opencontainers/specs/pull/270/files#r48502724.
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.
On Mon, Dec 28, 2015 at 12:14:05PM -0800, Vish Kannan wrote:
- // CgroupsName specifies the name of to cgroups that are created and/or joined by the container.
- // The name is expected to be absolute.
- // If resources are specified, the CgroupsName cgroups will be updated based on resources.
- CgroupsName string
json:"cgroupsName,omitempty"
Why? There are only two options here, an empty string "" or a valid name.
There isn't a third system default.
This:
"cgroupsName": "",
seems illegal to me (it's not absolute). If we use missing/null
cgroupsName, we don't have to put in an absolute-path loophole for the
empty string. For more background on nil over empty strings for
“unset”, see 1 and surrounding comments, as well as 2.
@mrunalp @crosbymichael: Can you review this patch if you get a chance? |
The major problem is it's not working on systemd cgroup. Should that be concerned in spec? |
Couldn't we just state that the format of the path depends on the backend and redirect the user to those for more information? |
@hqhq: What part of this PR is not working with systemd? |
In the case of systemd, would it be possible to translate the path into a On Wed, Jan 27, 2016 at 8:01 AM Kenfe-Mickaël Laventure <
|
That's certainly doable, although in the unlikely event that systemd changes its syntax or that a new manager chooses something different we would have to update our implementation. |
On Wed, Jan 27, 2016 at 01:57:31PM -0800, Kenfe-Mickaël Laventure wrote:
I don't know how much stock I'd put in systemd's commitment to
|
The intention of I'm not sure what to be defined in specs is the best to cover these. Maybe add a new entry like |
We should probably leave this out of the spec and handle this in the runtime. Sent from my iPhone
|
Leave what out of the Spec? We have to include cgroup names right? On Thu, Jan 28, 2016 at 7:13 AM, Mrunal Patel notifications@github.com
|
@mrunalp @mlaventure @crosbymichael: How do we make progress here? The spec needs to define a standard way to specify cgroups. Systemd is an implementation detail. We need to standardize on the naming format. Otherwise the Spec and the corresponding bundle will not be portable. |
The issue is that atm both implementations are hugely different. systemd requires a name and a scope (which can't not include any So far the only way I can see us reconciliating both of them is by requiring a cgroup name of the form But I do not find this particularly elegant. |
What about converting the Linux format to systemd compatible one when On Fri, Mar 4, 2016, 11:54 AM Kenfe-Mickaël Laventure <
|
Close in favor of #493 |
@mrunalp