Add/update filtered-sum-bms benchmark
This commit is contained in:
21
spot-launcher/updateSpotPricing.js
Executable file
21
spot-launcher/updateSpotPricing.js
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/env zx
|
||||
import fs from "fs"
|
||||
import { exit } from "process";
|
||||
|
||||
const targetNumberOfCores = 28
|
||||
|
||||
|
||||
const regions = JSON.parse(await $`aws ec2 describe-regions`).Regions.map(r => r.RegionName);
|
||||
|
||||
console.log("Available regions:", regions);
|
||||
|
||||
let pricings = []
|
||||
|
||||
for (const region of regions) {
|
||||
console.log("Fetching spot pricing data for region", region)
|
||||
const pricing = JSON.parse(await $`aws ec2 describe-spot-price-history --start-time ${new Date().toISOString()} --end-time ${new Date().toISOString()} --product-descriptions=Linux/UNIX --region ${region}`).SpotPriceHistory
|
||||
pricings = pricings.concat(pricing)
|
||||
}
|
||||
|
||||
console.log("Spot pricing data:", pricings)
|
||||
fs.writeFileSync("spot-pricing.json", JSON.stringify(pricings, null, 2), "utf-8")
|
||||
Reference in New Issue
Block a user