Cloudy-Networks / cloudydeploys

Deploy infrastructure for games and more in the free tier of AWS
0 stars 0 forks source link

Spot Instance Chaining #10

Open ckx opened 3 years ago

ckx commented 3 years ago
  1. Setup VPC
  2. Setup Security-Groups
  3. Setup On-demand instance, pull data from S3
  4. Run Spot Watch
  5. Create a spot instance request
  6. Request gets fulfilled
  7. Put Spot Watch on the spot instance via S3
  8. Spot watch runs, checking instance metadata for an interrupt
  9. When interrupt is found, Spot Watch creates Lambda function to create new Spot Request
  10. Upload persistent data to S3 bucket
  11. IF new spot request is fulfilled within 2 minutes, move everything to new spot instance
    • Pull data from S3
    • Run Spot Watch, start cycle over again from Step 4
  12. ELSE, create on-demand instance
    • Run Spot Watch on-demand, checking the spot request status
      • IF no request exists, create one.
    • Pull data from S3
    • When Spot Request is fulfilled, move data over to new Spot Instance, Start cycle again from Step 7.