runtime-spec
runtime-spec copied to clipboard
config-linux: add systemd cgroup path convention
The systemd cgroup path convention currently implemented in runtimes like runc/crun should be added to the spec. For more information, please kindly refer to e.g. runc systemd cgroup driver doc:
https://github.com/opencontainers/runc/blame/main/docs/systemd.md.
This patch adds the systemd cgroup convention for Linux.CgroupsPath which is in the slice:prefix:name form and clarifies the detailed usage.
Fixes https://github.com/opencontainers/runtime-spec/issues/1021
We should just have a documentation for the existing implementation of systemd
cgroupsPath, e.g.user.slice:nerdctl:deadbeefhttps://github.com/containerd/nerdctl/blob/07c3ca23743308987aa3b26b1fb7b560804ff9a4/cmd/nerdctl/run_cgroup_linux.go#L53I don't think we need to add new fields to the spec.
@AkihiroSuda Thanks for the comments!
Actually I thought over this a bit. My original intention was trying to make it consistent for all implementations, since I'm not certain if they all follow the exactly same cgroups path convention and use it the same way. I went through runc, crun and youki to double check:
- they all follow "slice:prefix:name" convention;
- the behavior of parsing and using scope/slice maybe different, e.g., crun seems not support slice unit name.
I agree it's fine to only add docs, just need more clarification. Let me do an update.
Besides, do you think it's reasonable to add a field for enabling/disabling "systemd-cgroup"? Thanks!
We should just have a documentation for the existing implementation of systemd
cgroupsPath, e.g.user.slice:nerdctl:deadbeefhttps://github.com/containerd/nerdctl/blob/07c3ca23743308987aa3b26b1fb7b560804ff9a4/cmd/nerdctl/run_cgroup_linux.go#L53I don't think we need to add new fields to the spec.
@AkihiroSuda Updated. PTAL, thanks!
@kolyshkin PTAL
perhaps it makes sense to at least refer to the source document(s) in the commit message.
Added in the commit message.
What's missing from this description is
- all three components are optional;
- what the defaults for omitted components are (or can be)
Updated and reflected in the spec descriptions.
@kailun-qin thanks!
Have you checked this against crun? IOW, is crun fully conformant to this spec?