Resource limit / control #2303
Replies: 8 comments
This comment has been hidden.
This comment has been hidden.
-
|
the info is already in DB |
Beta Was this translation helpful? Give feedback.
-
|
As for tree calculation 😆 🌳, I just found https://www.epa.gov/energy/greenhouse-gas-equivalencies-calculator which can calculate something like this. They have a calculation reference at https://www.epa.gov/energy/greenhouse-gases-equivalencies-calculator-calculations-and-references#seedlings. Not sure if this can help because it just calculates CO2, but there's a converting calculation on the same page (https://www.epa.gov/energy/greenhouse-gases-equivalencies-calculator-calculations-and-references#kilowatt) to convert kWh to the CO2 emission. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment has been hidden.
This comment has been hidden.
-
|
I run into the issue by using Woodpecker on Kubernetes with Docker in Docker (dind). Resource Limits defined by k8s are ignored by the dockerd. After playing around with cgroups I could somehow get it working adding the existing pod resource limits (cgroup) to the docker deamon: (or in the /etc/docker/daemon.json with "runtimeArgs": [], see docker for more arguments) the cat command returns the cgroup path for that pod which can be found in
Perhaps someone with cgroups experience has an idea how we can clone the kubepod child cgroup into a new parent group? (@6543 ? :-) For non-k8s users (assume @fnetX ) , they can create their own cgroups limits either on the host system using systemd or self defined cgroups in the dind with cgcreate. More information on docker.com ... P.S. I am new to the cgroups topic and I am sure there is a better/proper way to achieve this. As this solution also causes multiple issues on the docker deamon by inspecting the logs - but somehow it works, even the resources are a bit over allocated by +10%. But as the resource limit of the agent as enough cpu/mem spare, it shouldnt be a problem at all. The downside is that dockerd does not report the cpu/mem usage to k8s - thats why enabling the metrics on the dockerd should be considered to monitor the workloads. P.P.S anyone with GPU (NVIDIA) needs, can give my docker image a try on github or dockerhub: |
Beta Was this translation helpful? Give feedback.
-
|
I did some more testing and playing around with cgroups. I finally came up with entrypoint.sh following script It either maps the resource limits from k8s, or two env variable can be set: keep in mind that running two agents on the same host will take the same cgroup... P.S. k8s uses https://github.com/containerd/cgroups to dynamic create/delete the child cgroups... |
Beta Was this translation helpful? Give feedback.
-
requested features
Currently I guess setting those limits per repo would probably be quite some maintenance afford so mainly ignoring it and suggesting to have it on the org level. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Clear and concise description of the problem
Currently, woodpecker does not limit resource power (often "CI minutes") per user. This can lead to
Suggested solution
Implement
Alternative
In #345 there is already the idea to display resource usage, but manual moderation is often not feasible.
Additional context
No response
Validations
Beta Was this translation helpful? Give feedback.
All reactions