Path: blob/master/src/packages/util/compute/cloud/hyperstack/flavor.ts
1451 views
import { optionKey, HyperstackPriceData } from "./pricing";12// NOTE: keys here also assumed to be the flavors without a gpu below!3const HUMAN = {4s: "n1-cpu-extrasmall",5m: "n1-cpu-verysmall",6l: "n1-cpu-small",7xxl: "n1-cpu-large",8};910export function humanFlavor(flavor_name: string) {11return HUMAN[flavor_name] ?? flavor_name;12}1314export function hasGPU(15configuration: { region_name: string; flavor_name: string },16priceData: HyperstackPriceData,17): boolean {18const key = optionKey(configuration);19const data = priceData.options[key];20return !!data?.gpu;21}2223export function hasLocalSSD(24configuration: { region_name: string; flavor_name: string },25priceData: HyperstackPriceData,26): boolean {27const key = optionKey(configuration);28const data = priceData.options[key];29return !!data?.ephemeral;30}313233