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

Defined API for initialization of cgroups #1530

Merged
merged 5 commits into from
May 20, 2019
Merged

Conversation

narrieta
Copy link
Member

@narrieta narrieta commented May 17, 2019

Description


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and Travis.CI is passing.

Quality of Code and Contribution Guidelines


This change is Reviewable

@codecov
Copy link

codecov bot commented May 17, 2019

Codecov Report

Merging #1530 into cgroups will increase coverage by 0.17%.
The diff coverage is 44.71%.

Impacted file tree graph

@@             Coverage Diff             @@
##           cgroups    #1530      +/-   ##
===========================================
+ Coverage     60.9%   61.07%   +0.17%     
===========================================
  Files           77       78       +1     
  Lines        10893    10919      +26     
  Branches      1560     1554       -6     
===========================================
+ Hits          6634     6669      +35     
+ Misses        3944     3935       -9     
  Partials       315      315
Impacted Files Coverage Δ
azurelinuxagent/common/cgroupstelemetry.py 32.25% <ø> (+6.98%) ⬆️
azurelinuxagent/ga/monitor.py 60.55% <ø> (+2.27%) ⬆️
azurelinuxagent/ga/update.py 88.31% <100%> (+0.11%) ⬆️
azurelinuxagent/daemon/main.py 72.91% <100%> (ø) ⬆️
azurelinuxagent/common/cgroupapi.py 34.32% <34.32%> (ø)
azurelinuxagent/common/cgroupconfigurator.py 36.47% <50%> (+4.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df97eec...0448d34. Read the comment docs.

@codecov
Copy link

codecov bot commented May 17, 2019

Codecov Report

Merging #1530 into cgroups will increase coverage by 0.17%.
The diff coverage is 44.71%.

Impacted file tree graph

@@             Coverage Diff             @@
##           cgroups    #1530      +/-   ##
===========================================
+ Coverage     60.9%   61.07%   +0.17%     
===========================================
  Files           77       78       +1     
  Lines        10893    10919      +26     
  Branches      1560     1554       -6     
===========================================
+ Hits          6634     6669      +35     
+ Misses        3944     3935       -9     
  Partials       315      315
Impacted Files Coverage Δ
azurelinuxagent/common/cgroupstelemetry.py 32.25% <ø> (+6.98%) ⬆️
azurelinuxagent/ga/monitor.py 60.55% <ø> (+2.27%) ⬆️
azurelinuxagent/ga/update.py 88.31% <100%> (+0.11%) ⬆️
azurelinuxagent/daemon/main.py 72.91% <100%> (ø) ⬆️
azurelinuxagent/common/cgroupapi.py 34.32% <34.32%> (ø)
azurelinuxagent/common/cgroupconfigurator.py 36.47% <50%> (+4.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df97eec...feee481. Read the comment docs.

Copy link
Contributor

@pgombar pgombar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a couple of comments and suggestions.

else:
raise

def _foreach_controller(self, operation, message):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method can be static.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, fixed

Determine if systemd is managing system services. If this process (presumed to be the agent) is in a CPU cgroup
that looks like one created by systemd, we can assume systemd is in use.

NOTE: This function has the side effect of mounting the cgroups file system if it is not already mounted.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When does this happen? I don't see where the mounting happens here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment was for a previous iteration of the code... i'll remove it

message=status,
log_event=False)

def _invoke_cgroup_operation(self, operation, error_message):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be static.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, fixed

@narrieta
Copy link
Member Author

@pgombar thanks for your comments. I updated the code, could you take a look at the last commit?

Copy link
Contributor

@pgombar pgombar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@narrieta narrieta merged commit ab8f394 into Azure:cgroups May 20, 2019
@narrieta narrieta deleted the cgroups_api branch May 20, 2019 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants