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

Refactor the libcgroups interface #2168

Merged
merged 5 commits into from
Jul 19, 2023
Merged

Conversation

yihuaf
Copy link
Collaborator

@yihuaf yihuaf commented Jul 14, 2023

  • Refactored the cgroup creation into a struct instead of individual parameters. This reduce the amount of container_args field we have to carry across the process boundry.
  • Refactored the use of &Path vs. PathBuf in the interface.
  • Tag along since it is too small. Minor updates to the notify listener comments and variable name. Also makes it clone-able.

I have 3 more PR.

- fix the name to notify listener
- fix the structure to be clone-able

Signed-off-by: yihuaf <[email protected]>
@yihuaf yihuaf changed the title Refactor the libcgroups interface around Path and PathBuf Refactor the libcgroups interface Jul 14, 2023
@yihuaf yihuaf added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. breaking change labels Jul 14, 2023
@yihuaf yihuaf self-assigned this Jul 14, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 14, 2023

Codecov Report

Merging #2168 (f944cad) into main (49a85f6) will increase coverage by 0.39%.
The diff coverage is 36.11%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2168      +/-   ##
==========================================
+ Coverage   64.65%   65.05%   +0.39%     
==========================================
  Files         131      129       -2     
  Lines       14813    14864      +51     
==========================================
+ Hits         9578     9670      +92     
+ Misses       5235     5194      -41     

Changed the libcgroup creation interface to use config struct rather
than variables. The creation will also own/consume the config struct.
In this way, we don't have to create the cgroup manager upfront.
Instead, we can delay the creation of cgroup manager in the process when
it is needed.

Signed-off-by: yihuaf <[email protected]>
@yihuaf yihuaf requested review from utam0k and a team July 14, 2023 17:27
@utam0k
Copy link
Member

utam0k commented Jul 15, 2023

This is a breaking change to libcgroup, not libcontainer, right?

@yihuaf
Copy link
Collaborator Author

yihuaf commented Jul 15, 2023

This is a breaking change to libcgroup, not libcontainer, right?

Yes.

Signed-off-by: yihuaf <[email protected]>
Signed-off-by: yihuaf <[email protected]>
@yihuaf yihuaf requested a review from utam0k July 15, 2023 04:33
@utam0k utam0k merged commit 6162618 into youki-dev:main Jul 19, 2023
@yihuaf yihuaf deleted the yihuaf/cgroup-refactor branch July 19, 2023 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants