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

Bug 1949387: Fix the typo in reserved calculation in auto sizing script #2527

Merged
merged 1 commit into from Apr 15, 2021

Conversation

harche
Copy link
Contributor

@harche harche commented Apr 14, 2021

Signed-off-by: Harshal Patil harpatil@redhat.com

Fixes : https://bugzilla.redhat.com/show_bug.cgi?id=1949387

- What I did
Fixed the typo in auto node sizing script

- How to verify it
Enable auto node sizing where getconf _NPROCESSORS_ONLN is 2, and the auto node sizing should not fail.

- Description for the changelog

Fix the typo reserved cpu calculation in auto sizing script

@harche harche changed the title Fix the typo reserved cpu calculation in auto sizing script Bug 1949387: Fix the typo reserved cpu calculation in auto sizing script Apr 14, 2021
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Apr 14, 2021
@openshift-ci-robot
Copy link
Contributor

@harche: This pull request references Bugzilla bug 1949387, which is invalid:

  • expected the bug to target the "4.8.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1949387: Fix the typo reserved cpu calculation in auto sizing script

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@harche
Copy link
Contributor Author

harche commented Apr 14, 2021

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@harche: This pull request references Bugzilla bug 1949387, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.8.0) matches configured target release for branch (4.8.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (schoudha@redhat.com), skipping review request.

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Apr 14, 2021
@harche harche changed the title Bug 1949387: Fix the typo reserved cpu calculation in auto sizing script Bug 1949387: Fix the typo in reserved cpu calculation in auto sizing script Apr 14, 2021
@harche
Copy link
Contributor Author

harche commented Apr 14, 2021

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 14, 2021
Signed-off-by: Harshal Patil <harpatil@redhat.com>
@harche harche changed the title Bug 1949387: Fix the typo in reserved cpu calculation in auto sizing script Bug 1949387: Fix the typo in reserved reserved calculation in auto sizing script Apr 14, 2021
@@ -37,7 +37,7 @@ contents:
recommended_systemreserved_memory=$(echo $recommended_systemreserved_memory 6.72 | awk '{print $1 + $2}')
total_memory=$((total_memory-112))
fi
if (($total_memory >= 128)); then # 2% of any memory above 128GB
if (($total_memory >= 0)); then # 2% of any memory above 128GB
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was a bug, if the memory was above 128 without this fix it will yield incorrect result.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

memory    reserved 
128           9.32Gi
129           9.34Gi
130           9.36Gi

after 128, add 2% of the remaining memory to the reserved.

@@ -46,15 +46,16 @@ contents:
total_cpu=$(getconf _NPROCESSORS_ONLN)
recommended_systemreserved_cpu=0
if (($total_cpu <= 1)); then # 6% of the first core
recommended_systemreserved_cpu=$(echo $total_cpu 0.60 | awk '{print $1 * $2}')
recommended_systemreserved_cpu=$(echo $total_cpu 0.06 | awk '{print $1 * $2}')
Copy link
Contributor Author

@harche harche Apr 14, 2021

Choose a reason for hiding this comment

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

A typo, we need to get 6% of the CPU. Because of the typo, it was getting 60%. However, since we never have system in CI or in production with just 1 CPU. This bug never surfaced.

total_cpu=0 else
recommended_systemreserved_cpu=$(echo $recommended_systemreserved_cpu $(echo $total_cpu 0.01 | awk '{print $1 * $2}') | awk '{print $1 + $2}')
total_cpu=0
else
Copy link
Contributor Author

Choose a reason for hiding this comment

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

else in this line was misplaced.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, there was a typo on line 56 where we wanted to get 1% of CPU but we were getting 10%.

@@ -65,7 +66,7 @@ contents:
recommended_systemreserved_cpu=$(echo $recommended_systemreserved_cpu 0.01 | awk '{print $1 + $2}')
total_cpu=$((total_cpu-2))
fi
if (($total_cpu >= 4)); then # 0.25% of any cores above 4 cores
if (($total_cpu >= 0)); then # 0.25% of any cores above 4 cores
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a bug too. Above 4 cores, without this fix we would start to slightly deviate away from the desired output.

Copy link
Contributor Author

@harche harche Apr 14, 2021

Choose a reason for hiding this comment

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

Core       Reserved Value
1              0.06
2              0.07
3              0.075
4              0.08
5              0.0825

after 4, keep adding 0.0025 for per cpu core

@harche
Copy link
Contributor Author

harche commented Apr 14, 2021

/hold cancel

Verified with various inputs.

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 14, 2021
@harche harche changed the title Bug 1949387: Fix the typo in reserved reserved calculation in auto sizing script Bug 1949387: Fix the typo in reserved calculation in auto sizing script Apr 14, 2021
@rphillips
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 14, 2021
@harche
Copy link
Contributor Author

harche commented Apr 14, 2021

/assign @sinnykumari

Copy link
Contributor

@sinnykumari sinnykumari left a comment

Choose a reason for hiding this comment

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

Not blocking the PR but writing unit test would be more appropriate way to make sure we are getting expecting result in each cases.

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: harche, rphillips, sinnykumari

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 14, 2021
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@harche
Copy link
Contributor Author

harche commented Apr 14, 2021

Not blocking the PR but writing unit test would be more appropriate way to make sure we are getting expecting result in each cases.

This script is embedded in rhcos ignition file. There is no way to execute this script unless deployed on the node by the installer.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

15 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 15, 2021

@harche: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-vsphere-upgrade 92b1e18 link /test e2e-vsphere-upgrade

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit fbc4d8e into openshift:master Apr 15, 2021
@openshift-ci-robot
Copy link
Contributor

@harche: All pull requests linked via external trackers have merged:

Bugzilla bug 1949387 has been moved to the MODIFIED state.

In response to this:

Bug 1949387: Fix the typo in reserved calculation in auto sizing script

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants