This PR introduces a new option, AWS_USE_SPOT_INSTANCE, which creates an EC2 Spot instance with InstanceMarketOptions and destroy the Spot request when deleting the instance.
Why don't I use Fleet? Fleet does not allow the stop and start of an instance, which is not suitable for our cases. Instead, I start a persistent request of a single Spot machine.
Additionally, I found that "Spot Instances" can reduce the workspace cost by more than 80%.
Resolved #12
Usage
Create a custom provider with the URL: https://github.com/pan93412/devpod-provider-aws/releases/download/0.3.0/provider.yaml
Tests
[!NOTE]
It took some time to allow the user to restart the Spot instance, as we needed to wait for the Spot Request to be disabled completely.
[x] Spot instance should be able to run
[x] Spot instance should be able to stop and start
[x] Spot instance should be able to destroy (including their request)
[x] On-Demand instance should be able to run
[x] On-Demand should be able to stop and start
[x] On-Demand instance should be able to destroy
[x] Spot instances should shutdown automatically after the inactive interval
[x] Spot instance and their request should be destroy when deleting the workspace even when the workspace is stopped
[x] Spot instance and their request should be destroy when deleting the workspace even when the workspace is failed
Description
This PR introduces a new option,
AWS_USE_SPOT_INSTANCE
, which creates an EC2 Spot instance withInstanceMarketOptions
and destroy the Spot request when deleting the instance.Why don't I use Fleet? Fleet does not allow the stop and start of an instance, which is not suitable for our cases. Instead, I start a persistent request of a single Spot machine.
Additionally, I found that "Spot Instances" can reduce the workspace cost by more than 80%.
Resolved #12
Usage
Create a custom provider with the URL:
https://github.com/pan93412/devpod-provider-aws/releases/download/0.3.0/provider.yaml
Tests