runtime-spec icon indicating copy to clipboard operation
runtime-spec copied to clipboard

config-linux: add systemd cgroup path convention

Open kailun-qin opened this issue 4 years ago • 5 comments

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

kailun-qin avatar Aug 05 '21 09:08 kailun-qin

We should just have a documentation for the existing implementation of systemd cgroupsPath, e.g. user.slice:nerdctl:deadbeef https://github.com/containerd/nerdctl/blob/07c3ca23743308987aa3b26b1fb7b560804ff9a4/cmd/nerdctl/run_cgroup_linux.go#L53

I 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:

  1. they all follow "slice:prefix:name" convention;
  2. 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!

kailun-qin avatar Aug 06 '21 02:08 kailun-qin

We should just have a documentation for the existing implementation of systemd cgroupsPath, e.g. user.slice:nerdctl:deadbeef https://github.com/containerd/nerdctl/blob/07c3ca23743308987aa3b26b1fb7b560804ff9a4/cmd/nerdctl/run_cgroup_linux.go#L53

I don't think we need to add new fields to the spec.

@AkihiroSuda Updated. PTAL, thanks!

kailun-qin avatar Aug 06 '21 04:08 kailun-qin

@kolyshkin PTAL

AkihiroSuda avatar Dec 09 '21 09:12 AkihiroSuda

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 avatar Sep 02 '22 06:09 kailun-qin

@kailun-qin thanks!

Have you checked this against crun? IOW, is crun fully conformant to this spec?

kolyshkin avatar Sep 02 '22 23:09 kolyshkin