-
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 memory size sanity checking #4463
Add memory size sanity checking #4463
Conversation
Hi @blueelvis. 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? |
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.
That first merge looks weird (PR#1?), can you squash and rebase perhaps ?
I think this needs to be backwards-compatible. That is, it should accept MB.
So if the user says "2048", it should still be read as 2G - rather than as 2K.
Do you mean at the starting log like below?
|
If it still accepts a number without a suffix as megabytes, then all is fine. I thought it interpreted it as bytes EDIT: and it seems that I was right: $ ./out/minikube start --memory=2000
😄 minikube v1.1.1 on linux (amd64)
💡 Requested memory allocation (0MB) is less than the minimum allowed of 1500MB |
I am on mobile right now but yes, on a windows box, at 1000mb, the cluster
setup was crashing at random points. At 1.5gb,it started without issues so
that's why kept it default.
…On Mon 10 Jun, 2019, 10:59 PM Medya Ghazizadeh, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkg/minikube/constants/constants.go
<#4463 (comment)>:
> @@ -121,8 +121,10 @@ const (
DefaultKeepContext = false
// SHASuffix is the suffix of a SHA-256 checksum file
SHASuffix = ".sha256"
- // DefaultMemory is the default memory of a host, in megabytes
- DefaultMemory = 2048
+ // DefaultMemory is the default memory which will be allocated to minikube, parseable
+ DefaultMemory = "2048mb"
+ //MinimumMemorySizeMB is the minimum memory size, in megabytes
+ MinimumMemorySizeMB = 1500
Sure. @tstromberg <https://github.com/tstromberg> mentioned the lowest he
tried was 1.2 gb though
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4463?email_source=notifications&email_token=ABVJQI42S5DA7YZGFCSMFTDPZ2FO7A5CNFSM4HWUNWR2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB3CDQTY#discussion_r292108829>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABVJQI32RKTLXOBHXNPMTITPZ2FO7ANCNFSM4HWUNWRQ>
.
|
lets go with hard failing on less than 1024 and warning for less than 2048 mb |
Thanks for explaining, still would like to keep it to the lower limit since we are hard-coding it and since we might end up running more low-end deployments like containerd or minions that might get away with it... |
@afbjorklund @medyagh @tstromberg
All I can think of is that it would be best to standardize both of them. The issue seems to be here where the function does not have a default multiplier and returns 0 in case I can think of the following options as of now -
Also, do you think a patch should be created to fix the error handling of the Edit -- My bad on saying above that it will work with |
I would suggest keeping it backward compatible, |
/ok-to-test |
Guys, i am travelling. Thanks for the feedback! I will work on this next
week once I am back.
…-Pranav
On Sat 15 Jun, 2019, 5:53 AM Medya Ghazizadeh, ***@***.***> wrote:
***@***.**** requested changes on this pull request.
------------------------------
In pkg/minikube/constants/constants.go
<#4463 (comment)>:
> @@ -121,8 +121,10 @@ const (
DefaultKeepContext = false
// SHASuffix is the suffix of a SHA-256 checksum file
SHASuffix = ".sha256"
- // DefaultMemory is the default memory of a host, in megabytes
- DefaultMemory = 2048
+ // DefaultMemory is the default memory which will be allocated to minikube, parseable
+ DefaultMemory = "2048mb"
+ //MinimumMemorySizeMB is the minimum memory size, in megabytes
+ MinimumMemorySizeMB = 1500
lets warn the user if they are less than DefaultMemory (2048mb)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4463?email_source=notifications&email_token=ABVJQIYH4ARAWLASLC6TU53P2QHMHA5CNFSM4HWUNWR2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB3UN52A#pullrequestreview-250142440>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABVJQI3GGDPCE5RM6TBYBMTP2QHMHANCNFSM4HWUNWRQ>
.
|
290b1b2
to
7d44ae4
Compare
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.
@blueelvis: 1 invalid OWNERS file
In response to this:
Fixes #4437
- Added Sanity Check for Memory
- Refactored code to use similar format like Hard Disk size
- Added Minimum and default for Memory
Edit -- Fixed the failing test.
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.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: blueelvis The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@medyagh @afbjorklund - I rebased the PR and reverted that merge commit but this seems to be an issue because now the number of files which have been changed have increased quite a lot. Do you think it would make sense to just abandon this PR and I can send the changes from a fresh branch? |
fe8d893
to
491159a
Compare
@blueelvis it needs a rebase |
491159a
to
33602cb
Compare
33602cb
to
879d10a
Compare
Fixed the logic to check parseable size
879d10a
to
7cf7b54
Compare
@medyagh - I just rebased. Could you please check now? |
I am abandoning this PR and sending out a fresh one. The history on my local is messed up as of now. Let me clean it up and send a fresh PR. Sorry for the inconvenience. |
Fixes #4437
Edit -- Fixed the failing test.