Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 11 additions & 97 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ version = "0.1.0"
# The backend depends on two Planner crates, at one immutable revision:
# `asap-planner` to plan and `asap-executor` to execute. Planner IR types
# are reached through `asap_executor::planner`.
asap-planner = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "7565c47e30609d9571d8a9a372bf5e195754b2bb", default-features = false, features = ["promql"] }
asap-executor = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "7565c47e30609d9571d8a9a372bf5e195754b2bb" }
asap-planner = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "05fb36e4e9ff0b8e2ff6d43685785117ec0b9225", default-features = false, features = ["promql"] }
asap-executor = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "05fb36e4e9ff0b8e2ff6d43685785117ec0b9225" }

serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
# `float_roundtrip`: a plan file reloads to the plan it was written from
# (its predicted usage and prices are floats).
serde_json = { version = "1.0", features = ["float_roundtrip"] }
thiserror = "1.0"
anyhow = "1.0"
tracing = "0.1"
Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,24 @@ cargo run -p data_plane -- --plan plan.json --prometheus-url http://localhost:90
`DeploymentCapabilities`: every summary the Planner can build, raw data kept
in Prometheus, and stored outputs built in a `QueryRun` (`MatAtQueryKeptAcrossEvaluations`). For example
`{"raw_data_retained": false}` makes the Planner build every input at
ingestion time. `--measured-operation-costs costs.json` gives Stage 3 the
deployment's measured sketch operation costs; otherwise it prices every node
with cost model 1 and illustrative unit costs.
ingestion time.

`--plan-selection-settings settings.json` replaces the Planner's default
`PlanSelectionSettings` (Stage 3's cost model, resource speed, measured
operation costs and `ignore_accuracy_guarantees`); an omitted field keeps its
default, cost model 1 with illustrative unit costs.
`--measured-operation-costs costs.json` gives Stage 3 the deployment's
measured operation costs (`MeasuredOperationCosts`).
`--ignore-accuracy-guarantees` accepts every query output whatever its
accuracy guarantee, so candidates are compared on cost alone; the plan's
`selection.queries_accepted_without_guarantee` lists the queries accepted
only because of it.

`--stream-start-ms T` declares that the producers write every raw sample at
or after `T`: the first pane of each stored output that starts at or after
`T` is complete and is built. Without it, the first pane each stored output
sees may have started before the data plane did, so it is skipped and a
query whose window needs it is not answered from the plan.

`--forward-timeout-seconds` bounds each forwarded query (default 120, matching
Prometheus's default query timeout); a query that runs longer gets 502.
Expand Down
28 changes: 26 additions & 2 deletions control_plane/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,23 @@ struct Args {
/// backend's data plane executes and keeps.
#[arg(long)]
deployment_capabilities: Option<PathBuf>,
/// Planner `MeasuredOperationCost` list (JSON) that Stage 3 prices
/// sketch operations from; by default every node is priced from the
/// Planner `PlanSelectionSettings` (JSON): Stage 3's cost model,
/// resource speed, measured operation costs and whether accuracy
/// guarantees are ignored; an omitted field takes the Planner's
/// default.
#[arg(long)]
plan_selection_settings: Option<PathBuf>,
/// Planner `MeasuredOperationCosts` (JSON, or the earlier list of
/// `MeasuredOperationCost`) that Stage 3 prices operators from, in place
/// of the settings' table; by default every node is priced from the
/// Planner's formulas.
#[arg(long)]
measured_operation_costs: Option<PathBuf>,
/// Accept every query output regardless of its accuracy guarantee
/// (`PlanSelectionSettings::ignore_accuracy_guarantees`): candidates are
/// compared on cost alone; executability checks still apply.
#[arg(long)]
ignore_accuracy_guarantees: bool,
/// Where to write the plan the data plane installs.
#[arg(long)]
out: PathBuf,
Expand All @@ -41,11 +53,23 @@ fn main() -> anyhow::Result<()> {
if let Some(path) = &args.deployment_capabilities {
inputs.deployment_capabilities = read_json(path)?;
}
if let Some(path) = &args.plan_selection_settings {
inputs.plan_selection = read_json(path)?;
}
if let Some(path) = &args.measured_operation_costs {
inputs.plan_selection.measured_operation_costs = read_json(path)?;
}
inputs.plan_selection.ignore_accuracy_guarantees |= args.ignore_accuracy_guarantees;
let plan = plan_workload(&workload, &inputs)?;
save_plan(&plan, &args.out)?;
if let Some(selection) = &plan.selection {
if !selection.queries_accepted_without_guarantee.is_empty() {
println!(
"queries accepted without an accuracy guarantee (workload indices): {:?}",
selection.queries_accepted_without_guarantee
);
}
}
println!(
"wrote {} ({} queries, {} nodes)",
args.out.display(),
Expand Down
Loading
Loading