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

[RFC] cgroup2: the first cut (yet another version) #103

Merged
merged 1 commit into from
Nov 4, 2019

Conversation

AkihiroSuda
Copy link
Member

alternative to #102

v2 package is completely split from v1.

Signed-off-by: Akihiro Suda akihiro.suda.cz@hco.ntt.co.jp

@AkihiroSuda AkihiroSuda changed the title cgroup2: the first cut (yet another version) [RFC] cgroup2: the first cut (yet another version) Oct 30, 2019
@codecov-io
Copy link

codecov-io commented Oct 30, 2019

Codecov Report

Merging #103 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #103   +/-   ##
=======================================
  Coverage   45.42%   45.42%           
=======================================
  Files          23       23           
  Lines        1638     1638           
=======================================
  Hits          744      744           
  Misses        768      768           
  Partials      126      126

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5fbad35...27e64bc. Read the comment docs.

@AkihiroSuda AkihiroSuda force-pushed the cgroup2-poc2 branch 2 times, most recently from 9ccab27 to 52e97a6 Compare October 30, 2019 09:15
@crosbymichael
Copy link
Member

reviewing

@crosbymichael
Copy link
Member

Looks good. How do you like this approach? Do you think we should move forward with this implementation?

I think this is nice, clean, and simple.

@AkihiroSuda
Copy link
Member Author

@fuweid PTAL

@AkihiroSuda
Copy link
Member Author

Looks good. How do you like this approach? Do you think we should move forward with this implementation?

Let's try to move forward this and see if it work.

I have still a concern how we can support systemd, but I think the systemd interface can be revisited later, because CRI and Moby don't seem using it for v1.

For CRI and Moby, it seems we only need cgroupfs-based metrics functions: #104

@AkihiroSuda
Copy link
Member Author

Will v%d directory name cause some go mod issue? 😕
https://blog.golang.org/using-go-modules

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

Nice Update!

But go.mod is kind of issue and it seems we need to cut branch for v2?

v2/utils.go Show resolved Hide resolved
v2/utils.go Outdated Show resolved Hide resolved
v2/state.go Outdated Show resolved Hide resolved
@fuweid
Copy link
Member

fuweid commented Oct 31, 2019

Will v%d directory name cause some go mod issue? 😕
https://blog.golang.org/using-go-modules

I think we can add new go.mod to support v2 version.

@AkihiroSuda
Copy link
Member Author

We have already several "v1" and "v2" pkgs in the main repo, probably we can keep this as-is?

@crosbymichael
Copy link
Member

Do we want to create a v2 branch that we can work out of for this?

@AkihiroSuda
Copy link
Member Author

As the package is separate out, unlikely to cause regression for the existing v1 code.
Probably no need to create a branch?

v2/utils.go Show resolved Hide resolved
@AkihiroSuda
Copy link
Member Author

addressed comments, but adding go.mod to v2 seems difficult

~/gopath/src/github.com/containerd/cgroups/v2$ go mod tidy                                                                  
go: finding github.com/opencontainers/runtime-spec v1.0.1                                                                                  
go: finding github.com/containerd/cgroups latest                                                                                           
go: downloading github.com/opencontainers/runtime-spec v1.0.1                                                                              
go: downloading github.com/containerd/cgroups v0.0.0-20191011165608-5fbad35c2a7e                                                           
go: extracting github.com/containerd/cgroups v0.0.0-20191011165608-5fbad35c2a7e                                                            
go: extracting github.com/opencontainers/runtime-spec v1.0.1                                                                               
github.com/containerd/cgroups/v2 imports
        github.com/containerd/cgroups/stats/v2: module github.com/containerd/cgroups@latest found (v0.0.0-20191011165608-5fbad35c2a7e), but
 does not contain package github.com/containerd/cgroups/stats/v2

@crosbymichael
Copy link
Member

just keep it simple and don't mess with go.mod if we don't have to. getting the functionality in is what is important

@AkihiroSuda
Copy link
Member Author

can we merge this as-is?

alternative to containerd#102

v2 package is completely split from v1.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
@fuweid
Copy link
Member

fuweid commented Nov 4, 2019

@AkihiroSuda how about moving stats/v2 into v2/stats? Yeah, the projects in whole org doesn't fully support go module. We do some work to prepare to migrate to go module. If we want stats out of cgroup controller functionality, we need 3 go.mod files in the future. One is for root dir of repo for v1, second one is for the stats API module, the last one is for v2 version. It seems not necessary. IMO, it is more clear to put stats/v2 into v2/stats.

And according to go.mod in v1 cgroup, it looks weird that we don't support go.mod for v2.

@AkihiroSuda
Copy link
Member Author

Moved stats/v2 to v2/stats.

Adding go.mod should be separate issue/PR.

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

Reorg package thing can be handled later
Thanks @AkihiroSuda !

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@crosbymichael
Copy link
Member

LGTM

@crosbymichael crosbymichael merged commit 6fb48e1 into containerd:master Nov 4, 2019
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.

None yet

4 participants