-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add condition to check --cpus count with available cpu count #10388
Conversation
Hi @BLasan. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Can one of the admins verify this patch? |
399c23d
to
8b84fa7
Compare
@afbjorklund @medyagh Please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BLasan do u mind putting the out Before and After this PR in the PR Description ?
Added. Please take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BLasan
thank you for fixing this, lets improve the Exit message with advice for Docker Desktop on Mac and windows so they can allocate more CPUs
But only if there are more CPUs available on the host, than what is actually allocated to the Docker VM (reported by it) Typical scenario would be that the host has 4 CPU (hyperthreads), but that the Docker VM only has 2 vCPU (by default). So if user is trying to limit docker to 4 CPU, there would be this instruction. You can increase the VM, to use 4 vCPU. But if they are trying to limit it to 8 CPU, the error from this change would apply... There is no more hardware available. |
cmd/minikube/cmd/start.go
Outdated
@@ -1029,6 +1029,18 @@ func validateCPUCount(drvName string) { | |||
|
|||
} | |||
|
|||
if si.CPUs < cpuCount { | |||
out.Step(style.Empty, `- Ensure your {{.driver_name}} daemon has access to enough CPU/memory resources.`, out.V{"driver_name": drvName}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we want to show this advice only for Docker Desktop Drivers (docker on mac and windows) and not other drivers (kvm or docker on linux...)
so lets add this check
if driver.IsDockerDesktop(drvName) {
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added. Please review sir
@medyagh @afbjorklund please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you @BLasan
/ok-to-test |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BLasan, medyagh 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 |
kvm2 Driver |
@medyagh Any remaining work to be done sir? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you
fixes #10386
Added a condition to check the argument value(--cpus) is less than the available cpus in the system
Before PR
When passing a value for --cpus argument, even if the value is larger than the available cpu count, it was going to print an error message which was not appropriate. see the logs mentioned in the issue #10386
After PR
It'll print an appropriate error message according to the newly added condition. See changes in this PR