-
Notifications
You must be signed in to change notification settings - Fork 5
Add support for Amazon EC2 spot instances #133
Conversation
Axemblr.com » axemblr-provisionr #33 SUCCESS |
Axemblr.com » axemblr-provisionr #34 SUCCESS |
} catch (Exception e) { | ||
// Do nothing because it woke up early. | ||
} | ||
} while (anyOpen); |
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 loop needs to be implemented as an activity similar to:
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've changed this in the latest commit, but I still need to figure out what the exact responsibilities of the BPM are to see if I can also skip the polling of "open" requests.
Axemblr.com » axemblr-provisionr #35 SUCCESS |
Axemblr.com » axemblr-provisionr #36 SUCCESS |
Axemblr.com » axemblr-provisionr #37 SUCCESS |
Axemblr.com » axemblr-provisionr #38 SUCCESS |
} | ||
} catch (AmazonServiceException exception) { | ||
// TODO: what happens here when the request id isn't found? | ||
// The error code needs to be checked, I couldn't find anything in the docs yet. |
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.
Unless we know for sure you can always propagate the exception. The processEngine will automatically retry the activity as expected.
Axemblr.com » axemblr-provisionr #41 SUCCESS |
Axemblr.com » axemblr-provisionr #42 SUCCESS |
Axemblr.com » axemblr-provisionr #43 SUCCESS |
As you make progress on this you should probably squash commits as needed and update the branch using --force. |
|
||
protected List<Instance> collectInstancesFromReservations(List<Reservation> reservation) { | ||
/* Make a copy as an ArrayList to force lazy collection evaluation */ | ||
List<List<Instance>> allInstances = Lists.newArrayList(Lists.transform(reservation, new Function<Reservation, List<Instance>>() { |
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.
A defensive copy is not needed here
|
||
@Option(name = "-b", aliases = "--bid", description = "Bid for Amazon Spot Instance. If specified, requests" + | ||
"spot instances, otherwise defaults to on demand instances.") | ||
private Float spotBid; |
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 need to implement this as a generic option. E.g. provisionr:create --provider-option bid=0.04
execution.getVariable(ProcessVariables.SPOT_INSTANCE_REQUEST_IDS)); | ||
if (alreadySent.isPresent()) { | ||
try { | ||
Thread.sleep(60 * 1000); |
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 would implement this as a loop that calls describeSpotInstanceRequests every 10 seconds for 1 minute or more. Check Stopwatch from Guava.
Looks good overall! Great job! |
- added generic option for provider-specific properties with tests - fixed formatting and comments - better collection handling with Guava - used polling & stopwatches instead of just sleeping when waiting for spot requests
Axemblr.com » axemblr-provisionr #48 FAILURE |
The build error and the merge conflicts seem strange to me:
However, if I do:
|
You have to rebase. I have pushed new code to master. |
I think I'm doing it right, but probably I'm wrong. :) Here's my full output, I ran it now:
Doesn't fetch get me the latest commits from |
Yes that should work. Check the log and you should probably close this pull request and create a new one attached to issue #52 (using hub pull-request -i 52) |
I've managed to get the latest code through I managed to merge it, but now I can't rebuild my Eclipse projects. I get the following error:
I will create a new pull request attached to #52. |
Axemblr.com » axemblr-provisionr #49 UNSTABLE |
http://aws.amazon.com/ec2/spot-instances/
Related issue #52