Comments (7)
The EC2 API has an endpoint for it, but I haven't implemented it yet. I would gladly welcome a pull request implementing it!
from aws.ec2.
@leeper thx! will take a look.
from aws.ec2.
We currently kick out to the aws cli tools for some requests that aren't implemented here yet. Specific ones that I see in our code are request-spot-instances
, describe-spot-instance-requests
, cancel-spot-instance-requests
, describe-spot-price-history
, so those 4 (or at least the first 3) seem like the minimal set required for managing spot requests.
I'd be happy to collaborate on getting those working within aws.ec2 itself.
from aws.ec2.
Would be great to have this. If you can at least outline how you're currently using those commands, it should be pretty simple to incorporate this into the package as a set of related functions.
from aws.ec2.
Our basic workflow for spinning up the machines looks like:
- construct spot request json file for the cli tool (not needed for query API)
- that contains stuff like ImageId, KeyName, SecurityGroupIds, UserData, InstanceType, SubnetId, Monitoring, and optionally IamInstanceProfile
- place the spot request using
aws ec2 request-spot-instances
- here we also specify the spot price, instance count, expiration, and path to the json file
- it returns us json describing a set of
SpotInstanceRequests
(ex. if you request 5 instances,SpotInstanceRequests
will be a length-5 array)
- we poll
aws ec2 describe-spot-instance-requests
with the request ID's that haven't started yet. As requests are fulfilled we store the instance id's that were started by each request. - once the instances start machines or the requests time out, we cancel the requests with
aws ec2 cancel-spot-instance-requests
so they don't count against our limits (cancelling the request does not terminate the machine that the request started)
from aws.ec2.
Recent API changes have made this much easier -- it's just a matter of run_instances
adding additional parameters in query
before calling ec2HTTP
. ec2HTTP
call also has to be passed version="2016-11-15"
, because earlier versions don't accept InstanceMarketOptions
. I'm finalizing a patch that I'll be submitting shortly.
from aws.ec2.
I think this was fully closed by #34. If not, I'll reopen.
from aws.ec2.
Related Issues (20)
- API not associating Elastic IPs with allocation ID for VPC HOT 3
- disassociate_ip not implemented correctly? HOT 2
- AWS STS tokens are not used properly in `ec2HTTP`
- *describe_sgroups(filter)* does not work HOT 1
- Is it possible to start a cluster? HOT 2
- Tutorial to mimic
- Error in describe_images() HOT 9
- IAM profiles and Block Device mappings HOT 1
- upstream xml2 1.2.0 changes break ec2HTTP() HOT 3
- None of the code examples worked; PR coming HOT 1
- future + aws.ec2? HOT 1
- How to get private IP using instance ID HOT 1
- Support launch templates
- Maintaining this package HOT 4
- Specify role with run_instances()?
- Maintainer HOT 1
- Resurrect the Package HOT 2
- Implement CI
- Implement run_instances()
- Implement terminate_instances()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws.ec2.