Skip to content

Conversation

bwagner5
Copy link
Contributor

Issue #, if available:
N/A

Description of changes:

  • Accept GiB instead of MiB to memory and gpu-memory

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@bwagner5 bwagner5 requested a review from haugenj July 20, 2020 20:46
Copy link
Contributor

@brycahta brycahta left a comment

Choose a reason for hiding this comment

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

Looks good overall! just some nits with comment corrections.

Out of curiosity, did you consider taking either as input (MiB or GiB) in an effort to maintain backwards compat? I feel like one could establish some reasonable bounds to determine whether the input was MiB or GiB, but figured you'd have more context/already figured out it wouldn't work.

@codecov-commenter
Copy link

codecov-commenter commented Jul 20, 2020

Codecov Report

Merging #36 into master will decrease coverage by 1.13%.
The diff coverage is 81.32%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
- Coverage   90.05%   88.92%   -1.14%     
==========================================
  Files           8        9       +1     
  Lines         875     1056     +181     
==========================================
+ Hits          788      939     +151     
- Misses         57       81      +24     
- Partials       30       36       +6     
Impacted Files Coverage Δ
pkg/selector/types.go 100.00% <ø> (ø)
pkg/selector/selector.go 84.51% <31.25%> (-0.80%) ⬇️
pkg/cli/types.go 95.28% <78.26%> (-4.72%) ⬇️
pkg/cli/cli.go 86.00% <82.35%> (+0.51%) ⬆️
pkg/cli/flags.go 87.70% <83.33%> (-2.82%) ⬇️
pkg/bytequantity/bytequantity.go 87.30% <87.30%> (ø)
pkg/selector/aggregates.go 92.45% <100.00%> (ø)
pkg/selector/comparators.go 91.46% <100.00%> (+0.43%) ⬆️
pkg/selector/outputs/outputs.go 91.81% <100.00%> (ø)
... and 1 more

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 be67b3f...5dd8215. Read the comment docs.

@bwagner5
Copy link
Contributor Author

@brycahta I don't think it would work to accept both without a suffix. There are currently 32 instance types that have between 512-24,576 GiB of memory and 88 instance types that have between 512-21,000 MiB which would overlap the top 32. The user experience of not knowing exactly what the input will be parsed as seems bad too.

I did consider a suffix --memory 512mb or --memory 512gb which I think makes sense. But it still seems like it was a mistake to default to MiB, so I still think we need to change to GiB as the default, and probably better earlier rather than later.

--memory 512 == --memory 512gb
--memory 0.5 == --memory 512mb

brycahta
brycahta previously approved these changes Jul 21, 2020
Copy link
Contributor

@brycahta brycahta left a comment

Choose a reason for hiding this comment

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

add suffixes

@bwagner5
Copy link
Contributor Author

there seems to be something wrong with this travis VM. I ran the tests on the same branch on my fork and everything passes: https://travis-ci.org/github/bwagner5/amazon-ec2-instance-selector/builds/711445177

Copy link
Contributor

@brycahta brycahta left a comment

Choose a reason for hiding this comment

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

had a couple minor comments but overall looks solid 👍🏼 Loving the support for all the units!

Copy link
Contributor

@brycahta brycahta left a comment

Choose a reason for hiding this comment

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

LGTM👍🏼

Copy link
Contributor

@haugenj haugenj left a comment

Choose a reason for hiding this comment

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

LGTM 👍

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.

4 participants