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

Remove (or reduce) dependency on runc libcontainer dependency #42452

Open
4 of 9 tasks
thaJeztah opened this issue Jun 1, 2021 · 2 comments
Open
4 of 9 tasks

Remove (or reduce) dependency on runc libcontainer dependency #42452

thaJeztah opened this issue Jun 1, 2021 · 2 comments
Labels
kind/refactor PR's that refactor, or clean-up code roadmap

Comments

@thaJeztah
Copy link
Member

thaJeztah commented Jun 1, 2021

The runc maintainers have indicated that the libcontainer package is not intended for external consumption, and because of that has an "unstable" API.

We should reduce our use of this dependency.

@thaJeztah thaJeztah added roadmap kind/refactor PR's that refactor, or clean-up code labels Jun 1, 2021
@AkihiroSuda
Copy link
Member

libcontainer/user Is still needed; perhaps this package should live elsewhere (also used by containerd)

Can we move this to moby/sys?

cc @kolyshkin

@thaJeztah
Copy link
Member Author

thaJeztah commented Jan 2, 2024

It looks like the only remaining part is now libcontainer/cgroups (but that brings in libcontainer/userns and libcontainer/configs, libcontainer/devices. The only uses are in daemon: withCgroups(), and for these utilities;

GetInitCgroup and GetOwnCgroup

moby/daemon/oci_linux.go

Lines 902 to 906 in 84ba255

initPath, err := cgroups.GetInitCgroup("cpu")
if err != nil {
return errors.Wrap(err, "unable to init CPU RT controller")
}
_, err = cgroups.GetOwnCgroup("cpu")

FindCgroupMountpointAndRoot:

mnt, root, err := cgroups.FindCgroupMountpointAndRoot("", "cpu")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor PR's that refactor, or clean-up code roadmap
Projects
None yet
Development

No branches or pull requests

2 participants