Skip to content

deps: switch to runc/libcontainer/cgroups cgroup manager #531

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

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

dtrudg
Copy link
Member

@dtrudg dtrudg commented Jan 27, 2022

Description of the Pull Request (PR):

Switch our cgroups management dependency from containerd/cgroups to opencontainers/runc/libcontainer/cgroups in order to ease implementation of systemd / unprivileged delegation etc.

This is the first step of the process of tidying up the cgroups manager code. At this point I have chosen to:

  • Implement the existing cgroups.Manager interface with a new cgroups.ManagerLC in manager_libcontainer_linux.go. This avoids code changes in the runtime for this initial swap-out.
  • Remove the old containerd/cgroups based cgroups.ManagerV1 and cgroups.ManagerV2.
  • Retain the tests that were run against the old ManagerV1 and ManagerV2 and point them to ManagerLC.

The purpose of this approach is to first be happy that there's no impact from switching the dep out.

Refactoring will occur to address the facts that:

  • The cgroups.Manager is a pretty nasty interface... and involves a bunch of messy code in the manager to implement.
  • We can work much more directly with the libcontainer code's New/Set/Apply cycle.
  • We need to extend for systemd and rootless cgroups management.
  • Testing needs to be overhauled and expanded for the above.

Testing

The PR tests against cgroups v1 in CI (Ubuntu 20.04).

I have been testing locally against cgroups v2 unified on Fedora 35.

This fixes or addresses the following GitHub issues:

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

@dtrudg dtrudg self-assigned this Jan 27, 2022
@dtrudg dtrudg added this to the SingularityCE 3.10 milestone Jan 27, 2022
@dtrudg dtrudg force-pushed the cgroup-dep branch 4 times, most recently from a94548f to acd20cb Compare January 28, 2022 19:47
@dtrudg dtrudg changed the title WIP: deps: switch from containerd/cgroups to opencontainers/runc/libcontainer/cgroups deps: switch to runc/libcontainer/cgroups cgroup manager Jan 28, 2022
@dtrudg dtrudg force-pushed the cgroup-dep branch 3 times, most recently from 20125fb to 509cb9b Compare January 28, 2022 20:07
Add a libcontainer/cgroups based manager that implements the existing
cgroups.Manager API.

Remove the containerd/cgroups based managers.
@dtrudg dtrudg marked this pull request as ready for review January 28, 2022 23:24
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.

Migrate from containerd/cgroups to opencontainers/runc/libcontainer/cgroups
2 participants