[Tracking Issue] Support for cgroups v1
utam0k opened this issue ยท 52 comments
This issue is for tracking the implementation of cgroups.
Since devices of cgoups has already been implemented, you can implement it while referring to it.
If you are interested, you can comment on this issue and I will assign it to you.
- devices
- network(assigned @tsturzl)
The integration test is this: https://github.com/opencontainers/runtime-tools/tree/master/validation/linux_cgroups_network - pids (assigned @0xdco) utam0k#26
- hugepageLimits(assigned @Furisto) utam0k#15
- memory (assigned @tsturzl) utam0k#16
- cpu(assigned @Furisto) #63
The integration test is this: https://github.com/opencontainers/runtime-tools/tree/master/validation/linux_cgroups_cpus - blockIO(assigned @Furisto) utam0k#31
- cpuacct (assigned @yjuba) #92
- cpuset (assigned @Furisto) #63
- perf_event (assigned @fbrv) #166
- freezer (assigned @duduainankai ) #93
Goal
Each of them will be targeted to pass integration tests. If possible, it is good to have unit tests as well.
It would be helpful to have a look at the GitHub Actions file to see how to run the integration tests.
Reference
I would like to work on this issue, but as I am a beginner i didn't understood the issue so can you please guide me
Hi @utam0k, thanks for your work so far! I'm looking for some tasks to hone my Rust skills and I guess this issue looks like a perfect candidate, I'm interested in the assignment. I'll go through the cgroups to check the details, but I guess it would be beneficial to all if we could somehow have a in depth implementation discussion to better align with your vision of the project. You can DM me on Twitter: @0xdco
.
@sensaiankit How about this issue(utam0k#8), which is more recommended for beginners?
For example, src/namespaces
already has one sample test, so you can use that as an example to increase.
@0xdco Thanks! I'd like to assign you to one of cgroup's controller.
Which controller are you most interested in?
Or do you want to modify or refactor the architecture? If you have any advice on architecture or code I'd love to hear it :)
@sensaiankit How about this issue(#8), which is more recommended for beginners?
For example,src/namespaces
already has one sample test, so you can use that as an example to increase.
Okay cool looking forward for that issue. I still would like to get guidance from you, would you mind connecting somewhere like either twitter or discord
@sensaiankit Of course! If you want my guidance you can contact me on Twitter DM. I will do my best to accommodate you as my time permits. Sorry if it takes me a while to reply.
@sensaiankit Of course! If you want my guidance you can contact me on Twitter DM. I will do my best to accommodate you as my time permits. Sorry if it takes me a while to reply.
I saw your twitter account but i cant really do a dm will you please open it ?
@sensaiankit Of course! If you want my guidance you can contact me on Twitter DM. I will do my best to accommodate you as my time permits. Sorry if it takes me a while to reply.
I saw your twitter account but i cant really do a dm will you please open it ?
Sorry... I opened it.
@0xdco Thanks! I'd like to assign you to one of cgroup's controller.
Which controller are you most interested in?
Or do you want to modify or refactor the architecture? If you have any advice on architecture or code I'd love to hear it :)
You can assign me to whichever controller you think is a good easy / introductory point to the project as I'm still reading the code and the documentation(s) to get started. I will be able to start tackling it during the weekend. Depending on how successful I am in my endeavor, I might take over other available controllers to write as well. I have no plans to modify or refactor the architecture but let's see after the implementation if there are opportunities to do some cleanups.
I'm also taking a look in the railcar implementation in the hope it gives me some insights on how to implement it on youki.
Furthermore, it would be awesome if you could point me out to any resource or workflow you used to test / check the changes (other than the already stated on the README) as I'm not quite familiar with runc nor runtime-spec (taking a look at it already).
@0xdco
I assigned you to the pids of the controller. I'm thinking that it's probably not that difficult.
How about using this test provided by the opencontainers to guarantee operation? (You can test this by setting an environment variable called RUNTIME in the youki exec file.)
https://github.com/opencontainers/runtime-tools/tree/master/validation/linux_cgroups_pids
runtime-spec's document about groups is here.
https://github.com/opencontainers/runtime-spec/blob/master/config-linux.md#control-groups
It is a very good idea!
I'm also taking a look in the railcar implementation in the hope it gives me some insights on how to implement it on youki.
Can I be assigned the CPU and/or Memory, any tips you may already know of would be awesome but should be able to handle either way!
@reynn
Thanks for your interest!
I would like to assign the CPU of the controller to you. If you finish soon, I may assign another to you.
I look forward to your PR.
I'd be happy to take the memory cgroup controller.
this is another great resource for everyone: https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v1/index.html
Basically the cgroup controller is configured by interaction with a virtual filesystem. You're basically just writing specific things to certain files in a certain directory. The implementation for these should be relatively easy and straightforward for each of these once you know what needs to go where. Happy hacking!
@tsturzl
Thanks for your interest. Of course, I assigned it to you.
I'd be happy to take the memory cgroup controller.
This reference is so cool. I added it in this issue description.
this is another great resource for everyone: https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v1/index.html
I think so too. That's why I'm making this issue a good first issue
.
Basically the cgroup controller is configured by interaction with a virtual filesystem. You're basically just writing specific things to certain files in a certain directory. The implementation for these should be relatively easy and straightforward for each of these once you know what needs to go where. Happy hacking!
I would like to work on the hugepage cgroup controller.
I can go ahead an take the network controller on. The memory controller PR is just waiting to be merged after I integrate with the changes @Furisto made. I can probably be finished up with the network controller by Monday.
@tsturzl
Your work is amazing!
Okay, I'll assign you to it. I don't intend to rush it, so it would be great if you could proceed. I am sincerely waiting for your PR.
I'm happy to take another controller if there is still any available :)
@0xdco
Sorry, the blockio controller has already started by @Furisto. So, All of the controller issues have been filled.
Your PR is so great, why don't you try utam0k#24 or supporting cgroups v2 instead, which is a bit of a challenge?
If you want to make it a little less difficult, you can make it so that other utam0k#27.
I'm happy to take another controller if there is still any available :)
@0xdco
Sorry, the blockio controller has already started by @Furisto. So, All of the controller issues have been filled.
Your PR is so great, why don't you try #24 or supporting cgroups v2 instead, which is a bit of a challenge?
If you want to make it a little less difficult, you can make it so that other #27.I'm happy to take another controller if there is still any available :)
All fine! I'll start with #27 to keep me busy just right now. I'm really interested in cgroups v2, and it is indeed more challenging (I'll review the doc this week), so it would be nice to have a tracking issue for cgroups v2 implementation so that we can discuss the implementation details and track it.
@tsturzl
Since it is not in the runtime-tools test, I thought the others did not need to be supported.
Are the rest of the subsystems all in the following?
- cpuacct
- cpuset
- perfevent
- freezer
@utam0k You're right, they aren't present in the runtime-tools test suite, however I do see them implemented in runc. We do not implemented cpuacct, prefevent, or freezer which are all implemented by runc. I'm not sure how important or useful they are, or if they're worth including, I just noticed they were implemented in runc but we don't currently have them. It's easy enough to write new controllers, if we want to include them just to be as feature complete as possible. @Furisto seems to have a pretty good grasp on cgroups, and I think his input would be really valuable here. Should we implement these controllers? I'd be more than willing to jump in and finish them off if we think it's worthwhile.
@tsturzl @Furisto For example, in response to this, how about leaving it for first contributors? You two are very talented and probably know more than enough to deal with this. I'd love to have you guys around to review, what do you think?
Of course, if no one shows up in the immediate future to do it, we can all deal with it together.
@utam0k I'd like to work on perf_event!
@thinking-tower Sure, I assigned you it.
@thinking-tower There are no integration tests in this controller. So, I would like to add unit tests as much as possible. I'm looking forward to your PR :)
I would like to have a try on freezer.
I would like to have a try on freezer.
@duduainankai of course. I assigned you it.
I would like to work on cpuacct.
Hey @yjuba, you can have cpuacct if you want it. @PeterYordanov unfortunately doesn't have the time to complete it anymore.
@thinking-tower Do you have any problem? Can I help you?
@thinking-tower I'm sorry, but since there seems to be no response, I'm going to remove the assignment.
It should be pretty easy to implement, just writing the PID in the cgroup.procs
file.
@utam0k no worries, thanks for the opportunity!