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

cgroups v2 support (apply from v1 / OCI spec) #292

Merged
merged 1 commit into from
Aug 31, 2021

Conversation

dtrudg
Copy link
Member

@dtrudg dtrudg commented Aug 27, 2021

Description of the Pull Request (PR):

Support execution on a cgroups v2 unified hierarchy system, by using the containerd/cgroups/v2 translation of the
opencontainers/runtime-spec LinuxResources structure (which we use for cgroups config toml files) into v2 Resources. Device limits are implemented with the eBPF translation.

This will mean that existing v1 / OCI style cgroups configuration files can be used on a system configured for the unified hierarchy without an ugly failure. Also fixes failures with the oci commands on these systems.

Note that we don't yet support the Unified attribute from LinuxResources, which is a free-form map[string][string] for
expressing cgroups v2 configuration natively.

NOTE CircleCI will not test the new cgroups v2 code as it running Ubuntu 20.04 with the cgroups v1 hierarchy. I have run the tests on Debian 11 and Fedora 34, both of which use the cgroups v2 unified hierarchy.

This fixes or addresses the following GitHub issues:

Before submitting a PR, make sure you have done the following:

@dtrudg dtrudg added the enhancement New feature or request label Aug 27, 2021
@dtrudg dtrudg added this to the SingularityCE 3.9.0 milestone Aug 27, 2021
@dtrudg dtrudg self-assigned this Aug 27, 2021
@dtrudg dtrudg force-pushed the cgroups-v2 branch 11 times, most recently from 7f5d874 to 2f731cc Compare August 31, 2021 17:03
@dtrudg dtrudg marked this pull request as ready for review August 31, 2021 17:28
@dtrudg dtrudg marked this pull request as draft August 31, 2021 17:28
@dtrudg dtrudg marked this pull request as ready for review August 31, 2021 17:55
Copy link
Member

@tri-adam tri-adam left a comment

Choose a reason for hiding this comment

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

Nice work, LGTM.

Support execution on a cgroups v2 unified hierarchy system, by using
the `containerd/cgroups/v2` translation of the
`opencontainers/runtime-spec` `LinuxResources` structure (which we use
for cgroups config toml files) into v2 Resources. Device limits are
implemented with the eBPF translation.

This will mean that existing v1 / OCI style cgroups configuration
files can be used on a system configured for the unified hierarchy
without an ugly failure. Also fixes failures with the `oci` commands
on these systems.

Note that we don't yet support the Unified attribute from
LinuxResources, which is a free-form map[string][string] for
expressing cgroups v2 configuration natively.

Fixes #60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cgroups v2 support
2 participants