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

Parse --disk-size and --memory sizes with binary suffixes #7206

Merged
merged 1 commit into from
Mar 25, 2020
Merged

Parse --disk-size and --memory sizes with binary suffixes #7206

merged 1 commit into from
Mar 25, 2020

Conversation

linkvt
Copy link
Contributor

@linkvt linkvt commented Mar 24, 2020

Hi!

when enabling the istio addon I got the message that I would need more memory in my VM - to my surprise it parsed the --memory 8g parameter as 8000MB and not 8192MB.
After looking at the rest of the code which uses 1024 in various locations for calculating sizes this seems not intended - I'm of course not sure if this is really the case :).

Detailed Issue Description

 $ minikube addons enable istio
❗  Istio needs 8192MB of memory -- your configuration only allocates 4000MB
...

As it said I need to give my VM 8192MB I thought that I can just run it with --memory 8g which resulted in 8000MB instead of the expected 8GiB=8192MB:

 $ minikube start --memory 8g --cpus 4
😄  minikube v1.8.2 on Darwin 10.15.3
✨  Using the hyperkit driver based on existing profile
⌛  Reconfiguring existing host ...
🏃  Using the running hyperkit "minikube" VM ...
🐳  Preparing Kubernetes v1.17.3 on Docker 19.03.6 ...
🚀  Launching Kubernetes ...
🌟  Enabling addons: dashboard, default-storageclass, efk, ingress, logviewer, registry, storage-provisioner
🏄  Done! kubectl is now configured to use "minikube"
 $ minikube addons enable istio
❗  Istio needs 8192MB of memory -- your configuration only allocates 8000MB
...

Thanks!
Vincent

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 24, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @linkvt!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 24, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @linkvt. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 24, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: linkvt
To complete the pull request process, please assign ra489
You can assign the PR to them by writing /assign @ra489 in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@codecov-io
Copy link

Codecov Report

Merging #7206 into master will decrease coverage by 0.09%.
The diff coverage is 14.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7206      +/-   ##
==========================================
- Coverage   38.02%   37.93%   -0.10%     
==========================================
  Files         147      147              
  Lines        9017     9039      +22     
==========================================
  Hits         3429     3429              
- Misses       5164     5186      +22     
  Partials      424      424              
Impacted Files Coverage Δ
cmd/minikube/cmd/start.go 35.85% <0.00%> (-0.30%) ⬇️
pkg/minikube/cluster/pause.go 0.00% <ø> (ø)
pkg/minikube/machine/cache_images.go 0.00% <0.00%> (ø)
pkg/minikube/problem/err_map.go 100.00% <ø> (ø)
cmd/minikube/cmd/pause.go 11.11% <100.00%> (ø)
cmd/minikube/cmd/unpause.go 10.00% <100.00%> (ø)
pkg/util/utils.go 33.33% <100.00%> (ø)

@tstromberg
Copy link
Contributor

Thank you! This seems fully reasonable to me.

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 24, 2020
@minikube-pr-bot
Copy link

Error: running mkcmp: exit status 1

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

nice improvement ! thank you

@medyagh medyagh merged commit 898fe0e into kubernetes:master Mar 25, 2020
@linkvt linkvt deleted the interpret-disk-size-and-memory-parameters-as-binary-values branch March 25, 2020 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants