Path: blob/master/src/packages/util/licenses/purchase/cost-versions.ts
6055 views
// We hard code the prices for licenses (and all versions of them) because they must1// remain with the system forever, since we always want to be able to easily compute2// the value of any existing licenses. For pay-as-you-go, on the other hand, the charges3// are always short live and ephemeral, and the parameters for them are in the database.45// OBVIOUSLY: NEVER EVER CHANGE the existing parameters that define the value of6// a specific released version of a license! If you make any change, then you must assign a7// new version number and also keep the old version around!!!!89const COST = {101: {11// Subscription discount12SUB_DISCOUNT: { no: 1, monthly: 0.9, yearly: 0.85 },13// See https://cloud.google.com/compute/vm-instance-pricing#e2_custommachinetypepricing14// for the monthly GCE prices15GCE_COSTS: {16ram: 0.67, // for pre-emptibles17cpu: 5, // for pre-emptibles18disk: 0.04, // per GB/month19non_pre_factor: 3.5, // Roughly Google's factor for non-preemptible's20},2122// Our price = GCE price times this. We charge LESS than Google VM's, due to our gamble23// on having multiple users on a node at once.24// 2022-06: price increase "version 2", from 0.75 → 0.8 to compensate for 15% higher GCE prices25// and there is also a minimum of 3gb storage (the free base quota) now.26COST_MULTIPLIER: 0.8,27// We gamble that projects are packed at least twice as densely on non-member28// nodes (it's often worse).29NONMEMBER_DENSITY: 2,30// Changing this doesn't change the actual academic prices --31// it just changes the *business* prices.32ACADEMIC_DISCOUNT: 0.6,33// Disk factor is based on how many copies of user data we have, plus guesses about34// bandwidth to transfer data around (to/from cloud storage, backblaze, etc.).35// 10 since we have about that many copies of user data, plus snapshots, and36// we store their data long after they stop paying...37DISK_FACTOR: 10,3839// These are based on what we observe in practice, what works well,40// and what is configured in our backend autoscalers. This only41// impacts the cost of dedicated cpu and RAM.42RAM_OVERCOMMIT: 5,43CPU_OVERCOMMIT: 10,4445// Extra charge if project will always be on. Really we are gambling that46// projects that are not always on, are off much of the time (at least 50%).47// We use this factor since a 50-simultaneous active projects license could48// easily be used about half of the time during a week in a large class.49ALWAYS_RUNNING_FACTOR: 2,50},51522: {53SUB_DISCOUNT: { no: 1, monthly: 0.85, yearly: 0.75 },54GCE_COSTS: {55ram: 0.7,56cpu: 5,57disk: 0.1,58non_pre_factor: 3.5,59},60COST_MULTIPLIER: 0.9,61NONMEMBER_DENSITY: 2,62ACADEMIC_DISCOUNT: 0.6,63DISK_FACTOR: 10,64RAM_OVERCOMMIT: 5,65CPU_OVERCOMMIT: 10,66ALWAYS_RUNNING_FACTOR: 2,67},68693: {70SUB_DISCOUNT: { no: 1, monthly: 0.9, yearly: 0.75 },71GCE_COSTS: {72ram: 0.625, // for pre-emptibles73cpu: 5, // for pre-emptibles74disk: 0.04, // per GB/month75non_pre_factor: 3.5, // Roughly Google's factor for non-preemptible's76},77// 2025-08: Andrey increases it to 178COST_MULTIPLIER: 1,79NONMEMBER_DENSITY: 2,80ACADEMIC_DISCOUNT: 0.6,81// 2025-08: in anticipation of new file storage82DISK_FACTOR: 6.25,83RAM_OVERCOMMIT: 5,84CPU_OVERCOMMIT: 10,85ALWAYS_RUNNING_FACTOR: 2,86},8788// this version is PURELY for testing purposes89test_1: {90SUB_DISCOUNT: { no: 1, monthly: 0.9, yearly: 0.85 },91GCE_COSTS: {92ram: 0.67,93cpu: 5,94disk: 0.04,95non_pre_factor: 3.5,96},97COST_MULTIPLIER: 1.6, // double version 198NONMEMBER_DENSITY: 2,99ACADEMIC_DISCOUNT: 0.6,100DISK_FACTOR: 10,101RAM_OVERCOMMIT: 5,102CPU_OVERCOMMIT: 10,103ALWAYS_RUNNING_FACTOR: 2,104},105} as const;106107export default COST;108109110