-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
support cgroup2 #3799
support cgroup2 #3799
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3799 +/- ##
==========================================
- Coverage 42.33% 42.29% -0.05%
==========================================
Files 130 130
Lines 14678 14688 +10
==========================================
- Hits 6214 6212 -2
- Misses 7539 7550 +11
- Partials 925 926 +1
Continue to review full report at Codecov.
|
I know about it, its not ready yet from the cgroup lib POV |
I will update PR when containerd/cgroups reach feature-complete for memory stats |
f6d3fcd
to
3bc6ad9
Compare
Added PID metrics. I intentionally omitted other metrics so that multiple contributors can work on them in parallel as we have done in containerd/cgroups#104. (Thanks @Zyqsempai and Michael) How to test this PR$ mkdir /sys/fs/cgroup/default
$ echo +pids > /sys/fs/cgroup/default/cgroup.subtree_control
$ ctr run -t --runc-binary crun --rm docker.io/library/alpine:latest foo
$ ctr t metrics foo
ID TIMESTAMP
foo 2019-11-16 08:53:45.740847757 +0000 UTC
METRIC VALUE
pids.current 1
pids.limit 18446744073709551615
|
@AkihiroSuda Can you please create |
checklist: #3726 |
Shall we merge it? to continue working on other metrics! |
Let me test this on my setup |
Do you know the kernel configs that I need for the ebpf devices? Trying this out I get:
|
I dont' like how the stats are handled. We should output the prometheus metrics without any changes. People shouldn't have to have all new metric keys because we start using cgroups v2. We need to make the v2 code to the existing stats structs within containerd |
I just tested this and got containers running under v2 with runc. It's looking good on the runtime side, we just need to map the stats structures so that this isn't a huge burden for users. We also need to figureout what we want to do with the subtree control file whenever we create a directory for a namespace. |
kernel >= 4.15 with |
I got it to work. you need a couple others like BPF_syscall |
If separating stat structs are problematic for downstream projects, maybe we can have some translator library in |
This comment has been minimized.
This comment has been minimized.
also added commit for enabling controllers automatically |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
need to rebase 😂 |
rebased |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
* only shim v2 runc v2 ("io.containerd.runc.v2") is supported * only PID metrics is implemented. Others should be implemented in separate PRs. * lots of code duplication in v1 metrics and v2 metrics. Dedupe should be separate PR. Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Akihiro Suda <[email protected]>
Build succeeded.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @AkihiroSuda
|
||
var pidMetrics = []*metric{ | ||
{ | ||
name: "pids_v2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i feel like this shouldn't be needed, changing the metric name as the values are the same between v1 and v2. This can be updated after and I think this PR is good to be merged now.
LGTM |
* Requires containerd binaries from containerd/containerd#3799 . Metrics are unimplemented yet. * Works with crun v0.10.4, but `--security-opt seccomp=unconfined` is needed unless using master version of libseccomp ( containers/crun#156, seccomp/libseccomp#177 ) * Doesn't work with master runc yet * Resource limitations are unimplemented Signed-off-by: Akihiro Suda <[email protected]>
* Requires containerd binaries from containerd/containerd#3799 . Metrics are unimplemented yet. * Works with crun v0.10.4, but `--security-opt seccomp=unconfined` is needed unless using master version of libseccomp ( containers/crun#156, seccomp/libseccomp#177 ) * Doesn't work with master runc yet * Resource limitations are unimplemented Signed-off-by: Akihiro Suda <[email protected]> Upstream-commit: 612343618dd7dad7cf023e6263d693ab37507a92 Component: engine
Signed-off-by: Akihiro Suda [email protected]