You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# we use spot instance, the bid price is determined by the spot price history, simply use the last price for now
205
-
# Fetching spot price history
206
-
debug "Fetching spot price history..."
207
-
get_bid_price
208
-
# Creating a spot instance request
209
-
debug "Creating a spot instance with an initial bid of ${BID_PRICE}"
210
-
# try 3 times, each time increase the bid price by 10%
198
+
# try 3 times
211
199
foriin {1..3}
212
200
do
213
201
run_spot_instance
@@ -216,20 +204,7 @@ create_runner () {
216
204
217
205
# Check if instance creation failed
218
206
if [ -z"$INSTANCE_ID" ];then
219
-
debug "Failed to create instance with bid price ${BID_PRICE}"
220
-
# if bid price is too low, and the error message contains"An error occurred (SpotMaxPriceTooLow) when calling the RunInstances operation: Your Spot request price of 0.0035200000000000023 is lower than the minimum required Spot request fulfillment price of 0.06319999999999999."
221
-
# then we extract the minimum required price and use that as the new bid price
222
-
if [[ "$INSTANCE_JSON"==*"SpotMaxPriceTooLow"* ]];then
0 commit comments