Upgrade github.com/containerd/cgroups from v1 to v3#7601
Upgrade github.com/containerd/cgroups from v1 to v3#7601dmcgowan merged 3 commits intocontainerd:mainfrom
Conversation
|
Skipping CI for Draft Pull Request. |
819cd56 to
761679e
Compare
|
|
||
| } else { | ||
| control, err := cgroups.Load(cgroups.V1, cgroups.StaticPath(cgroupPath)) | ||
| control, err := cgroup1.Load(cgroup1.Default, cgroup1.StaticPath(cgroupPath)) |
There was a problem hiding this comment.
Let me know your thoughts about this subtle renaming. I didn't like cgroup1.V1 and renamed that to cgroup1.Default.
There was a problem hiding this comment.
Maybe you can just drop the first arg
runtime/opts/opts_linux.go
Outdated
| cg, err := cgroup2.LoadManager("/sys/fs/cgroup", i.Name) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| return cg.Delete() | ||
| } | ||
| cg, err := cgroups.Load(cgroups.V1, cgroups.StaticPath(i.Name)) | ||
| cg, err := cgroup1.Load(cgroup1.Default, cgroup1.StaticPath(i.Name)) |
There was a problem hiding this comment.
We could also make LoadManager and Load more symmetric if we do want. Not really sure why cgroup2's one is called LoadManager.
51e6c77 to
e6f3928
Compare
| } | ||
| } | ||
|
|
||
| func printWindowsStats(w *tabwriter.Writer, windowsStats *wstats.Statistics) error { |
There was a problem hiding this comment.
This is a bit of hack due to hcsshim <-> containerd cyclic dependencies and the fact that hcsshim uses gogo/protobuf.
| v1 "github.com/containerd/cgroups/v3/cgroup1/stats" | ||
| v2 "github.com/containerd/cgroups/v3/cgroup2/stats" |
There was a problem hiding this comment.
I personally like this symmetric naming :)
8cd835a to
5d0bc24
Compare
|
I do believe that rockylinux/8 would be more stable after this upgrade because of containerd/cgroups#250. |
5d0bc24 to
15e4efc
Compare
37ac690 to
9c8949d
Compare
Signed-off-by: Kazuyoshi Kato <[email protected]>
Since hcsshim still uses containerd/cgroups 1.x which uses gogo/protobuf. Signed-off-by: Kazuyoshi Kato <[email protected]>
While containerd/cgroups is only for Linux, the metrics subcommand works on Windows. Signed-off-by: Kazuyoshi Kato <[email protected]>
9c8949d to
8bb5999
Compare
This PR moves containerd/cgroups from v1 to v3. We skipped v2 because v1.0.x is having containerd/cgroups/v2 and it confused Go (see containerd/cgroups#253 (comment)).
Since this is the first (and hopefully last) time to make breaking changes on the cgroups package, I have renamed a few packages/symbols. These changes were reviewed by @AkihiroSuda on the cgroups side, but please take a look and let me know your thoughts!