-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
Support launching spot nodes of recent instance types #295
base: master
Are you sure you want to change the base?
Conversation
e88c992
to
d343dfb
Compare
d343dfb
to
6df46ed
Compare
logger.Println("Comparing ", candidate.instanceType, " with ", | ||
current.instanceType) | ||
logger.Printf("Comparing %s with %s ", | ||
current.instanceType, candidate.instanceType) |
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.
Why switching this one to Printf
but leaving the other as Println
?
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.
I had a larger local patch in which I wanted to print on the same line the reason why the comparison failed: CPU, memory, storage, etc.
I failed to do that cleanly for now, so I reverted most of that but this hunk was missed.
virtualizationTypes: it.LinuxVirtualizationTypes, | ||
hasEBSOptimization: it.EBSOptimized, | ||
} | ||
if price.onDemand == 0 { |
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.
I'm aware it's unlikely to happen, but maybe switching to <= 0
would be safer as even if the value is negative the code would warn us.
Also according to the previous method's behaviour, shouldn't this be followed by an else
afterwards? Or a return
on the if
itself if no else is desired?
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.
This should never be negative, the check is for the zero value in case we're missing the data.
I'll revisit the if logic on Friday.
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.
I agree with @xlr-8's question and suggestion.
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.
Very minor comments. Fix them and I'll be happy to give thumbs up.
virtualizationTypes: it.LinuxVirtualizationTypes, | ||
hasEBSOptimization: it.EBSOptimized, | ||
} | ||
if price.onDemand == 0 { |
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.
I agree with @xlr-8's question and suggestion.
Does this fix #376 (AutoSpotting ignoring spot instances that it incorrectly thinks are $0)? |
Not sure if this would help you but I can explain what's going on: This covers a situation in which existing instance types are later added to new regions. In this case we may have instance type information for some other regions but on demand price is zero for the current region because at the time we compiled the instance type information that particular instance type wasn't available there. If the price is zero we currently just skip the instance type in this region. Later, once the instance becomes available we will get spot price information for it, which is all we need to launch the spot instances. This change allows us to launch the spot instances if we have spot price information about them even if we're lacking the on demand price information |
Code Climate has analyzed commit e4b072f and detected 0 issues on this pull request. View more on Code Climate. |
Issue Type
Summary
This partially fixes #294, allowing to launch spot nodes of instance types that lack on-demand pricing data.
Previously we would skip adding the type info when missing the on-demand pricing data.
For the use case of launching spot instances we can just use the spot market prices which we already have and use the rest of the instance type information (mainly hardware specs) which we ignored so far.
Code contribution checklist
to it.
guidelines.
test coverage doesn't decrease.
make full-test
.variables which are also passed as parameters to the
CloudFormation
and
Terraform
stacks defined as infrastructure code.
support per-group overrides using tags.
configurations.
proven to work using log output from various test runs.
appropriate) and formatted consistently to the existing log output.
new configuration options for both stack parameters and tag overrides.
contribution actually resolves it.