Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/util/licenses/purchase/cost-versions.ts
Views: 687
// 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},6869// this version is PURELY for testing purposes70test_1: {71SUB_DISCOUNT: { no: 1, monthly: 0.9, yearly: 0.85 },72GCE_COSTS: {73ram: 0.67,74cpu: 5,75disk: 0.04,76non_pre_factor: 3.5,77},78COST_MULTIPLIER: 1.6, // double version 179NONMEMBER_DENSITY: 2,80ACADEMIC_DISCOUNT: 0.6,81DISK_FACTOR: 10,82RAM_OVERCOMMIT: 5,83CPU_OVERCOMMIT: 10,84ALWAYS_RUNNING_FACTOR: 2,85},86} as const;8788export default COST;899091