Skip to content

Plan selection: provider price presets for cost models 1 and 2 (#683 follow-up) #742

Closed

Description

@zzylol

Problem, by example

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.

Proposal

  1. Confirm the Plan selection cost models: usage over time (cost model 1), peak capacity (cost model 2), own-cluster trade-offs (cost model 3) #683 survey against current provider pricing pages: serverless compute (vCPU-seconds, GB-seconds), provisioned instances (per vCPU-hour and GiB-hour at the peak), and storage (GB-months).
  2. 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.
  3. Record the source URL and check date in the doc comment. The prices are inputs that change, not facts the planner depends on.
  4. 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

  1. added
    cost-modelCost formulas, statistics, ranking, and selection
    enhancementNew feature or request
    on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cost-modelCost formulas, statistics, ranking, and selectionenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions