Example usage in container
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- go, linux
- Domain
- operating-systems
Research direction
Start with the reported cgroups.Load(cgroups.V1, cgroups.NestedPath("")) call, the /sys/fs/cgroup/memory/memory.limit_in_bytes path, and the os.Getpid() behavior described in the issue. Determine the supported way to use the library inside a running container, then document the required cgroup setup and expected result or limitation.
Written by the indexing model from the issue text.
Description
Hi,
sorry for creating an issue but I didn't know where to ask a quesiton.
Can this library be used in a running container to get cgroups memory limits? I would like to get value of /sys/fs/cgroup/memory/memory.limit_in_bytes. Probably it's not safe to read that file directly hence I would like to use this lib to get the memory_limit_in_bytes.
How should be the cgroups created?
control, err := cgroups.Load(cgroups.V1, cgroups.NestedPath("")) //always error
Creating it by PID does not work either as the os.Getpid() returns 1 in the container.
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 255
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from containerd/cgroups
-
cgroup v1 blkio parser aborts on "(unknown)" device rows, causing all container stats to failPossibly taken @ShravanthReddy claimed this 94 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 72/100
containerd/cgroups#393 ·
-
Add inspection for cgroup v2 CPU quota and periodPossibly taken @linrl3 claimed this 41 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
containerd/cgroups#377 ·
-
support filter subsystem on `cgroup.Stat()` functionPossibly taken @linrl3 claimed this 41 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 45/100
containerd/cgroups#370 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
containerd/cgroups#364 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
containerd/cgroups#328 · 1 comment ·
All issues in containerd/cgroups
Similar issues
-
P3 tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
kind/feature needs-triage priority/unprioritized
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NVIDIA/k8s-test-infra#1504 ·
Maintainers usually reply within 1 day
-
Area/Infrastructure Aspect/Infra Resources Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wso2/agent-manager#2717 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
open-policy-agent/opa#9685 · 1 comment ·
Maintainers usually reply within 1 day