-
Notifications
You must be signed in to change notification settings - Fork 5
Conversation
I've started working on this, here's the first iteration that creates a spot instance request and saves the IDs of the open ones - https://github.com/cimi/axemblr-provisionr/commit/6fba680728af894b4021b1ee76fb7c63b05ca862. The logic to create the request is pretty similar to the one in RunOnDemandInstances, so I factored it out in an abstract class that inherits from AmazonActivity and gets inherited by both RunSpotInstances and RunOnDemandInstances. You can see the code here. Let me know if this works for you, I can change the design if you have something better in mind. Considering that the spot instances are not guaranteed to run, how should I handle the result? Is it enough to pass the list of running machine ids to the execution object or do you want to pass any eventual errors?
FYI, here are two tutorials from Amazon regarding spot instances in the Java SDK - basic, advanced. |
Thanks Alex! Please attach the code to this issue as a pull request (using hub [1]). I will review later today. |
Relevant related question: http://stackoverflow.com/questions/14734882/implementing-idempotency-for-aws-spot-instance-requests |
execution.setVariable(resultVariable, false); | ||
} | ||
} catch (AmazonServiceException exception) { | ||
// couldn't find relevant error codes, so we always propagate the exception |
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 can drop that try / catch construction completely - you will get the same behaviour.
Moved the logic for spot requests in separate activities: - cancel all requests - predicates to check if requests are open or active - option for the create command that enables you to specify the spot bid - process variables, Activiti flow and context for the new activities
- 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 #58 SUCCESS |
Thanks @cimi! |
Add support for starting pools that contain only spot instances.