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
{{ message }}
Repository navigation
Plan selection: provider price presets for cost models 1 and 2 (#683 follow-up) #742
A deployment runs on AWS Fargate and wants plan selection to price candidates as it is billed: vCPU-seconds plus memory GB-seconds, i.e. cost model 1.
// What the deployment can pass today:let cost_model = CostModel::UsageOverTime(ResourceUnitCost::illustrative());
ResourceUnitCost::illustrative() (crates/plan-selection/src/lib.rs) holds made-up numbers: cost_per_cpu_op: 1e-6, cost_per_memory_byte_second: 1.25e-7, cost_per_provisioned_cpu_core_second: 1_000.0, cost_per_disk_byte_second: 0.0. They are not tied to any provider, so the selected plan's cost is not a dollar figure for any real deployment. Each deployment has to work out its own ResourceUnitCost by hand.
Expected: a deployment picks a named preset, for example a "serverless (Fargate-like)" preset for cost model 1 and a "provisioned VM (EC2-like)" preset for cost model 2. Each preset records where its numbers come from and the date they were checked.
Cause
The cost models themselves landed in #723 (CostModel::{UsageOverTime, ProvisionedCapacity, ClusterCapacity}). The billing survey in #683 ("To do: confirm each against the provider's current pricing docs, then use them to set defaults or presets for w1–w3") was never done, so only the illustrative prices exist.
Add a small set of presets to ResourceUnitCost: one per billing style. Each converts the provider's units into the planner's units (per CPU operation, per byte-second), and the conversion is documented next to the numbers.
Record the source URL and check date in the doc comment. The prices are inputs that change, not facts the planner depends on.
stage_pipeline accepts the preset name for --cost-model.
Scope and acceptance
Presets for cost model 1 and cost model 2. Cost model 3 (cluster capacity) has no prices.
A test that Example 4 under each preset selects a plan and reports its cost.
The CPU-operation conversion (operations per core-second) is stated and is the same one Stage 3 uses for latency.
Related
Follow-up of #683 (closed: cost models 1–3 merged in #723). Measured operation costs: #734. Deployment inputs bundle: #525.
Activity