diff --git a/.gitignore b/.gitignore index 445612ab8..074f49056 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ target/ __pycache__/ .claude/ +# Evaluation results are never committed (docs/design/repo-layout.md). +eval/results/ diff --git a/Cargo.lock b/Cargo.lock index 0fe141a86..fec6adc54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -881,7 +881,6 @@ dependencies = [ "serde", "serde_json", "thiserror 1.0.69", - "tracing", "tracing-subscriber", ] diff --git a/Cargo.toml b/Cargo.toml index 801171e39..4efa1e2a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] resolver = "2" -members = ["control_plane", "data_plane"] +members = ["crates/control-plane", "crates/data-plane"] [workspace.package] edition = "2021" @@ -29,7 +29,7 @@ clap = { version = "4.0", features = ["derive", "env"] } tokio = { version = "1.0", features = ["full"] } axum = "0.7" reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] } -control_plane = { path = "control_plane" } +control_plane = { path = "crates/control-plane" } # asap_sketchlib#271's head, ahead of the Planner's pin (389530c): DDSketch # view merges in place, with width-specialized loops (a 1 h quantile over diff --git a/README.md b/README.md index dde58a404..19638aab6 100644 --- a/README.md +++ b/README.md @@ -126,9 +126,10 @@ name; the view tier and push precompute add `asap_view_cache_*`, `asap_view_cold_read_bytes_total`, `asap_view_segments_marked_cold_total`, `phase="view_decode"`, `asap_precompute_state_bytes`, `asap_precompute_open_instances`, `asap_window_commit_lag_seconds` and -`asap_samples_total{outcome="late_for_views"}`. `scripts/profile.sh` records a flamegraph of a running data plane; +`asap_samples_total{outcome="late_for_views"}`. `benchmarks/scripts/profile.sh` records a flamegraph of a running data plane; `cargo run --release -p data_plane --example ingest_bench -- 10000 300` -measures ingest throughput in process. +measures ingest throughput in process (the micro benchmarks are in +`benchmarks/micro/`). A range query (`/api/v1/query_range`) whose text is one of the plan's queries is answered with one evaluation per step, at most one step per @@ -190,7 +191,7 @@ Not supported yet: views refreshed on first read (so the backend declares ```sh # Plan the planner-layering Example 1 with this backend's capabilities. cargo run -p control_plane -- \ - --workload examples/planner-layering-example1.json --out plan.json --report report.json + --workload docs/examples/planner-layering-example1.json --out plan.json --report report.json # Serve Remote Write on /api/v1/write and the query API on /api/v1/query[_range]. cargo run -p data_plane -- --plan plan.json --prometheus-url http://localhost:9090 @@ -224,6 +225,21 @@ not stored) with a Prometheus `execution` error (422, `x-asap-execution: refused`) whose `error` is the reason a forwarded query's `x-asap-forward-reason` would give. +## Repository layout + +| Path | Holds | +|---|---| +| `crates/control-plane/` | package `control_plane`: workload → `asap-planner` → plan file | +| `crates/data-plane/` | package `data_plane`: the data plane and its binary | +| `benchmarks/` | the backend alone: `micro/` benchmarks (examples of `data_plane`) and `scripts/` | +| `eval/` | comparisons with other systems and the live demo; see [eval/README.md](eval/README.md) | +| `deployment/monitoring/` | Prometheus, exporters and Grafana for the demo and the comparisons | +| `docs/` | design documents and `examples/` workloads | +| `scripts/` | CI and the Planner dependency updater | + +The layout, its boundaries and its migration steps are in `docs/design/repo-layout.md` +(#874). + ## Development ```sh diff --git a/bench/demo/.gitignore b/bench/demo/.gitignore deleted file mode 100644 index 7045b8d0b..000000000 --- a/bench/demo/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -# Checkouts, binaries and everything a run writes under $ASAPQ_BENCH. -/backend -/ASAPQuery -/prep/ -/runs/ -/report_demo/ -/logs/ -/live/data/ -/live/logs/ -/live/pids/ -/live/screenshots/ -/live/prep-*/ -/live/aside-*/ -/live/cmds/ -/live/mnt/ -/live/disk/ -/live/limits.env -/live/reference_start_ms -/live/stream_start_ms -/live/watchdog.pid -/live/planner/report.json -/live/planner/planning.json -/monitoring/textfile/ -/monitoring/grafana/dashboards/ -__pycache__/ -*.pyc diff --git a/data_plane/examples/decode_bench.rs b/benchmarks/micro/decode_bench.rs similarity index 100% rename from data_plane/examples/decode_bench.rs rename to benchmarks/micro/decode_bench.rs diff --git a/data_plane/examples/ingest_bench.rs b/benchmarks/micro/ingest_bench.rs similarity index 99% rename from data_plane/examples/ingest_bench.rs rename to benchmarks/micro/ingest_bench.rs index e76326cc4..21554600a 100644 --- a/data_plane/examples/ingest_bench.rs +++ b/benchmarks/micro/ingest_bench.rs @@ -1,5 +1,5 @@ //! Ingest throughput of the data plane, in process: plans a mixed workload -//! (`tests/workloads/random-mixed-seed-862-01.json`) for `SERIES` series of +//! (`crates/data-plane/tests/workloads/random-mixed-seed-862-01.json`) for `SERIES` series of //! its `data` metric, scraped every second, then sends `SECONDS` seconds of //! samples by Remote Write (`REQUESTS` requests per scrape, each with a //! slice of the series; 1 by default) as fast as the data diff --git a/data_plane/examples/matrix_bench.rs b/benchmarks/micro/matrix_bench.rs similarity index 100% rename from data_plane/examples/matrix_bench.rs rename to benchmarks/micro/matrix_bench.rs diff --git a/data_plane/examples/offset_bench.rs b/benchmarks/micro/offset_bench.rs similarity index 99% rename from data_plane/examples/offset_bench.rs rename to benchmarks/micro/offset_bench.rs index 65d3b505c..422ac6845 100644 --- a/data_plane/examples/offset_bench.rs +++ b/benchmarks/micro/offset_bench.rs @@ -5,7 +5,7 @@ //! //! `offset_bench [SERIES] [RUNS]` -#[path = "../tests/common/mod.rs"] +#[path = "../../crates/data-plane/tests/common/mod.rs"] #[allow(dead_code)] mod common; diff --git a/data_plane/examples/range_bench.rs b/benchmarks/micro/range_bench.rs similarity index 99% rename from data_plane/examples/range_bench.rs rename to benchmarks/micro/range_bench.rs index 6d85f64ee..251b7e682 100644 --- a/data_plane/examples/range_bench.rs +++ b/benchmarks/micro/range_bench.rs @@ -1,5 +1,5 @@ //! Range-query cost of a dashboard refresh, in process: plans the demo's -//! dashboard workload (`tests/workloads/dashboard.json`) for `SERIES` +//! dashboard workload (`crates/data-plane/tests/workloads/dashboard.json`) for `SERIES` //! series of each metric, every query also requested as a range of 1 h at //! 15 s steps, sends 2 h 5 min of samples (one per series every `SCRAPE` //! seconds) and closes the windows with an event-time barrier at the last diff --git a/data_plane/examples/rw_corpus_bench.rs b/benchmarks/micro/rw_corpus_bench.rs similarity index 100% rename from data_plane/examples/rw_corpus_bench.rs rename to benchmarks/micro/rw_corpus_bench.rs diff --git a/data_plane/examples/tier_bench.rs b/benchmarks/micro/tier_bench.rs similarity index 98% rename from data_plane/examples/tier_bench.rs rename to benchmarks/micro/tier_bench.rs index 3c136190c..9411bc978 100644 --- a/data_plane/examples/tier_bench.rs +++ b/benchmarks/micro/tier_bench.rs @@ -1,6 +1,6 @@ //! Tiered view storage at scale, in process (docs/design/tiered-view-storage.md, //! B1, B2 and the V15 run): plans the dashboard workload -//! (`tests/workloads/dashboard.json`) without raw samples kept, for +//! (`crates/data-plane/tests/workloads/dashboard.json`) without raw samples kept, for //! `SERIES` series per metric at 1 sample/s; sends `MINUTES` of samples as //! fast as they are accepted, with the views persisted in `DIR`; then //! answers the plan's instant queries at the last window end for `ROUNDS` @@ -13,7 +13,7 @@ //! no idle eviction). //! - `VIEW_READ=pread` reads cold windows with `pread`. //! - `WORKLOAD=path` plans another workload file (a planning workload, -//! as in `tests/workloads/`) instead, at 1 sample/s. +//! as in `crates/data-plane/tests/workloads/`) instead, at 1 sample/s. //! - `RESULT_CACHE=0` turns the result cache off, so every round reads //! its views. //! - `SCRAPE_MS=n`: one sample per series every `n` ms (default 1,000). @@ -24,7 +24,7 @@ //! (`POSIX_FADV_DONTNEED`) before each round (B2). //! //! `cargo run --release -p data_plane --example tier_bench -- SERIES MINUTES DIR [ROUNDS]` -//! Under a memory limit: `scripts/tiered_views_cgroup.sh`. +//! Under a memory limit: `benchmarks/scripts/tiered_views_cgroup.sh`. #[global_allocator] static ALLOCATOR: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; diff --git a/data_plane/examples/view_read_bench.rs b/benchmarks/micro/view_read_bench.rs similarity index 100% rename from data_plane/examples/view_read_bench.rs rename to benchmarks/micro/view_read_bench.rs diff --git a/scripts/profile.sh b/benchmarks/scripts/profile.sh similarity index 97% rename from scripts/profile.sh rename to benchmarks/scripts/profile.sh index 5d4a62be9..656628159 100755 --- a/scripts/profile.sh +++ b/benchmarks/scripts/profile.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Records a CPU profile of a running data_plane and writes a flamegraph. # -# scripts/profile.sh [SECONDS] [OUTPUT.svg] +# benchmarks/scripts/profile.sh [SECONDS] [OUTPUT.svg] # # Build with symbols first, so frames have names and stacks are whole: # CARGO_PROFILE_RELEASE_DEBUG=true cargo build --release -p data_plane diff --git a/scripts/tiered_views_cgroup.sh b/benchmarks/scripts/tiered_views_cgroup.sh similarity index 91% rename from scripts/tiered_views_cgroup.sh rename to benchmarks/scripts/tiered_views_cgroup.sh index c927a0349..20623e6a6 100755 --- a/scripts/tiered_views_cgroup.sh +++ b/benchmarks/scripts/tiered_views_cgroup.sh @@ -6,9 +6,9 @@ # tiered the default window cache budget (derived from memory.max) # Expected: the control is OOM-killed (memory.events oom_kill > 0) and the tiered # run answers every query with oom_kill 0. Needs sudo -n to create the cgroup. -# WORKLOAD, COLD and VIEW_READ are passed to the bench (see examples/tier_bench.rs). +# WORKLOAD, COLD and VIEW_READ are passed to the bench (see benchmarks/micro/tier_bench.rs). # -# scripts/tiered_views_cgroup.sh [MEMORY_MAX_BYTES] [SERIES] [MINUTES] [WORK_DIR] +# benchmarks/scripts/tiered_views_cgroup.sh [MEMORY_MAX_BYTES] [SERIES] [MINUTES] [WORK_DIR] set -uo pipefail MEM=${1:-1610612736} SERIES=${2:-10000} diff --git a/control_plane/Cargo.toml b/crates/control-plane/Cargo.toml similarity index 92% rename from control_plane/Cargo.toml rename to crates/control-plane/Cargo.toml index b20fb2c1f..b82cd3210 100644 --- a/control_plane/Cargo.toml +++ b/crates/control-plane/Cargo.toml @@ -10,6 +10,5 @@ serde.workspace = true serde_json.workspace = true thiserror.workspace = true anyhow.workspace = true -tracing.workspace = true tracing-subscriber.workspace = true clap.workspace = true diff --git a/control_plane/src/lib.rs b/crates/control-plane/src/lib.rs similarity index 100% rename from control_plane/src/lib.rs rename to crates/control-plane/src/lib.rs diff --git a/control_plane/src/main.rs b/crates/control-plane/src/main.rs similarity index 100% rename from control_plane/src/main.rs rename to crates/control-plane/src/main.rs diff --git a/control_plane/tests/plan_workload.rs b/crates/control-plane/tests/plan_workload.rs similarity index 98% rename from control_plane/tests/plan_workload.rs rename to crates/control-plane/tests/plan_workload.rs index fe47cf0a0..df4d270c1 100644 --- a/control_plane/tests/plan_workload.rs +++ b/crates/control-plane/tests/plan_workload.rs @@ -6,7 +6,7 @@ use control_plane::{load_plan, plan_workload, save_plan, DeploymentInputs, PlanE fn example(name: &str) -> PlanningWorkload { let path = Path::new(env!("CARGO_MANIFEST_DIR")) - .join(format!("../examples/planner-layering-{name}.json")); + .join(format!("../../docs/examples/planner-layering-{name}.json")); serde_json::from_str(&std::fs::read_to_string(path).unwrap()).unwrap() } diff --git a/data_plane/Cargo.toml b/crates/data-plane/Cargo.toml similarity index 57% rename from data_plane/Cargo.toml rename to crates/data-plane/Cargo.toml index e08a01bfe..b2ef11327 100644 --- a/data_plane/Cargo.toml +++ b/crates/data-plane/Cargo.toml @@ -39,3 +39,37 @@ form_urlencoded = "1" control_plane.workspace = true tower = { version = "0.5", features = ["util"] } http-body-util = "0.1" + +# The micro benchmarks live in benchmarks/micro/ and build as examples of this +# crate (`cargo run --release -p data_plane --example `). +[[example]] +name = "decode_bench" +path = "../../benchmarks/micro/decode_bench.rs" + +[[example]] +name = "ingest_bench" +path = "../../benchmarks/micro/ingest_bench.rs" + +[[example]] +name = "matrix_bench" +path = "../../benchmarks/micro/matrix_bench.rs" + +[[example]] +name = "offset_bench" +path = "../../benchmarks/micro/offset_bench.rs" + +[[example]] +name = "range_bench" +path = "../../benchmarks/micro/range_bench.rs" + +[[example]] +name = "rw_corpus_bench" +path = "../../benchmarks/micro/rw_corpus_bench.rs" + +[[example]] +name = "tier_bench" +path = "../../benchmarks/micro/tier_bench.rs" + +[[example]] +name = "view_read_bench" +path = "../../benchmarks/micro/view_read_bench.rs" diff --git a/data_plane/examples/remote_write_load.rs b/crates/data-plane/examples/remote_write_load.rs similarity index 100% rename from data_plane/examples/remote_write_load.rs rename to crates/data-plane/examples/remote_write_load.rs diff --git a/data_plane/src/engine.rs b/crates/data-plane/src/engine.rs similarity index 100% rename from data_plane/src/engine.rs rename to crates/data-plane/src/engine.rs diff --git a/data_plane/src/ingestion.rs b/crates/data-plane/src/ingestion.rs similarity index 100% rename from data_plane/src/ingestion.rs rename to crates/data-plane/src/ingestion.rs diff --git a/data_plane/src/lib.rs b/crates/data-plane/src/lib.rs similarity index 100% rename from data_plane/src/lib.rs rename to crates/data-plane/src/lib.rs diff --git a/data_plane/src/main.rs b/crates/data-plane/src/main.rs similarity index 100% rename from data_plane/src/main.rs rename to crates/data-plane/src/main.rs diff --git a/data_plane/src/memory_budget.rs b/crates/data-plane/src/memory_budget.rs similarity index 100% rename from data_plane/src/memory_budget.rs rename to crates/data-plane/src/memory_budget.rs diff --git a/data_plane/src/metrics.rs b/crates/data-plane/src/metrics.rs similarity index 100% rename from data_plane/src/metrics.rs rename to crates/data-plane/src/metrics.rs diff --git a/data_plane/src/persist.rs b/crates/data-plane/src/persist.rs similarity index 100% rename from data_plane/src/persist.rs rename to crates/data-plane/src/persist.rs diff --git a/data_plane/src/prometheus.rs b/crates/data-plane/src/prometheus.rs similarity index 100% rename from data_plane/src/prometheus.rs rename to crates/data-plane/src/prometheus.rs diff --git a/data_plane/src/push.rs b/crates/data-plane/src/push.rs similarity index 100% rename from data_plane/src/push.rs rename to crates/data-plane/src/push.rs diff --git a/data_plane/src/query.rs b/crates/data-plane/src/query.rs similarity index 100% rename from data_plane/src/query.rs rename to crates/data-plane/src/query.rs diff --git a/data_plane/src/raw_forward.rs b/crates/data-plane/src/raw_forward.rs similarity index 100% rename from data_plane/src/raw_forward.rs rename to crates/data-plane/src/raw_forward.rs diff --git a/data_plane/src/remote_write.rs b/crates/data-plane/src/remote_write.rs similarity index 100% rename from data_plane/src/remote_write.rs rename to crates/data-plane/src/remote_write.rs diff --git a/data_plane/src/result_cache.rs b/crates/data-plane/src/result_cache.rs similarity index 100% rename from data_plane/src/result_cache.rs rename to crates/data-plane/src/result_cache.rs diff --git a/data_plane/src/segment.rs b/crates/data-plane/src/segment.rs similarity index 100% rename from data_plane/src/segment.rs rename to crates/data-plane/src/segment.rs diff --git a/data_plane/src/series_ids.rs b/crates/data-plane/src/series_ids.rs similarity index 100% rename from data_plane/src/series_ids.rs rename to crates/data-plane/src/series_ids.rs diff --git a/data_plane/src/state_codec.rs b/crates/data-plane/src/state_codec.rs similarity index 100% rename from data_plane/src/state_codec.rs rename to crates/data-plane/src/state_codec.rs diff --git a/data_plane/src/store.rs b/crates/data-plane/src/store.rs similarity index 100% rename from data_plane/src/store.rs rename to crates/data-plane/src/store.rs diff --git a/data_plane/src/window_cache.rs b/crates/data-plane/src/window_cache.rs similarity index 100% rename from data_plane/src/window_cache.rs rename to crates/data-plane/src/window_cache.rs diff --git a/data_plane/tests/common/mod.rs b/crates/data-plane/tests/common/mod.rs similarity index 95% rename from data_plane/tests/common/mod.rs rename to crates/data-plane/tests/common/mod.rs index 111d4b98c..eb1ff9820 100644 --- a/data_plane/tests/common/mod.rs +++ b/crates/data-plane/tests/common/mod.rs @@ -34,11 +34,12 @@ pub fn inputs_without_levels(raw_data_retained: bool) -> DeploymentInputs { inputs } -/// A #509 example workload in `examples/`. +/// A #509 example workload in `docs/examples/`. #[allow(dead_code)] pub fn workload(example: &str) -> PlanningWorkload { - let path = Path::new(env!("CARGO_MANIFEST_DIR")) - .join(format!("../examples/planner-layering-{example}.json")); + let path = Path::new(env!("CARGO_MANIFEST_DIR")).join(format!( + "../../docs/examples/planner-layering-{example}.json" + )); serde_json::from_str(&std::fs::read_to_string(path).unwrap()).unwrap() } @@ -160,12 +161,12 @@ pub fn per_job(body: &Value) -> Vec<(String, f64)> { rows } -/// Every workload file in `examples/` and `tests/workloads/` whose name +/// Every workload file in `docs/examples/` and `tests/workloads/` whose name /// contains `only` (every one for `""`), by name, sorted. #[allow(dead_code)] pub fn workloads(only: &str) -> Vec<(String, PlanningWorkload)> { let root = Path::new(env!("CARGO_MANIFEST_DIR")); - let mut files: Vec<_> = ["../examples", "tests/workloads"] + let mut files: Vec<_> = ["../../docs/examples", "tests/workloads"] .iter() .flat_map(|dir| std::fs::read_dir(root.join(dir)).unwrap()) .map(|entry| entry.unwrap().path()) diff --git a/data_plane/tests/concurrency.rs b/crates/data-plane/tests/concurrency.rs similarity index 100% rename from data_plane/tests/concurrency.rs rename to crates/data-plane/tests/concurrency.rs diff --git a/data_plane/tests/forward_mode.rs b/crates/data-plane/tests/forward_mode.rs similarity index 100% rename from data_plane/tests/forward_mode.rs rename to crates/data-plane/tests/forward_mode.rs diff --git a/data_plane/tests/ingest_shards.rs b/crates/data-plane/tests/ingest_shards.rs similarity index 100% rename from data_plane/tests/ingest_shards.rs rename to crates/data-plane/tests/ingest_shards.rs diff --git a/data_plane/tests/no_forward.rs b/crates/data-plane/tests/no_forward.rs similarity index 100% rename from data_plane/tests/no_forward.rs rename to crates/data-plane/tests/no_forward.rs diff --git a/data_plane/tests/pipelines/mod.rs b/crates/data-plane/tests/pipelines/mod.rs similarity index 100% rename from data_plane/tests/pipelines/mod.rs rename to crates/data-plane/tests/pipelines/mod.rs diff --git a/data_plane/tests/planner_executor_answers.rs b/crates/data-plane/tests/planner_executor_answers.rs similarity index 100% rename from data_plane/tests/planner_executor_answers.rs rename to crates/data-plane/tests/planner_executor_answers.rs diff --git a/data_plane/tests/planner_executor_parity.rs b/crates/data-plane/tests/planner_executor_parity.rs similarity index 99% rename from data_plane/tests/planner_executor_parity.rs rename to crates/data-plane/tests/planner_executor_parity.rs index c3357fe46..d588e1a67 100644 --- a/data_plane/tests/planner_executor_parity.rs +++ b/crates/data-plane/tests/planner_executor_parity.rs @@ -1,6 +1,6 @@ //! The data plane answers exactly what the Planner's executor answers for //! the same installed plan and the same raw samples, on public PromQL -//! workloads: the #509 examples (`examples/`) and ASAPPlanner's mixed and +//! workloads: the #509 examples (`docs/examples/`) and ASAPPlanner's mixed and //! sketch-plan workloads (`tests/workloads/`, copied unchanged from //! ASAPPlanner's `tools/dag-viewer/workloads/random-mixed-seed-862/`, //! `crates/devtools/tests/sketch_plan_snapshots/workloads/` (as diff --git a/data_plane/tests/precompute_pool.rs b/crates/data-plane/tests/precompute_pool.rs similarity index 100% rename from data_plane/tests/precompute_pool.rs rename to crates/data-plane/tests/precompute_pool.rs diff --git a/data_plane/tests/push_precompute.rs b/crates/data-plane/tests/push_precompute.rs similarity index 99% rename from data_plane/tests/push_precompute.rs rename to crates/data-plane/tests/push_precompute.rs index b75e6ad46..6ac99092a 100644 --- a/data_plane/tests/push_precompute.rs +++ b/crates/data-plane/tests/push_precompute.rs @@ -657,7 +657,7 @@ fn combine_rules_follow_the_table_and_refuse_unknown_breakers() { let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")); let mut seen: Vec = Vec::new(); - for dir in ["../examples", "tests/workloads"] { + for dir in ["../../docs/examples", "tests/workloads"] { let mut paths: Vec<_> = std::fs::read_dir(root.join(dir)) .unwrap() .map(|e| e.unwrap().path()) diff --git a/data_plane/tests/range_isolation.rs b/crates/data-plane/tests/range_isolation.rs similarity index 100% rename from data_plane/tests/range_isolation.rs rename to crates/data-plane/tests/range_isolation.rs diff --git a/data_plane/tests/range_queries.rs b/crates/data-plane/tests/range_queries.rs similarity index 100% rename from data_plane/tests/range_queries.rs rename to crates/data-plane/tests/range_queries.rs diff --git a/data_plane/tests/remote_write_reference.rs b/crates/data-plane/tests/remote_write_reference.rs similarity index 100% rename from data_plane/tests/remote_write_reference.rs rename to crates/data-plane/tests/remote_write_reference.rs diff --git a/data_plane/tests/result_cache.rs b/crates/data-plane/tests/result_cache.rs similarity index 100% rename from data_plane/tests/result_cache.rs rename to crates/data-plane/tests/result_cache.rs diff --git a/data_plane/tests/series_ids.rs b/crates/data-plane/tests/series_ids.rs similarity index 100% rename from data_plane/tests/series_ids.rs rename to crates/data-plane/tests/series_ids.rs diff --git a/data_plane/tests/server.rs b/crates/data-plane/tests/server.rs similarity index 100% rename from data_plane/tests/server.rs rename to crates/data-plane/tests/server.rs diff --git a/data_plane/tests/shared_results.rs b/crates/data-plane/tests/shared_results.rs similarity index 100% rename from data_plane/tests/shared_results.rs rename to crates/data-plane/tests/shared_results.rs diff --git a/data_plane/tests/time_params.rs b/crates/data-plane/tests/time_params.rs similarity index 100% rename from data_plane/tests/time_params.rs rename to crates/data-plane/tests/time_params.rs diff --git a/data_plane/tests/view_cache_charge.rs b/crates/data-plane/tests/view_cache_charge.rs similarity index 100% rename from data_plane/tests/view_cache_charge.rs rename to crates/data-plane/tests/view_cache_charge.rs diff --git a/data_plane/tests/view_cold_allocations.rs b/crates/data-plane/tests/view_cold_allocations.rs similarity index 100% rename from data_plane/tests/view_cold_allocations.rs rename to crates/data-plane/tests/view_cold_allocations.rs diff --git a/data_plane/tests/view_memory.rs b/crates/data-plane/tests/view_memory.rs similarity index 100% rename from data_plane/tests/view_memory.rs rename to crates/data-plane/tests/view_memory.rs diff --git a/data_plane/tests/view_persistence.rs b/crates/data-plane/tests/view_persistence.rs similarity index 100% rename from data_plane/tests/view_persistence.rs rename to crates/data-plane/tests/view_persistence.rs diff --git a/data_plane/tests/view_tiering.rs b/crates/data-plane/tests/view_tiering.rs similarity index 100% rename from data_plane/tests/view_tiering.rs rename to crates/data-plane/tests/view_tiering.rs diff --git a/data_plane/tests/window_levels.rs b/crates/data-plane/tests/window_levels.rs similarity index 100% rename from data_plane/tests/window_levels.rs rename to crates/data-plane/tests/window_levels.rs diff --git a/data_plane/tests/workloads/dashboard-heavy-10hz.json b/crates/data-plane/tests/workloads/dashboard-heavy-10hz.json similarity index 100% rename from data_plane/tests/workloads/dashboard-heavy-10hz.json rename to crates/data-plane/tests/workloads/dashboard-heavy-10hz.json diff --git a/data_plane/tests/workloads/dashboard.json b/crates/data-plane/tests/workloads/dashboard.json similarity index 100% rename from data_plane/tests/workloads/dashboard.json rename to crates/data-plane/tests/workloads/dashboard.json diff --git a/data_plane/tests/workloads/demo-complex-shapes.json b/crates/data-plane/tests/workloads/demo-complex-shapes.json similarity index 100% rename from data_plane/tests/workloads/demo-complex-shapes.json rename to crates/data-plane/tests/workloads/demo-complex-shapes.json diff --git a/data_plane/tests/workloads/random-mixed-seed-862-01.json b/crates/data-plane/tests/workloads/random-mixed-seed-862-01.json similarity index 100% rename from data_plane/tests/workloads/random-mixed-seed-862-01.json rename to crates/data-plane/tests/workloads/random-mixed-seed-862-01.json diff --git a/data_plane/tests/workloads/random-mixed-seed-862-02.json b/crates/data-plane/tests/workloads/random-mixed-seed-862-02.json similarity index 100% rename from data_plane/tests/workloads/random-mixed-seed-862-02.json rename to crates/data-plane/tests/workloads/random-mixed-seed-862-02.json diff --git a/data_plane/tests/workloads/random-mixed-seed-862-03.json b/crates/data-plane/tests/workloads/random-mixed-seed-862-03.json similarity index 100% rename from data_plane/tests/workloads/random-mixed-seed-862-03.json rename to crates/data-plane/tests/workloads/random-mixed-seed-862-03.json diff --git a/data_plane/tests/workloads/random-mixed-seed-862-04.json b/crates/data-plane/tests/workloads/random-mixed-seed-862-04.json similarity index 100% rename from data_plane/tests/workloads/random-mixed-seed-862-04.json rename to crates/data-plane/tests/workloads/random-mixed-seed-862-04.json diff --git a/data_plane/tests/workloads/random-mixed-seed-862-05.json b/crates/data-plane/tests/workloads/random-mixed-seed-862-05.json similarity index 100% rename from data_plane/tests/workloads/random-mixed-seed-862-05.json rename to crates/data-plane/tests/workloads/random-mixed-seed-862-05.json diff --git a/data_plane/tests/workloads/random-mixed-seed-862-06.json b/crates/data-plane/tests/workloads/random-mixed-seed-862-06.json similarity index 100% rename from data_plane/tests/workloads/random-mixed-seed-862-06.json rename to crates/data-plane/tests/workloads/random-mixed-seed-862-06.json diff --git a/data_plane/tests/workloads/rangeheavy-t5-q05-q09-1h.json b/crates/data-plane/tests/workloads/rangeheavy-t5-q05-q09-1h.json similarity index 100% rename from data_plane/tests/workloads/rangeheavy-t5-q05-q09-1h.json rename to crates/data-plane/tests/workloads/rangeheavy-t5-q05-q09-1h.json diff --git a/data_plane/tests/workloads/sketch-plan-chains-10m-5m-3m-10s.json b/crates/data-plane/tests/workloads/sketch-plan-chains-10m-5m-3m-10s.json similarity index 100% rename from data_plane/tests/workloads/sketch-plan-chains-10m-5m-3m-10s.json rename to crates/data-plane/tests/workloads/sketch-plan-chains-10m-5m-3m-10s.json diff --git a/data_plane/tests/workloads/sketch-plan-quantile-grouped.json b/crates/data-plane/tests/workloads/sketch-plan-quantile-grouped.json similarity index 100% rename from data_plane/tests/workloads/sketch-plan-quantile-grouped.json rename to crates/data-plane/tests/workloads/sketch-plan-quantile-grouped.json diff --git a/data_plane/tests/workloads/sketch-plan-quantile-single.json b/crates/data-plane/tests/workloads/sketch-plan-quantile-single.json similarity index 100% rename from data_plane/tests/workloads/sketch-plan-quantile-single.json rename to crates/data-plane/tests/workloads/sketch-plan-quantile-single.json diff --git a/data_plane/tests/workloads/sketch-plan-ratio-of-quantiles-1h.json b/crates/data-plane/tests/workloads/sketch-plan-ratio-of-quantiles-1h.json similarity index 100% rename from data_plane/tests/workloads/sketch-plan-ratio-of-quantiles-1h.json rename to crates/data-plane/tests/workloads/sketch-plan-ratio-of-quantiles-1h.json diff --git a/data_plane/tests/workloads/sketch-plan-rollup-quantile-nested-labels.json b/crates/data-plane/tests/workloads/sketch-plan-rollup-quantile-nested-labels.json similarity index 100% rename from data_plane/tests/workloads/sketch-plan-rollup-quantile-nested-labels.json rename to crates/data-plane/tests/workloads/sketch-plan-rollup-quantile-nested-labels.json diff --git a/data_plane/tests/workloads/sketch-plan-topk-by-job-and-global.json b/crates/data-plane/tests/workloads/sketch-plan-topk-by-job-and-global.json similarity index 100% rename from data_plane/tests/workloads/sketch-plan-topk-by-job-and-global.json rename to crates/data-plane/tests/workloads/sketch-plan-topk-by-job-and-global.json diff --git a/data_plane/tests/workloads/sketch-plan-topk-rate.json b/crates/data-plane/tests/workloads/sketch-plan-topk-rate.json similarity index 100% rename from data_plane/tests/workloads/sketch-plan-topk-rate.json rename to crates/data-plane/tests/workloads/sketch-plan-topk-rate.json diff --git a/data_plane/tests/workloads/typical-dashboard-60s-10hz.json b/crates/data-plane/tests/workloads/typical-dashboard-60s-10hz.json similarity index 100% rename from data_plane/tests/workloads/typical-dashboard-60s-10hz.json rename to crates/data-plane/tests/workloads/typical-dashboard-60s-10hz.json diff --git a/deployment/monitoring/.gitignore b/deployment/monitoring/.gitignore new file mode 100644 index 000000000..a4a83430c --- /dev/null +++ b/deployment/monitoring/.gitignore @@ -0,0 +1,3 @@ +# What the monitoring stack writes (eval/run_vm_demo.sh, eval/demo/run_live_demo.sh). +/textfile/ +/grafana/dashboards/ diff --git a/bench/demo/monitoring/docker-compose.yml b/deployment/monitoring/docker-compose.yml similarity index 73% rename from bench/demo/monitoring/docker-compose.yml rename to deployment/monitoring/docker-compose.yml index 3c5fdcc0d..88372d4f1 100644 --- a/bench/demo/monitoring/docker-compose.yml +++ b/deployment/monitoring/docker-compose.yml @@ -4,9 +4,10 @@ # default 13000, dashboard "asap-vs-vm"). Host networking, so every scrape # target is on the run host's loopback. # -# ASAPQ_BENCH=$ASAPQ_BENCH sudo -n -E docker compose -f monitoring/docker-compose.yml up -d +# ASAPQ_BENCH is this repository's eval/ directory (see eval/README.md). +# ASAPQ_BENCH=$ASAPQ_BENCH sudo -n -E docker compose -f deployment/monitoring/docker-compose.yml up -d # -# Without docker: monitoring/run_binaries.sh starts the same stack from the +# Without docker: deployment/monitoring/run_binaries.sh starts the same stack from the # pinned release binaries in $BIN_DIR. name: asap-vs-vm-monitoring services: @@ -20,7 +21,7 @@ services: - --storage.tsdb.retention.time=30d - --web.listen-address=127.0.0.1:19090 volumes: - - ${ASAPQ_BENCH:?set ASAPQ_BENCH}/monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro + - ${ASAPQ_BENCH:?set ASAPQ_BENCH}/../deployment/monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro - monitoring-prometheus:/prometheus node-exporter: image: prom/node-exporter:v1.12.1@sha256:1b4e4438faca4dd7e001dd445d161a4a2091b0fededa84093b3a8dfeae1f1be0 @@ -33,7 +34,7 @@ services: - --collector.textfile.directory=/textfile volumes: - /:/host:ro,rslave - - ${ASAPQ_BENCH:?set ASAPQ_BENCH}/monitoring/textfile:/textfile:ro + - ${ASAPQ_BENCH:?set ASAPQ_BENCH}/../deployment/monitoring/textfile:/textfile:ro process-exporter: image: ncabatoff/process-exporter:0.8.7@sha256:bc2363ff7e05ada1b2a694f06c43dc824dc26cd6e487b5d36b66b1a40df4e842 network_mode: host @@ -47,7 +48,7 @@ services: - --threads=false volumes: - /proc:/host/proc:ro - - ${ASAPQ_BENCH:?set ASAPQ_BENCH}/monitoring/process-exporter:/config:ro + - ${ASAPQ_BENCH:?set ASAPQ_BENCH}/../deployment/monitoring/process-exporter:/config:ro grafana: image: grafana/grafana:12.4.14@sha256:ae509d9ae8c1021ca32ec370a9ca975d40165eda9fccd1e1102d317ff8787cd7 network_mode: host @@ -60,8 +61,8 @@ services: GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /var/lib/grafana/dashboards/asap-vs-vm.json ASAP_DASHBOARDS_DIR: /var/lib/grafana/dashboards volumes: - - ${ASAPQ_BENCH:?set ASAPQ_BENCH}/monitoring/grafana/provisioning:/etc/grafana/provisioning:ro - - ${ASAPQ_BENCH:?set ASAPQ_BENCH}/monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro + - ${ASAPQ_BENCH:?set ASAPQ_BENCH}/../deployment/monitoring/grafana/provisioning:/etc/grafana/provisioning:ro + - ${ASAPQ_BENCH:?set ASAPQ_BENCH}/../deployment/monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro - monitoring-grafana:/var/lib/grafana volumes: monitoring-prometheus: diff --git a/bench/demo/monitoring/grafana/make_dashboard.py b/deployment/monitoring/grafana/make_dashboard.py similarity index 99% rename from bench/demo/monitoring/grafana/make_dashboard.py rename to deployment/monitoring/grafana/make_dashboard.py index b87ebf411..dbdeaa6c9 100644 --- a/bench/demo/monitoring/grafana/make_dashboard.py +++ b/deployment/monitoring/grafana/make_dashboard.py @@ -222,7 +222,7 @@ def matrix_bars(title, grid, expr, column, unit, stacked, description): target('sum(increase(vm_request_duration_seconds_sum{job="victoriametrics", ' 'path="/api/v1/query"}[$__range]))', "D", "wall time in /api/v1/query", instant=True), ], "VictoriaMetrics exports total and GC CPU, and wall time per HTTP path (not CPU). " - "profile/profile_query_phase.sh gives the function-level CPU profile.", + "eval/profile/profile_query_phase.sh gives the function-level CPU profile.", fieldConfig={"defaults": {"unit": "s", "min": 0, "color": {"mode": "palette-classic"}}}, options={"orientation": "horizontal", "displayMode": "basic", "showUnfilled": True, "reduceOptions": {"calcs": ["lastNotNull"]}}) diff --git a/bench/demo/monitoring/grafana/make_demo_dashboard.py b/deployment/monitoring/grafana/make_demo_dashboard.py similarity index 98% rename from bench/demo/monitoring/grafana/make_demo_dashboard.py rename to deployment/monitoring/grafana/make_demo_dashboard.py index 2fcbdb116..0b3d053bc 100644 --- a/bench/demo/monitoring/grafana/make_demo_dashboard.py +++ b/deployment/monitoring/grafana/make_demo_dashboard.py @@ -2,7 +2,7 @@ """Write dashboards/asap-demo.json, the presentation dashboard: ASAP vs VictoriaMetrics only (no Prometheus), resource usage only (no prices). - make_demo_dashboard.py --prep live/prep-asap-demo-s10000 + make_demo_dashboard.py --prep eval/demo/live/prep-asap-demo-s10000 Layout (docs/design/demo-plan.md sections 8-9 of the backend): the time range starts at the run's start (--run-start-ms), so every total counts from second 0. @@ -89,7 +89,7 @@ def main(): ap.add_argument("--disk-bytes", type=int, help="the size of each engine's own data filesystem") ap.add_argument("--vm-version", default="v1.156.0") ap.add_argument("--run-start-ms", type=int, help="the dashboard's time range starts here (cumulative totals)") - ap.add_argument("--planner-dir", type=Path, help="live/planner: report.json, cost_inputs.json, planning.json") + ap.add_argument("--planner-dir", type=Path, help="eval/demo/live/planner: report.json, cost_inputs.json, planning.json") ap.add_argument("--out", default=str(Path(__file__).parent / "dashboards" / "asap-demo.json")) args = ap.parse_args() queries = json.loads((args.prep / "queries.json").read_text())["queries"] @@ -280,7 +280,7 @@ def cell(promql, limit=110): # long matchers (e.g. host lists) cut, so the tabl # ---- 2 Per query row("2 · Per query: latency (p50, p99) and error") for q in queries: - sel = f'query="{q["id"]}"' # live/query_load.py labels by query id + sel = f'query="{q["id"]}"' # eval/demo/live/query_load.py labels by query id hq = lambda phi, eng: (f'histogram_quantile({phi}, sum by (le) (rate(live_load_latency_seconds_bucket' f'{{engine="{eng}", {sel}}}[5m])))') name = short(q) diff --git a/bench/demo/monitoring/grafana/make_live_dashboard.py b/deployment/monitoring/grafana/make_live_dashboard.py similarity index 99% rename from bench/demo/monitoring/grafana/make_live_dashboard.py rename to deployment/monitoring/grafana/make_live_dashboard.py index f90642169..69922053f 100644 --- a/bench/demo/monitoring/grafana/make_live_dashboard.py +++ b/deployment/monitoring/grafana/make_live_dashboard.py @@ -5,7 +5,7 @@ /api/v1/query_range; then request latency per data source over time, and CPU/RSS of the engines as bars. - make_live_dashboard.py --queries live/prep-.../queries.json + make_live_dashboard.py --queries eval/demo/live/prep-.../queries.json Every query panel requests the plan's grid: the time range is the plan's span (relative time), the step is the plan's step (the query's min interval; @@ -82,7 +82,7 @@ def row(title): width = 24 // len(arms) if not q.get("range"): # ASAP answers an instant query only at a time on the query's evaluation grid, and Grafana's - # instant time is not aligned: show the answers the accuracy check (live/accuracy.py) records + # instant time is not aligned: show the answers the accuracy check (eval/demo/live/accuracy.py) records # at each grid time instead (asap_demo_answer; the reference's largest series past 20 outputs). mon_ds = DS["mon"] for i, arm in enumerate(a for a in arms if a != "exact"): diff --git a/bench/demo/monitoring/grafana/provisioning/dashboards/asap.yml b/deployment/monitoring/grafana/provisioning/dashboards/asap.yml similarity index 100% rename from bench/demo/monitoring/grafana/provisioning/dashboards/asap.yml rename to deployment/monitoring/grafana/provisioning/dashboards/asap.yml diff --git a/bench/demo/monitoring/grafana/provisioning/datasources/live.yml b/deployment/monitoring/grafana/provisioning/datasources/live.yml similarity index 92% rename from bench/demo/monitoring/grafana/provisioning/datasources/live.yml rename to deployment/monitoring/grafana/provisioning/datasources/live.yml index a16420af6..7fef51d19 100644 --- a/bench/demo/monitoring/grafana/provisioning/datasources/live.yml +++ b/deployment/monitoring/grafana/provisioning/datasources/live.yml @@ -1,5 +1,5 @@ # Live demo data sources (run_live_demo.sh). Each goes through the logging -# proxy (live/proxy.py) in front of its engine. timeInterval is the panels' +# proxy (eval/demo/live/proxy.py) in front of its engine. timeInterval is the panels' # minimum step: the plan's 15 s grid. timeout 120 s (Grafana's default is 30 s) so a slow # answer is measured rather than cut off. apiVersion: 1 diff --git a/bench/demo/monitoring/grafana/provisioning/datasources/monitoring.yml b/deployment/monitoring/grafana/provisioning/datasources/monitoring.yml similarity index 100% rename from bench/demo/monitoring/grafana/provisioning/datasources/monitoring.yml rename to deployment/monitoring/grafana/provisioning/datasources/monitoring.yml diff --git a/bench/demo/monitoring/process-exporter/config.yml b/deployment/monitoring/process-exporter/config.yml similarity index 100% rename from bench/demo/monitoring/process-exporter/config.yml rename to deployment/monitoring/process-exporter/config.yml diff --git a/bench/demo/monitoring/prometheus/prometheus.yml b/deployment/monitoring/prometheus/prometheus.yml similarity index 100% rename from bench/demo/monitoring/prometheus/prometheus.yml rename to deployment/monitoring/prometheus/prometheus.yml diff --git a/bench/demo/monitoring/run_binaries.sh b/deployment/monitoring/run_binaries.sh similarity index 92% rename from bench/demo/monitoring/run_binaries.sh rename to deployment/monitoring/run_binaries.sh index 55f05abb0..da490e41c 100755 --- a/bench/demo/monitoring/run_binaries.sh +++ b/deployment/monitoring/run_binaries.sh @@ -1,16 +1,16 @@ #!/bin/bash # The monitoring stack of docker-compose.yml without docker: the same # configs, run from the pinned release binaries in $BIN_DIR (fetched by -# ../fetch_binaries.sh when missing). State lives in $MON_DATA. +# eval/fetch_binaries.sh when missing). State lives in $MON_DATA. # -# monitoring/run_binaries.sh start|stop|status +# deployment/monitoring/run_binaries.sh start|stop|status # # process-exporter reads every process' /proc; run as a user who can (root # via sudo -n when available, else the processes of this user only). set -euo pipefail BASE=${ASAPQ_BENCH:?set ASAPQ_BENCH} BIN_DIR=${BIN_DIR:?set BIN_DIR} -MON=$BASE/monitoring +MON=$BASE/../deployment/monitoring # this repository's deployment/monitoring MON_DATA=${MON_DATA:-$MON/data} GRAFANA_PORT=${GRAFANA_PORT:-13000} PIDS=$MON_DATA/pids diff --git a/bench/demo/monitoring/screenshot.py b/deployment/monitoring/screenshot.py similarity index 100% rename from bench/demo/monitoring/screenshot.py rename to deployment/monitoring/screenshot.py diff --git a/bench/demo/monitoring/screenshot.sh b/deployment/monitoring/screenshot.sh similarity index 75% rename from bench/demo/monitoring/screenshot.sh rename to deployment/monitoring/screenshot.sh index e2e688006..20f770614 100755 --- a/bench/demo/monitoring/screenshot.sh +++ b/deployment/monitoring/screenshot.sh @@ -2,7 +2,7 @@ # Render a Grafana dashboard (whole page) and each of its panels to PNG for # one time range, with headless Chromium in the pinned Playwright image. # -# monitoring/screenshot.sh [NAME=VALUE ...] +# deployment/monitoring/screenshot.sh [NAME=VALUE ...] # # /: epoch milliseconds (sent to Grafana as ISO-8601 UTC) or relative times (now-1h, now). # NAME=VALUE sets a dashboard variable (e.g. run=vmdemo.demo.smoke.s1000). @@ -11,15 +11,16 @@ set -euo pipefail BASE=${ASAPQ_BENCH:?set ASAPQ_BENCH} UID_=${1:?dashboard uid}; FROM=${2:?from}; TO=${3:?to}; OUT=${4:?out dir}; shift 4 IMAGE=mcr.microsoft.com/playwright/python:v1.49.0-jammy@sha256:70c06141ac9041eedef4a68387ea978ceb090c37bd5b66583353b7fe17b9f3d7 -LIB=$BASE/monitoring/.pylib +MON=$BASE/../deployment/monitoring # this repository's deployment/monitoring +LIB=$MON/.pylib mkdir -p "$OUT" OUT=$(cd "$OUT" && pwd) if [ ! -d "$LIB/playwright" ]; then - sudo -n docker run --rm -v "$BASE/monitoring:/m" "$IMAGE" pip install -q --target /m/.pylib playwright==1.49.0 >/dev/null 2>&1 + sudo -n docker run --rm -v "$MON:/m" "$IMAGE" pip install -q --target /m/.pylib playwright==1.49.0 >/dev/null 2>&1 fi vars=(); for v in "$@"; do vars+=(--vars "$v"); done sudo -n docker run --rm --network host ${AUX_CPUS:+--cpuset-cpus "$AUX_CPUS"} -e PYTHONPATH=/m/.pylib \ - -v "$BASE/monitoring:/m:ro" -v "$OUT:/out" "$IMAGE" \ + -v "$MON:/m:ro" -v "$OUT:/out" "$IMAGE" \ python3 /m/screenshot.py --grafana "http://127.0.0.1:${GRAFANA_PORT:-13000}" --uid "$UID_" \ --from "$FROM" --to "$TO" --out /out "${vars[@]}" sudo -n chown -R "$(id -u):$(id -g)" "$OUT" diff --git a/docs/design/data-plane-demo.md b/docs/design/data-plane-demo.md index 10f5dc379..116e849fc 100644 --- a/docs/design/data-plane-demo.md +++ b/docs/design/data-plane-demo.md @@ -1,5 +1,14 @@ # Design: data plane demo against VictoriaMetrics +> **Paths.** This document predates the folder moves of +> `docs/design/repo-layout.md` and keeps its original paths: `data_plane/` is +> now `crates/data-plane/`, `control_plane/` is `crates/control-plane/`, +> `examples/*_bench.rs` are in `benchmarks/micro/` (`remote_write_load.rs` +> stays in `crates/data-plane/examples/`), the workloads in `examples/` are in +> `docs/examples/`, `scripts/profile.sh` and `scripts/tiered_views_cgroup.sh` +> are in `benchmarks/scripts/`, and `bench/demo/` is split into `eval/`, +> `eval/demo/` and `deployment/monitoring/`. + ## Audience and context Developers and architects of the backend data plane, and whoever runs or diff --git a/docs/design/demo-plan.md b/docs/design/demo-plan.md index f5b43ada3..38c19be31 100644 --- a/docs/design/demo-plan.md +++ b/docs/design/demo-plan.md @@ -1,5 +1,14 @@ # Data plane and demo plan +> **Paths.** This document predates the folder moves of +> `docs/design/repo-layout.md` and keeps its original paths: `data_plane/` is +> now `crates/data-plane/`, `control_plane/` is `crates/control-plane/`, +> `examples/*_bench.rs` are in `benchmarks/micro/` (`remote_write_load.rs` +> stays in `crates/data-plane/examples/`), the workloads in `examples/` are in +> `docs/examples/`, `scripts/profile.sh` and `scripts/tiered_views_cgroup.sh` +> are in `benchmarks/scripts/`, and `bench/demo/` is split into `eval/`, +> `eval/demo/` and `deployment/monitoring/`. + This document describes the data plane as it stands on `main` and the plan for the single-server demo against VictoriaMetrics. The component designs it summarises are in `data-plane-demo.md` (ingest, precompute, diff --git a/docs/design/parallel-precompute.md b/docs/design/parallel-precompute.md index 29fe0f0b7..28af46909 100644 --- a/docs/design/parallel-precompute.md +++ b/docs/design/parallel-precompute.md @@ -1,5 +1,14 @@ # Design: parallel precompute (push pipelines) +> **Paths.** This document predates the folder moves of +> `docs/design/repo-layout.md` and keeps its original paths: `data_plane/` is +> now `crates/data-plane/`, `control_plane/` is `crates/control-plane/`, +> `examples/*_bench.rs` are in `benchmarks/micro/` (`remote_write_load.rs` +> stays in `crates/data-plane/examples/`), the workloads in `examples/` are in +> `docs/examples/`, `scripts/profile.sh` and `scripts/tiered_views_cgroup.sh` +> are in `benchmarks/scripts/`, and `bench/demo/` is split into `eval/`, +> `eval/demo/` and `deployment/monitoring/`. + ## Audience and context This document is for developers and architects of the backend data plane. diff --git a/docs/design/tiered-view-storage.md b/docs/design/tiered-view-storage.md index 3f7f68fa6..efc17dd37 100644 --- a/docs/design/tiered-view-storage.md +++ b/docs/design/tiered-view-storage.md @@ -1,5 +1,14 @@ # Design: tiered view storage (hot windows in the heap, cold windows in files) +> **Paths.** This document predates the folder moves of +> `docs/design/repo-layout.md` and keeps its original paths: `data_plane/` is +> now `crates/data-plane/`, `control_plane/` is `crates/control-plane/`, +> `examples/*_bench.rs` are in `benchmarks/micro/` (`remote_write_load.rs` +> stays in `crates/data-plane/examples/`), the workloads in `examples/` are in +> `docs/examples/`, `scripts/profile.sh` and `scripts/tiered_views_cgroup.sh` +> are in `benchmarks/scripts/`, and `bench/demo/` is split into `eval/`, +> `eval/demo/` and `deployment/monitoring/`. + ## Audience and context This document is for developers and architects of the backend data plane. diff --git a/examples/planner-layering-example1.json b/docs/examples/planner-layering-example1.json similarity index 100% rename from examples/planner-layering-example1.json rename to docs/examples/planner-layering-example1.json diff --git a/examples/planner-layering-example3b.json b/docs/examples/planner-layering-example3b.json similarity index 100% rename from examples/planner-layering-example3b.json rename to docs/examples/planner-layering-example3b.json diff --git a/examples/planner-layering-example4-b3.json b/docs/examples/planner-layering-example4-b3.json similarity index 100% rename from examples/planner-layering-example4-b3.json rename to docs/examples/planner-layering-example4-b3.json diff --git a/examples/planner-layering-example4b.json b/docs/examples/planner-layering-example4b.json similarity index 100% rename from examples/planner-layering-example4b.json rename to docs/examples/planner-layering-example4b.json diff --git a/eval/.gitignore b/eval/.gitignore new file mode 100644 index 000000000..8690e0ce0 --- /dev/null +++ b/eval/.gitignore @@ -0,0 +1,24 @@ +# Checkouts, binaries and everything a run writes under $ASAPQ_BENCH. +/backend +/ASAPQuery +/prep/ +/runs/ +/report_demo/ +/logs/ +/demo/live/data/ +/demo/live/logs/ +/demo/live/pids/ +/demo/live/screenshots/ +/demo/live/prep-*/ +/demo/live/aside-*/ +/demo/live/cmds/ +/demo/live/mnt/ +/demo/live/disk/ +/demo/live/limits.env +/demo/live/reference_start_ms +/demo/live/stream_start_ms +/demo/live/watchdog.pid +/demo/live/planner/report.json +/demo/live/planner/planning.json +__pycache__/ +*.pyc diff --git a/bench/demo/README.md b/eval/README.md similarity index 67% rename from bench/demo/README.md rename to eval/README.md index 0a0483472..c515ca887 100644 --- a/bench/demo/README.md +++ b/eval/README.md @@ -1,23 +1,24 @@ -# Live demo and comparison tooling +# Evaluation: live demo and comparison tooling Scripts that run the ASAP data plane next to VictoriaMetrics single-node on the same Remote Write feed and the same queries, check both against a reference, and show them on Grafana. Code and configuration only: no run -outputs are kept here. +outputs are kept here (`results/` is git-ignored). Paths below are relative +to this directory, `$ASAPQ_BENCH`. | Path | What it holds | |---|---| -| `run_live_demo.sh` | The live Grafana demo: feeders, the ASAP data plane, VictoriaMetrics, a reference VictoriaMetrics (accuracy), optionally Prometheus (`EXACT=1`), logging proxies, exporters, a watchdog and the query load. | +| `demo/run_live_demo.sh` | The live Grafana demo: feeders, the ASAP data plane, VictoriaMetrics, a reference VictoriaMetrics (accuracy), optionally Prometheus (`EXACT=1`), logging proxies, exporters, a watchdog and the query load. | | `run_vm_demo.sh` | The batch comparison: prepare, run the arms one after another on one feed, report. | | `fetch_binaries.sh`, `build.sh` | Pinned third-party binaries (sha256-checked); builds of the paced feeder and this repository into `$BIN_DIR`. | | `harness/` | `prepare.py` (scaled manifest, feeder table, the Planner's plan through `control_plane`), `run.py` (arms), `report.py`, `demo_table.py`, `tables.py`, `tables2.py`, `accuracy_vs_vm.py`, `compression.py`, `merge_plans.py`, `cgroup_limits.sh`. See `harness/README.md`. | -| `live/` | The live demo's helpers: `proxy.py`, `query_load.py`, `accuracy.py`, `compare.py`, `verify.py`, `browse.py`, exporters, and `planner/cost_inputs.json`. | -| `monitoring/` | Prometheus and process-exporter configuration, Grafana provisioning, the dashboard generators (`grafana/make_*_dashboard.py`), screenshots, Docker Compose or plain binaries (`run_binaries.sh`). | +| `demo/live/` | The live demo's helpers: `proxy.py`, `query_load.py`, `accuracy.py`, `compare.py`, `verify.py`, `browse.py`, exporters, and `planner/cost_inputs.json`. | +| `../deployment/monitoring/` | Prometheus and process-exporter configuration, Grafana provisioning, the dashboard generators (`grafana/make_*_dashboard.py`), screenshots, Docker Compose or plain binaries (`run_binaries.sh`). | | `profile/` | `profile_query_phase.sh` (`run_vm_demo.sh` with `PROFILE=1`). | | `workloads/` | Workload manifests. | | `campaign/` | Records of the multi-host campaign: workload generators (`gen_*.py`), job queue, scale sweep, reruns, collection and summaries, and `paced-feeder-realistic.diff` (realistic feeder values; `build.sh` applies it). | -`live/demo_sequence*.sh`, `live/chain_*.sh`, `live/after_sequence_limits.sh` +`demo/live/demo_sequence*.sh`, `demo/live/chain_*.sh`, `demo/live/after_sequence_limits.sh` and most of `campaign/` are records of the sequences that were run: they name specific builds (`$BENCH_ROOT/bin-live-`) and prepared directories, and are kept to show how the measurements were made, not as entry points. @@ -28,9 +29,9 @@ Everything runs from one working directory, `$ASAPQ_BENCH`. Use this directory and put the checkouts the scripts build next to it: ```sh -export ASAPQ_BENCH=$(git rev-parse --show-toplevel)/bench/demo +export ASAPQ_BENCH=$(git rev-parse --show-toplevel)/eval export BIN_DIR=/path/to/bin # pinned binaries and the built feeder/data_plane/control_plane -ln -s ../.. "$ASAPQ_BENCH/backend" # this repository +ln -s .. "$ASAPQ_BENCH/backend" # this repository git clone https://github.com/ProjectASAP/ASAPQuery "$ASAPQ_BENCH/ASAPQuery" # paced_feeder cd "$ASAPQ_BENCH" ./fetch_binaries.sh # VictoriaMetrics, Prometheus, exporters, Grafana, FlameGraph @@ -43,11 +44,11 @@ cd "$ASAPQ_BENCH" | `BIN_DIR` | all | binaries (required) | | `BENCH_ENV` | shell scripts | optional file sourced first (toolchain paths) | | `ASAP_PLANNER_DIR` | `build.sh`, `harness/prepare.py` | an ASAPPlanner checkout (optional for `build.sh`; `prepare.py` checks Planner features by commit) | -| `BENCH_ROOT` | `live/` records, `campaign/` | directory holding other builds, checkouts and scratch files | +| `BENCH_ROOT` | `demo/live/` records, `campaign/` | directory holding other builds, checkouts and scratch files | | `CAMPAIGN_DIR` | `campaign/` | the job queue's directory on each host | | `BENCH_HOSTS`, `BUILD_HOST`, `REF_HOST`, `ENGINE_SSH`, `ENGINE_ADDR`, `NET_IFACE` | `campaign/` | hosts as `ssh` resolves them (driver hosts, build host, reference replay host, engine host) and the engine link's interface | -The headers of `run_live_demo.sh` and `run_vm_demo.sh` list every other +The headers of `demo/run_live_demo.sh` and `run_vm_demo.sh` list every other variable (cpusets, limits, series, workloads, ports) with its default. `harness/prepare.py` imports ASAPQuery's workload tools, so even `--help` needs the ASAPQuery checkout. @@ -55,19 +56,19 @@ needs the ASAPQuery checkout. ## Live demo ```sh -SERIES=10000 ./run_live_demo.sh start # plan once, start feeders/engines/proxies, wire up monitoring -./run_live_demo.sh status # processes, ingestion, Grafana requests answered/refused -./run_live_demo.sh load on 8 # 8 simulated users querying every engine -./run_live_demo.sh stop +SERIES=10000 demo/run_live_demo.sh start # plan once, start feeders/engines/proxies, wire up monitoring +demo/run_live_demo.sh status # processes, ingestion, Grafana requests answered/refused +demo/run_live_demo.sh load on 8 # 8 simulated users querying every engine +demo/run_live_demo.sh stop ``` `WORKLOAD` picks the manifest under `workloads/` (`dashboard-live` by default, `asap-demo` for the presentation dashboard). Accuracy against the -reference VictoriaMetrics is exported every minute by `live/accuracy.py`. -`EXACT=1` also runs Prometheus; `./run_live_demo.sh compare` needs it. +reference VictoriaMetrics is exported every minute by `demo/live/accuracy.py`. +`EXACT=1` also runs Prometheus; `demo/run_live_demo.sh compare` needs it. `LIMITS=1` runs both engines under the same enforced CPU, memory and disk limits (`harness/cgroup_limits.sh`). Grafana listens on port 13000; the -dashboards are generated by `monitoring/grafana/make_live_dashboard.py` and +dashboards are generated by `../deployment/monitoring/grafana/make_live_dashboard.py` and `make_demo_dashboard.py`. The presentation dashboard's Resources and Scale rows read `REPORT_DATA` (a final experiment's `report_data.json`, not kept here); without it they stay empty. @@ -83,5 +84,5 @@ cost), runs the arms (`asap`, `victoriametrics`, optionally `prometheus`) on the same feed and query schedule, each on its own cpuset, and writes `report.py` and `demo_table.py` tables with each arm's absolute CPU, memory, disk, latency and accuracy; Grafana's `asap-vs-vm` dashboard -(`monitoring/grafana/make_dashboard.py`) shows the runs. +(`../deployment/monitoring/grafana/make_dashboard.py`) shows the runs. `harness/README.md` describes the arms, flags and outputs. diff --git a/bench/demo/build.sh b/eval/build.sh similarity index 100% rename from bench/demo/build.sh rename to eval/build.sh diff --git a/bench/demo/campaign/arm_rerun.sh b/eval/campaign/arm_rerun.sh similarity index 100% rename from bench/demo/campaign/arm_rerun.sh rename to eval/campaign/arm_rerun.sh diff --git a/bench/demo/campaign/b_threshold.py b/eval/campaign/b_threshold.py similarity index 100% rename from bench/demo/campaign/b_threshold.py rename to eval/campaign/b_threshold.py diff --git a/bench/demo/campaign/build_backend.sh b/eval/campaign/build_backend.sh similarity index 100% rename from bench/demo/campaign/build_backend.sh rename to eval/campaign/build_backend.sh diff --git a/bench/demo/campaign/build_summary.py b/eval/campaign/build_summary.py similarity index 100% rename from bench/demo/campaign/build_summary.py rename to eval/campaign/build_summary.py diff --git a/bench/demo/campaign/c5f-post.sh b/eval/campaign/c5f-post.sh similarity index 100% rename from bench/demo/campaign/c5f-post.sh rename to eval/campaign/c5f-post.sh diff --git a/bench/demo/campaign/c6f60-post.sh b/eval/campaign/c6f60-post.sh similarity index 100% rename from bench/demo/campaign/c6f60-post.sh rename to eval/campaign/c6f60-post.sh diff --git a/bench/demo/campaign/c7-chain3.sh b/eval/campaign/c7-chain3.sh similarity index 100% rename from bench/demo/campaign/c7-chain3.sh rename to eval/campaign/c7-chain3.sh diff --git a/bench/demo/campaign/check_extrapolated.py b/eval/campaign/check_extrapolated.py similarity index 100% rename from bench/demo/campaign/check_extrapolated.py rename to eval/campaign/check_extrapolated.py diff --git a/bench/demo/campaign/check_queries_post.py b/eval/campaign/check_queries_post.py similarity index 100% rename from bench/demo/campaign/check_queries_post.py rename to eval/campaign/check_queries_post.py diff --git a/bench/demo/campaign/collect.sh b/eval/campaign/collect.sh similarity index 100% rename from bench/demo/campaign/collect.sh rename to eval/campaign/collect.sh diff --git a/bench/demo/campaign/collect_queue.sh b/eval/campaign/collect_queue.sh similarity index 100% rename from bench/demo/campaign/collect_queue.sh rename to eval/campaign/collect_queue.sh diff --git a/bench/demo/campaign/confirm_vm.sh b/eval/campaign/confirm_vm.sh similarity index 100% rename from bench/demo/campaign/confirm_vm.sh rename to eval/campaign/confirm_vm.sh diff --git a/bench/demo/campaign/demo_job.sh b/eval/campaign/demo_job.sh similarity index 100% rename from bench/demo/campaign/demo_job.sh rename to eval/campaign/demo_job.sh diff --git a/bench/demo/campaign/diag_job.sh b/eval/campaign/diag_job.sh similarity index 100% rename from bench/demo/campaign/diag_job.sh rename to eval/campaign/diag_job.sh diff --git a/bench/demo/campaign/final_collect.sh b/eval/campaign/final_collect.sh similarity index 100% rename from bench/demo/campaign/final_collect.sh rename to eval/campaign/final_collect.sh diff --git a/bench/demo/campaign/final_compare.py b/eval/campaign/final_compare.py similarity index 100% rename from bench/demo/campaign/final_compare.py rename to eval/campaign/final_compare.py diff --git a/bench/demo/campaign/final_demo.sh b/eval/campaign/final_demo.sh similarity index 100% rename from bench/demo/campaign/final_demo.sh rename to eval/campaign/final_demo.sh diff --git a/bench/demo/campaign/final_run.sh b/eval/campaign/final_run.sh similarity index 100% rename from bench/demo/campaign/final_run.sh rename to eval/campaign/final_run.sh diff --git a/bench/demo/campaign/gen_complex.py b/eval/campaign/gen_complex.py similarity index 100% rename from bench/demo/campaign/gen_complex.py rename to eval/campaign/gen_complex.py diff --git a/bench/demo/campaign/gen_demo48.py b/eval/campaign/gen_demo48.py similarity index 100% rename from bench/demo/campaign/gen_demo48.py rename to eval/campaign/gen_demo48.py diff --git a/bench/demo/campaign/gen_seed862.py b/eval/campaign/gen_seed862.py similarity index 100% rename from bench/demo/campaign/gen_seed862.py rename to eval/campaign/gen_seed862.py diff --git a/bench/demo/campaign/gen_typical.py b/eval/campaign/gen_typical.py similarity index 100% rename from bench/demo/campaign/gen_typical.py rename to eval/campaign/gen_typical.py diff --git a/bench/demo/campaign/goodput_est.py b/eval/campaign/goodput_est.py similarity index 100% rename from bench/demo/campaign/goodput_est.py rename to eval/campaign/goodput_est.py diff --git a/bench/demo/campaign/ingest_steps.py b/eval/campaign/ingest_steps.py similarity index 100% rename from bench/demo/campaign/ingest_steps.py rename to eval/campaign/ingest_steps.py diff --git a/bench/demo/campaign/ingest_table.py b/eval/campaign/ingest_table.py similarity index 100% rename from bench/demo/campaign/ingest_table.py rename to eval/campaign/ingest_table.py diff --git a/bench/demo/campaign/launch.sh b/eval/campaign/launch.sh similarity index 100% rename from bench/demo/campaign/launch.sh rename to eval/campaign/launch.sh diff --git a/bench/demo/campaign/live_status.py b/eval/campaign/live_status.py similarity index 100% rename from bench/demo/campaign/live_status.py rename to eval/campaign/live_status.py diff --git a/bench/demo/campaign/paced-feeder-realistic.diff b/eval/campaign/paced-feeder-realistic.diff similarity index 100% rename from bench/demo/campaign/paced-feeder-realistic.diff rename to eval/campaign/paced-feeder-realistic.diff diff --git a/bench/demo/campaign/plan_sharing.py b/eval/campaign/plan_sharing.py similarity index 100% rename from bench/demo/campaign/plan_sharing.py rename to eval/campaign/plan_sharing.py diff --git a/bench/demo/campaign/postrun.sh b/eval/campaign/postrun.sh similarity index 100% rename from bench/demo/campaign/postrun.sh rename to eval/campaign/postrun.sh diff --git a/bench/demo/campaign/probe_stale.py b/eval/campaign/probe_stale.py similarity index 100% rename from bench/demo/campaign/probe_stale.py rename to eval/campaign/probe_stale.py diff --git a/bench/demo/campaign/qrunner.sh b/eval/campaign/qrunner.sh similarity index 100% rename from bench/demo/campaign/qrunner.sh rename to eval/campaign/qrunner.sh diff --git a/bench/demo/campaign/qstatus.sh b/eval/campaign/qstatus.sh similarity index 100% rename from bench/demo/campaign/qstatus.sh rename to eval/campaign/qstatus.sh diff --git a/bench/demo/campaign/queue.sh b/eval/campaign/queue.sh similarity index 100% rename from bench/demo/campaign/queue.sh rename to eval/campaign/queue.sh diff --git a/bench/demo/campaign/r2_reference_watcher.sh b/eval/campaign/r2_reference_watcher.sh similarity index 100% rename from bench/demo/campaign/r2_reference_watcher.sh rename to eval/campaign/r2_reference_watcher.sh diff --git a/bench/demo/campaign/redo_accuracy.sh b/eval/campaign/redo_accuracy.sh similarity index 100% rename from bench/demo/campaign/redo_accuracy.sh rename to eval/campaign/redo_accuracy.sh diff --git a/bench/demo/campaign/rerun_job.sh b/eval/campaign/rerun_job.sh similarity index 100% rename from bench/demo/campaign/rerun_job.sh rename to eval/campaign/rerun_job.sh diff --git a/bench/demo/campaign/scale_job.sh b/eval/campaign/scale_job.sh similarity index 100% rename from bench/demo/campaign/scale_job.sh rename to eval/campaign/scale_job.sh diff --git a/bench/demo/campaign/seed_demo.sh b/eval/campaign/seed_demo.sh similarity index 100% rename from bench/demo/campaign/seed_demo.sh rename to eval/campaign/seed_demo.sh diff --git a/bench/demo/campaign/stall_timeline.py b/eval/campaign/stall_timeline.py similarity index 100% rename from bench/demo/campaign/stall_timeline.py rename to eval/campaign/stall_timeline.py diff --git a/bench/demo/campaign/start_final.sh b/eval/campaign/start_final.sh similarity index 100% rename from bench/demo/campaign/start_final.sh rename to eval/campaign/start_final.sh diff --git a/bench/demo/campaign/status_loop.sh b/eval/campaign/status_loop.sh similarity index 100% rename from bench/demo/campaign/status_loop.sh rename to eval/campaign/status_loop.sh diff --git a/bench/demo/campaign/summarize.py b/eval/campaign/summarize.py similarity index 100% rename from bench/demo/campaign/summarize.py rename to eval/campaign/summarize.py diff --git a/bench/demo/campaign/sweep.sh b/eval/campaign/sweep.sh similarity index 100% rename from bench/demo/campaign/sweep.sh rename to eval/campaign/sweep.sh diff --git a/bench/demo/campaign/sweep_fit.py b/eval/campaign/sweep_fit.py similarity index 100% rename from bench/demo/campaign/sweep_fit.py rename to eval/campaign/sweep_fit.py diff --git a/bench/demo/campaign/sweep_summary.py b/eval/campaign/sweep_summary.py similarity index 100% rename from bench/demo/campaign/sweep_summary.py rename to eval/campaign/sweep_summary.py diff --git a/bench/demo/campaign/userload.py b/eval/campaign/userload.py similarity index 100% rename from bench/demo/campaign/userload.py rename to eval/campaign/userload.py diff --git a/bench/demo/campaign/userload2.py b/eval/campaign/userload2.py similarity index 100% rename from bench/demo/campaign/userload2.py rename to eval/campaign/userload2.py diff --git a/bench/demo/campaign/verify_resets.py b/eval/campaign/verify_resets.py similarity index 100% rename from bench/demo/campaign/verify_resets.py rename to eval/campaign/verify_resets.py diff --git a/bench/demo/campaign/vm_stale.py b/eval/campaign/vm_stale.py similarity index 100% rename from bench/demo/campaign/vm_stale.py rename to eval/campaign/vm_stale.py diff --git a/bench/demo/live/accuracy.py b/eval/demo/live/accuracy.py similarity index 100% rename from bench/demo/live/accuracy.py rename to eval/demo/live/accuracy.py diff --git a/bench/demo/live/after_sequence_limits.sh b/eval/demo/live/after_sequence_limits.sh similarity index 56% rename from bench/demo/live/after_sequence_limits.sh rename to eval/demo/live/after_sequence_limits.sh index 9a85d7469..727599dc0 100755 --- a/bench/demo/live/after_sequence_limits.sh +++ b/eval/demo/live/after_sequence_limits.sh @@ -4,8 +4,8 @@ : "${ASAPQ_BENCH:?set ASAPQ_BENCH}" "${BENCH_ROOT:?set BENCH_ROOT}" cd $ASAPQ_BENCH export BIN_DIR=$BENCH_ROOT/bin-live SERIES=10000 WORKLOAD=asap-demo -until grep -q SEQUENCE_DONE live/logs/demo_sequence_v2.log 2>/dev/null; do sleep 60; done -./run_live_demo.sh reset -LIMITS=1 ./run_live_demo.sh start -start_s=$(( $(cat live/stream_start_ms) / 1000 + 7320 )) -exec bash live/demo_sequence_tagged.sh "$start_s" 8 limits +until grep -q SEQUENCE_DONE demo/live/logs/demo_sequence_v2.log 2>/dev/null; do sleep 60; done +demo/run_live_demo.sh reset +LIMITS=1 demo/run_live_demo.sh start +start_s=$(( $(cat demo/live/stream_start_ms) / 1000 + 7320 )) +exec bash demo/live/demo_sequence_tagged.sh "$start_s" 8 limits diff --git a/bench/demo/live/browse.py b/eval/demo/live/browse.py similarity index 97% rename from bench/demo/live/browse.py rename to eval/demo/live/browse.py index 8cf20d1a3..68a1592f7 100644 --- a/bench/demo/live/browse.py +++ b/eval/demo/live/browse.py @@ -3,7 +3,7 @@ its queries on every auto-refresh, as a viewer's browser would) and take full-page screenshots. - browse.py --url http://127.0.0.1:13000/d/asap-vs-vm-live --minutes 5 --out live/screenshots + browse.py --url http://127.0.0.1:13000/d/asap-vs-vm-live --minutes 5 --out demo/live/screenshots Runs inside the pinned Playwright image (run_live_demo.sh browse).""" import argparse diff --git a/bench/demo/live/chain_2434.sh b/eval/demo/live/chain_2434.sh similarity index 87% rename from bench/demo/live/chain_2434.sh rename to eval/demo/live/chain_2434.sh index 21a4c6016..f254f8fed 100755 --- a/bench/demo/live/chain_2434.sh +++ b/eval/demo/live/chain_2434.sh @@ -10,10 +10,10 @@ cd $ASAPQ_BENCH || exit 1 export BIN_DIR=$BENCH_ROOT/bin-live-2434 SERIES=10000 WORKLOAD=asap-demo FINAL_QUERY_RESULTS_CACHED=1 \ DATA_PLANE_ARGS="--precompute-threads 12 --view-cache-max-bytes 0" LIMITS=1 START_LOAD_USERS=8 \ AUX_CPUS=48-55 -LIVE=live +LIVE=demo/live old=${OLD_TAG:-8156} aside=$LIVE/aside-$old-$(date -u +%Y%m%dT%H%M%SZ) -./run_live_demo.sh stop +demo/run_live_demo.sh stop mkdir -p "$aside" for e in asap victoriametrics; do if mountpoint -q "$LIVE/mnt/$e"; then sudo -n umount "$LIVE/mnt/$e"; fi @@ -25,11 +25,11 @@ cp -a "$LIVE/prep-$WORKLOAD-s$SERIES" "$aside/" for f in stream_start_ms reference_start_ms; do cp -p "$LIVE/$f" "$aside/" 2>/dev/null || true; done rm -f "$LIVE/limits.env" echo "== $(date -u +%T) previous run moved to $aside" -REPLAN=1 ./run_live_demo.sh start -start_ms=$(cat live/stream_start_ms) +REPLAN=1 demo/run_live_demo.sh start +start_ms=$(cat demo/live/stream_start_ms) for h in 2 4 6; do until [ "$(date +%s)" -gt $(( start_ms / 1000 + h * 3600 )) ]; do sleep 60; done - monitoring/screenshot.sh asap-demo "$start_ms" now "live/screenshots/2434-${h}h" 2>&1 | tail -1 + ../deployment/monitoring/screenshot.sh asap-demo "$start_ms" now "demo/live/screenshots/2434-${h}h" 2>&1 | tail -1 echo "== $(date -u +%T) screenshots after ${h} h" done echo CHAIN_DONE diff --git a/bench/demo/live/chain_2f42.sh b/eval/demo/live/chain_2f42.sh similarity index 51% rename from bench/demo/live/chain_2f42.sh rename to eval/demo/live/chain_2f42.sh index f6a072a7c..a67308289 100755 --- a/bench/demo/live/chain_2f42.sh +++ b/eval/demo/live/chain_2f42.sh @@ -6,9 +6,9 @@ cd $ASAPQ_BENCH export BIN_DIR=$BENCH_ROOT/bin-live-2f42 SERIES=10000 WORKLOAD=asap-demo FINAL_QUERY_RESULTS_CACHED=1 \ DATA_PLANE_ARGS="--precompute-threads 12" -./run_live_demo.sh reset -REPLAN=1 ./run_live_demo.sh start -bash live/demo_sequence_tagged.sh "$(( $(cat live/stream_start_ms) / 1000 + 7320 ))" 8 v3-nolimits > live/logs/sequence-v3-nolimits.log 2>&1 -./run_live_demo.sh reset -LIMITS=1 ./run_live_demo.sh start -bash live/demo_sequence_tagged.sh "$(( $(cat live/stream_start_ms) / 1000 + 7320 ))" 8 v3-limits > live/logs/sequence-v3-limits.log 2>&1 +demo/run_live_demo.sh reset +REPLAN=1 demo/run_live_demo.sh start +bash demo/live/demo_sequence_tagged.sh "$(( $(cat demo/live/stream_start_ms) / 1000 + 7320 ))" 8 v3-nolimits > demo/live/logs/sequence-v3-nolimits.log 2>&1 +demo/run_live_demo.sh reset +LIMITS=1 demo/run_live_demo.sh start +bash demo/live/demo_sequence_tagged.sh "$(( $(cat demo/live/stream_start_ms) / 1000 + 7320 ))" 8 v3-limits > demo/live/logs/sequence-v3-limits.log 2>&1 diff --git a/bench/demo/live/chain_8156.sh b/eval/demo/live/chain_8156.sh similarity index 76% rename from bench/demo/live/chain_8156.sh rename to eval/demo/live/chain_8156.sh index 4cd342438..bebd14b3e 100755 --- a/bench/demo/live/chain_8156.sh +++ b/eval/demo/live/chain_8156.sh @@ -7,12 +7,12 @@ cd $ASAPQ_BENCH export BIN_DIR=$BENCH_ROOT/bin-live-8156 SERIES=10000 WORKLOAD=asap-demo FINAL_QUERY_RESULTS_CACHED=1 \ DATA_PLANE_ARGS="--precompute-threads 12 --view-cache-max-bytes 0" LIMITS=1 START_LOAD_USERS=8 \ AUX_CPUS=48-55 -./run_live_demo.sh reset -REPLAN=1 ./run_live_demo.sh start -start_ms=$(cat live/stream_start_ms) +demo/run_live_demo.sh reset +REPLAN=1 demo/run_live_demo.sh start +start_ms=$(cat demo/live/stream_start_ms) for h in 2 4 6; do until [ "$(date +%s)" -gt $(( start_ms / 1000 + h * 3600 )) ]; do sleep 60; done - monitoring/screenshot.sh asap-demo "$start_ms" now "live/screenshots/8156-${h}h" 2>&1 | tail -1 + ../deployment/monitoring/screenshot.sh asap-demo "$start_ms" now "demo/live/screenshots/8156-${h}h" 2>&1 | tail -1 echo "== $(date -u +%T) screenshots after ${h} h" done echo CHAIN_DONE diff --git a/bench/demo/live/chain_d48.sh b/eval/demo/live/chain_d48.sh similarity index 78% rename from bench/demo/live/chain_d48.sh rename to eval/demo/live/chain_d48.sh index 581d37f9c..367510c93 100755 --- a/bench/demo/live/chain_d48.sh +++ b/eval/demo/live/chain_d48.sh @@ -9,14 +9,14 @@ set -u cd $ASAPQ_BENCH || exit 1 [ -x $BENCH_ROOT/bin-live-2434-d48/data_plane ] || { echo "no $BENCH_ROOT/bin-live-2434-d48/data_plane"; exit 1; } -[ -f live/prep-demo48-s2800/backend/plan.json ] || { echo "no live/prep-demo48-s2800"; exit 1; } +[ -f demo/live/prep-demo48-s2800/backend/plan.json ] || { echo "no demo/live/prep-demo48-s2800"; exit 1; } export BIN_DIR=$BENCH_ROOT/bin-live-2434-d48 SERIES=2800 WORKLOAD=demo48 \ DATA_PLANE_ARGS="--precompute-threads 12 --view-cache-max-bytes 0" LIMITS=1 START_LOAD_USERS=4 \ AUX_CPUS=48-55 INGEST_GAUGE=data INGEST_SERIES_QUERY='max_over_time(data[30m])' INGEST_COUNT_QUERY= -LIVE=live +LIVE=demo/live old=${OLD_TAG:-2434} aside=$LIVE/aside-$old-$(date -u +%Y%m%dT%H%M%SZ) -./run_live_demo.sh stop +demo/run_live_demo.sh stop mkdir -p "$aside" for e in asap victoriametrics; do if mountpoint -q "$LIVE/mnt/$e"; then sudo -n umount "$LIVE/mnt/$e"; fi @@ -25,14 +25,14 @@ for e in asap victoriametrics; do done if [ -d "$LIVE/data" ]; then mv "$LIVE/data" "$aside/data"; fi for f in stream_start_ms reference_start_ms; do cp -p "$LIVE/$f" "$aside/" 2>/dev/null || true; done -cp -p monitoring/textfile/asap_demo.prom "$aside/" 2>/dev/null && rm -f monitoring/textfile/asap_demo.prom +cp -p ../deployment/monitoring/textfile/asap_demo.prom "$aside/" 2>/dev/null && rm -f ../deployment/monitoring/textfile/asap_demo.prom rm -f "$LIVE/limits.env" "$LIVE"/cmds/feeder-* echo "== $(date -u +%T) previous run moved to $aside" -./run_live_demo.sh start # the plan exists: kept (no REPLAN) -start_ms=$(cat live/stream_start_ms) +demo/run_live_demo.sh start # the plan exists: kept (no REPLAN) +start_ms=$(cat demo/live/stream_start_ms) for m in 10 60 180; do until [ "$(date +%s)" -gt $(( start_ms / 1000 + m * 60 )) ]; do sleep 30; done - monitoring/screenshot.sh asap-demo "$start_ms" now "live/screenshots/d48-${m}min" 2>&1 | tail -1 + ../deployment/monitoring/screenshot.sh asap-demo "$start_ms" now "demo/live/screenshots/d48-${m}min" 2>&1 | tail -1 echo "== $(date -u +%T) screenshots after ${m} min" done echo CHAIN_DONE diff --git a/bench/demo/live/chain_d48_20c.sh b/eval/demo/live/chain_d48_20c.sh similarity index 84% rename from bench/demo/live/chain_d48_20c.sh rename to eval/demo/live/chain_d48_20c.sh index 086af53e7..ff2a791cf 100755 --- a/bench/demo/live/chain_d48_20c.sh +++ b/eval/demo/live/chain_d48_20c.sh @@ -14,16 +14,16 @@ set -u cd $ASAPQ_BENCH || exit 1 [ -x $BENCH_ROOT/bin-live-2434-d48/data_plane ] || { echo "no $BENCH_ROOT/bin-live-2434-d48/data_plane"; exit 1; } -[ -f live/prep-demo48-s2800/backend/plan.json ] || { echo "no live/prep-demo48-s2800"; exit 1; } +[ -f demo/live/prep-demo48-s2800/backend/plan.json ] || { echo "no demo/live/prep-demo48-s2800"; exit 1; } export BIN_DIR=$BENCH_ROOT/bin-live-2434-d48 SERIES=2800 WORKLOAD=demo48 \ DATA_PLANE_ARGS="--precompute-threads 20 --view-cache-max-bytes 0" LIMITS=1 START_LOAD_USERS=4 \ ASAP_CPUS=0-9,28-37 VM_CPUS=10-19,38-47 REF_CPUS=20-23,48-51 AUX_CPUS=24-27,52-55 \ LIMIT_CORES=20 LIMIT_MEMORY_BYTES=$((96 * 1024 * 1024 * 1024)) LIMIT_DISK_BYTES=214748364800 \ INGEST_GAUGE=data INGEST_SERIES_QUERY='max_over_time(data[30m])' INGEST_COUNT_QUERY= -LIVE=live +LIVE=demo/live old=${OLD_TAG:-d48} aside=$LIVE/aside-$old-$(date -u +%Y%m%dT%H%M%SZ) -./run_live_demo.sh stop +demo/run_live_demo.sh stop mkdir -p "$aside" for e in asap victoriametrics; do if mountpoint -q "$LIVE/mnt/$e"; then sudo -n umount "$LIVE/mnt/$e"; fi @@ -32,18 +32,18 @@ for e in asap victoriametrics; do done if [ -d "$LIVE/data" ]; then mv "$LIVE/data" "$aside/data"; fi for f in stream_start_ms reference_start_ms; do cp -p "$LIVE/$f" "$aside/" 2>/dev/null || true; done -cp -p monitoring/textfile/asap_demo.prom "$aside/" 2>/dev/null && rm -f monitoring/textfile/asap_demo.prom +cp -p ../deployment/monitoring/textfile/asap_demo.prom "$aside/" 2>/dev/null && rm -f ../deployment/monitoring/textfile/asap_demo.prom rm -f "$LIVE/limits.env" "$LIVE"/cmds/feeder-* echo "== $(date -u +%T) previous run moved to $aside" -./run_live_demo.sh start # the plan exists: kept (no REPLAN) +demo/run_live_demo.sh start # the plan exists: kept (no REPLAN) # The monitoring containers (Prometheus, Grafana, exporters) onto the aux CPUs, off the engines' cpusets. for c in $(sudo -n docker ps --format '{{.Names}}' | grep '^asap-vs-vm-monitoring-'); do sudo -n docker update --cpuset-cpus "$AUX_CPUS" "$c" >/dev/null && echo "== $c on cpus $AUX_CPUS" done -start_ms=$(cat live/stream_start_ms) +start_ms=$(cat demo/live/stream_start_ms) for m in 10 60 180 360; do until [ "$(date +%s)" -gt $(( start_ms / 1000 + m * 60 )) ]; do sleep 30; done - monitoring/screenshot.sh asap-demo "$start_ms" now "live/screenshots/d48-${m}min" 2>&1 | tail -1 + ../deployment/monitoring/screenshot.sh asap-demo "$start_ms" now "demo/live/screenshots/d48-${m}min" 2>&1 | tail -1 echo "== $(date -u +%T) screenshots after ${m} min" done echo CHAIN_DONE diff --git a/bench/demo/live/chain_nolimits_then_limits.sh b/eval/demo/live/chain_nolimits_then_limits.sh similarity index 51% rename from bench/demo/live/chain_nolimits_then_limits.sh rename to eval/demo/live/chain_nolimits_then_limits.sh index b5501541c..88d2f1698 100755 --- a/bench/demo/live/chain_nolimits_then_limits.sh +++ b/eval/demo/live/chain_nolimits_then_limits.sh @@ -4,8 +4,8 @@ : "${ASAPQ_BENCH:?set ASAPQ_BENCH}" "${BENCH_ROOT:?set BENCH_ROOT}" cd $ASAPQ_BENCH export BIN_DIR=$BENCH_ROOT/bin-live SERIES=10000 WORKLOAD=asap-demo -bash live/demo_sequence_tagged.sh "$(date +%s)" 8 nolimits > live/logs/sequence-nolimits.log 2>&1 -./run_live_demo.sh reset -LIMITS=1 ./run_live_demo.sh start -start_s=$(( $(cat live/stream_start_ms) / 1000 + 7320 )) -bash live/demo_sequence_tagged.sh "$start_s" 8 limits > live/logs/sequence-limits.log 2>&1 +bash demo/live/demo_sequence_tagged.sh "$(date +%s)" 8 nolimits > demo/live/logs/sequence-nolimits.log 2>&1 +demo/run_live_demo.sh reset +LIMITS=1 demo/run_live_demo.sh start +start_s=$(( $(cat demo/live/stream_start_ms) / 1000 + 7320 )) +bash demo/live/demo_sequence_tagged.sh "$start_s" 8 limits > demo/live/logs/sequence-limits.log 2>&1 diff --git a/bench/demo/live/compare.py b/eval/demo/live/compare.py similarity index 100% rename from bench/demo/live/compare.py rename to eval/demo/live/compare.py diff --git a/bench/demo/live/demo_sequence.sh b/eval/demo/live/demo_sequence.sh similarity index 76% rename from bench/demo/live/demo_sequence.sh rename to eval/demo/live/demo_sequence.sh index 00ae89cc7..c31c857cf 100644 --- a/bench/demo/live/demo_sequence.sh +++ b/eval/demo/live/demo_sequence.sh @@ -1,24 +1,24 @@ #!/bin/bash # Live demo sequence: ingest only -> query load on (N users) -> off, with screenshots and a per-state # table (feeder lag, overrun ticks, visible-sample fraction, accuracy, load outcomes) from the -# monitoring Prometheus. live/demo_sequence.sh [users] +# monitoring Prometheus. demo/live/demo_sequence.sh [users] : "${ASAPQ_BENCH:?set ASAPQ_BENCH}" "${BENCH_ROOT:?set BENCH_ROOT}" cd $ASAPQ_BENCH export SERIES=10000 WORKLOAD=asap-demo AUX_CPUS=48-55 BIN_DIR=$BENCH_ROOT/bin-live USERS=${2:-8} until [ "$(date +%s)" -gt "${1:-0}" ]; do sleep 30; done -mark() { date +%s > "live/logs/state-$1.t"; echo "== $(date -u +%T) $1"; } +mark() { date +%s > "demo/live/logs/state-$1.t"; echo "== $(date -u +%T) $1"; } mark A-start; sleep 600; mark A-end -monitoring/screenshot.sh asap-demo now-30m now live/screenshots/v2-state-A-ingest-only 2>&1 | tail -1 -./run_live_demo.sh load on "$USERS"; mark B-start +../deployment/monitoring/screenshot.sh asap-demo now-30m now demo/live/screenshots/v2-state-A-ingest-only 2>&1 | tail -1 +demo/run_live_demo.sh load on "$USERS"; mark B-start sleep 1500; mark B-end -monitoring/screenshot.sh asap-demo now-45m now live/screenshots/v2-state-B-load-on 2>&1 | tail -1 -./run_live_demo.sh load off; mark C-start +../deployment/monitoring/screenshot.sh asap-demo now-45m now demo/live/screenshots/v2-state-B-load-on 2>&1 | tail -1 +demo/run_live_demo.sh load off; mark C-start sleep 900; mark C-end -monitoring/screenshot.sh asap-demo now-1h now live/screenshots/v2-state-C-load-off 2>&1 | tail -1 +../deployment/monitoring/screenshot.sh asap-demo now-1h now demo/live/screenshots/v2-state-C-load-off 2>&1 | tail -1 python3 - <<'PY' import json, urllib.parse, urllib.request -t = {k: int(open(f"live/logs/state-{k}.t").read()) for k in +t = {k: int(open(f"demo/live/logs/state-{k}.t").read()) for k in ("A-start", "A-end", "B-start", "B-end", "C-start", "C-end")} def q(expr, at): url = "http://127.0.0.1:19090/api/v1/query?" + urllib.parse.urlencode({"query": expr, "time": at}) @@ -49,5 +49,5 @@ for st in ("A", "B", "C"): for k in sorted(errs): print(f"| {st} | {k[0]} | {k[1]} | {errs[k]:.4f} | {within.get(k, float('nan')):.3f} |") PY -ps -o rss,pcpu,cmd -p "$(cat live/pids/data_plane)","$(cat live/pids/victoria-metrics)" | cut -c1-70 +ps -o rss,pcpu,cmd -p "$(cat demo/live/pids/data_plane)","$(cat demo/live/pids/victoria-metrics)" | cut -c1-70 echo SEQUENCE_DONE diff --git a/bench/demo/live/demo_sequence_tagged.sh b/eval/demo/live/demo_sequence_tagged.sh similarity index 77% rename from bench/demo/live/demo_sequence_tagged.sh rename to eval/demo/live/demo_sequence_tagged.sh index 16be93c3a..2adf03f3a 100755 --- a/bench/demo/live/demo_sequence_tagged.sh +++ b/eval/demo/live/demo_sequence_tagged.sh @@ -1,26 +1,26 @@ #!/bin/bash # Live demo sequence: ingest only -> query load on (N users) -> off, with screenshots and a per-state # table (feeder lag, overrun ticks, visible-sample fraction, accuracy, load outcomes) from the -# monitoring Prometheus. live/demo_sequence.sh [users] +# monitoring Prometheus. demo/live/demo_sequence.sh [users] : "${ASAPQ_BENCH:?set ASAPQ_BENCH}" "${BENCH_ROOT:?set BENCH_ROOT}" cd $ASAPQ_BENCH export SERIES=10000 WORKLOAD=asap-demo AUX_CPUS=48-55 BIN_DIR=${BIN_DIR:?set BIN_DIR} USERS=${2:-8} TAG=${3:-v2} until [ "$(date +%s)" -gt "${1:-0}" ]; do sleep 30; done -mark() { date +%s > "live/logs/$TAG-state-$1.t"; echo "== $(date -u +%T) $1"; } +mark() { date +%s > "demo/live/logs/$TAG-state-$1.t"; echo "== $(date -u +%T) $1"; } mark A-start; sleep 600; mark A-end -monitoring/screenshot.sh asap-demo now-30m now live/screenshots/$TAG-state-A-ingest-only 2>&1 | tail -1 -./run_live_demo.sh load on "$USERS"; mark B-start +../deployment/monitoring/screenshot.sh asap-demo now-30m now demo/live/screenshots/$TAG-state-A-ingest-only 2>&1 | tail -1 +demo/run_live_demo.sh load on "$USERS"; mark B-start sleep 1500; mark B-end -monitoring/screenshot.sh asap-demo now-45m now live/screenshots/$TAG-state-B-load-on 2>&1 | tail -1 -./run_live_demo.sh load off; mark C-start +../deployment/monitoring/screenshot.sh asap-demo now-45m now demo/live/screenshots/$TAG-state-B-load-on 2>&1 | tail -1 +demo/run_live_demo.sh load off; mark C-start sleep 900; mark C-end -monitoring/screenshot.sh asap-demo now-1h now live/screenshots/$TAG-state-C-load-off 2>&1 | tail -1 +../deployment/monitoring/screenshot.sh asap-demo now-1h now demo/live/screenshots/$TAG-state-C-load-off 2>&1 | tail -1 TAG=$TAG python3 - <<'PY' import json, os, urllib.parse, urllib.request TAG = os.environ['TAG'] -t = {k: int(open(f"live/logs/{TAG}-state-{k}.t").read()) for k in +t = {k: int(open(f"demo/live/logs/{TAG}-state-{k}.t").read()) for k in ("A-start", "A-end", "B-start", "B-end", "C-start", "C-end")} def q(expr, at): url = "http://127.0.0.1:19090/api/v1/query?" + urllib.parse.urlencode({"query": expr, "time": at}) @@ -52,5 +52,5 @@ for st in ("A", "B", "C"): for k in sorted(errs): print(f"| {st} | {k[0]} | {k[1]} | {errs[k]:.4f} | {within.get(k, float('nan')):.3f} |") PY -ps -o rss,pcpu,cmd -p "$(cat live/pids/data_plane)","$(cat live/pids/victoria-metrics)" | cut -c1-70 +ps -o rss,pcpu,cmd -p "$(cat demo/live/pids/data_plane)","$(cat demo/live/pids/victoria-metrics)" | cut -c1-70 echo SEQUENCE_DONE diff --git a/bench/demo/live/experiment_to_textfile.py b/eval/demo/live/experiment_to_textfile.py similarity index 98% rename from bench/demo/live/experiment_to_textfile.py rename to eval/demo/live/experiment_to_textfile.py index 7ec9c99ca..17c45a907 100644 --- a/bench/demo/live/experiment_to_textfile.py +++ b/eval/demo/live/experiment_to_textfile.py @@ -3,7 +3,7 @@ report generator's report_data.json (report_demo/build.py) and write them as metrics for node-exporter's textfile collector. - experiment_to_textfile.py --report-data report_demo/out/report_data.json --textfile monitoring/textfile/asap_demo_experiment.prom + experiment_to_textfile.py --report-data report_demo/out/report_data.json --textfile ../deployment/monitoring/textfile/asap_demo_experiment.prom One config is shown: --config (a substring of its `config` title, e.g. "asap-demo · 10,000 series · range"), else the last one. Keys read from its diff --git a/bench/demo/live/ingest_exporter.py b/eval/demo/live/ingest_exporter.py similarity index 100% rename from bench/demo/live/ingest_exporter.py rename to eval/demo/live/ingest_exporter.py diff --git a/bench/demo/live/limits_exporter.py b/eval/demo/live/limits_exporter.py similarity index 98% rename from bench/demo/live/limits_exporter.py rename to eval/demo/live/limits_exporter.py index 0bb0fd010..7a8c2a12b 100644 --- a/bench/demo/live/limits_exporter.py +++ b/eval/demo/live/limits_exporter.py @@ -33,7 +33,7 @@ import time from pathlib import Path -sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "harness")) +sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent / "harness")) from run import cgroup_memory, cgroup_peak_and_psi, page_cache_bytes # noqa: E402 diff --git a/bench/demo/live/planner/cost_inputs.json b/eval/demo/live/planner/cost_inputs.json similarity index 100% rename from bench/demo/live/planner/cost_inputs.json rename to eval/demo/live/planner/cost_inputs.json diff --git a/bench/demo/live/planner_report_to_textfile.py b/eval/demo/live/planner_report_to_textfile.py similarity index 98% rename from bench/demo/live/planner_report_to_textfile.py rename to eval/demo/live/planner_report_to_textfile.py index 6937f57d4..b5a2c88a5 100644 --- a/bench/demo/live/planner_report_to_textfile.py +++ b/eval/demo/live/planner_report_to_textfile.py @@ -4,7 +4,7 @@ for node-exporter's textfile collector. planner_report_to_textfile.py --report report.json --cost-inputs cost_inputs.json \ - --queries queries.json --planning planning.json --textfile monitoring/textfile/asap_demo_planner.prom + --queries queries.json --planning planning.json --textfile ../deployment/monitoring/textfile/asap_demo_planner.prom asap_demo_planner_limit{resource} cpu_cores, memory_bytes, disk_bytes (the cost inputs' ClusterLimits) asap_demo_planner_predicted{resource} peak_cpu_cores, peak_memory_bytes, disk_bytes of the chosen plan diff --git a/bench/demo/live/prometheus.yml b/eval/demo/live/prometheus.yml similarity index 100% rename from bench/demo/live/prometheus.yml rename to eval/demo/live/prometheus.yml diff --git a/bench/demo/live/proxy.py b/eval/demo/live/proxy.py similarity index 99% rename from bench/demo/live/proxy.py rename to eval/demo/live/proxy.py index 893ae7a59..210a449d0 100644 --- a/bench/demo/live/proxy.py +++ b/eval/demo/live/proxy.py @@ -2,7 +2,7 @@ """A logging pass-through in front of one Prometheus-API data source, so the live demo sees every request Grafana sends exactly as sent. - proxy.py --name ASAP --listen 127.0.0.1:19721 --upstream http://127.0.0.1:19711 --log live/logs/proxy-asap.jsonl + proxy.py --name ASAP --listen 127.0.0.1:19721 --upstream http://127.0.0.1:19711 --log demo/live/logs/proxy-asap.jsonl Every request is forwarded unchanged (method, path, query string, body, headers except hop-by-hop ones) and the response returned unchanged. For diff --git a/bench/demo/live/query_load.py b/eval/demo/live/query_load.py similarity index 96% rename from bench/demo/live/query_load.py rename to eval/demo/live/query_load.py index f722ffdc1..0bbebf205 100644 --- a/bench/demo/live/query_load.py +++ b/eval/demo/live/query_load.py @@ -12,10 +12,10 @@ Every request is classified as in the campaign's userload2.py (goodput): answered_ok 200 within the SLO (latency <= the query's interval) and the engine's - latest accuracy check for that query (live/accuracy.py, against the + latest accuracy check for that query (demo/live/accuracy.py, against the reference) within 5% inaccurate_missing_samples 200 within the SLO, latest check outside 5%, and the engine's visible - fraction of the window's samples (live/ingest_exporter.py) below 0.999 + fraction of the window's samples (demo/live/ingest_exporter.py) below 0.999 inaccurate_approximation the same with every sample visible slow 200 but over the SLO rejected HTTP 4xx/5xx (VictoriaMetrics 503/429, ASAP refusals) @@ -54,8 +54,8 @@ def main(): ap.add_argument("--timeout-s", type=float, default=120) ap.add_argument("--listen", default="127.0.0.1:19725") ap.add_argument("--log", required=True) - ap.add_argument("--accuracy-textfile", help="live/accuracy.py's output (asap_demo_accuracy_*)") - ap.add_argument("--ingest-metrics", help="live/ingest_exporter.py's /metrics URL (live_window_fraction)") + ap.add_argument("--accuracy-textfile", help="demo/live/accuracy.py's output (asap_demo_accuracy_*)") + ap.add_argument("--ingest-metrics", help="demo/live/ingest_exporter.py's /metrics URL (live_window_fraction)") ap.add_argument("--target", type=float, default=0.05) args = ap.parse_args() engines = dict(e.split("=", 1) for e in args.engine) diff --git a/bench/demo/live/verify.py b/eval/demo/live/verify.py similarity index 97% rename from bench/demo/live/verify.py rename to eval/demo/live/verify.py index 9fd9fd07e..320c9c412 100644 --- a/bench/demo/live/verify.py +++ b/eval/demo/live/verify.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """Summarize the requests Grafana sent through the live proxies -(live/logs/requests-*.jsonl): per data source and query, how many were +(demo/live/logs/requests-*.jsonl): per data source and query, how many were answered, refused or failed, which start/end/step they carried (steps per request, whether start and end are on the step grid, how far end was behind the wall clock), and the refusal reasons.""" diff --git a/bench/demo/run_live_demo.sh b/eval/demo/run_live_demo.sh similarity index 92% rename from bench/demo/run_live_demo.sh rename to eval/demo/run_live_demo.sh index ee168e3be..aa7c8eb5f 100755 --- a/bench/demo/run_live_demo.sh +++ b/eval/demo/run_live_demo.sh @@ -6,27 +6,27 @@ # reference VictoriaMetrics with its own feeder and no query load (the accuracy # reference), and with EXACT=1 Prometheus 3.5 (the exact column; needed by # compare). Each runs on its own cpuset. Grafana -# queries each through a logging pass-through (live/proxy.py) that records +# queries each through a logging pass-through (demo/live/proxy.py) that records # every request's start/end/step and status. # -# ./run_live_demo.sh start prepare (plan once), start everything, wire up monitoring -# ./run_live_demo.sh stop stop the live processes (data and views kept) -# ./run_live_demo.sh status processes, ingestion, and Grafana requests answered/refused -# ./run_live_demo.sh verify per data source and query: requests, statuses, start/end/step seen -# ./run_live_demo.sh compare ASAP and VictoriaMetrics vs Prometheus on the last full hour's grid -# ./run_live_demo.sh browse [--minutes N] headless browser keeps DASHBOARD [asap-demo] open; screenshots in live/screenshots -# ./run_live_demo.sh restart-vm restart VictoriaMetrics (VM_VERSION), same flags and data; resumes its feeder -# ./run_live_demo.sh resume-feeders restart any feeder that stopped (leaves a gap, annotated) -# ./run_live_demo.sh load on [N]|off start/stop the query load: N simulated users [LOAD_USERS or 8], +# demo/run_live_demo.sh start prepare (plan once), start everything, wire up monitoring +# demo/run_live_demo.sh stop stop the live processes (data and views kept) +# demo/run_live_demo.sh status processes, ingestion, and Grafana requests answered/refused +# demo/run_live_demo.sh verify per data source and query: requests, statuses, start/end/step seen +# demo/run_live_demo.sh compare ASAP and VictoriaMetrics vs Prometheus on the last full hour's grid +# demo/run_live_demo.sh browse [--minutes N] headless browser keeps DASHBOARD [asap-demo] open; screenshots in demo/live/screenshots +# demo/run_live_demo.sh restart-vm restart VictoriaMetrics (VM_VERSION), same flags and data; resumes its feeder +# demo/run_live_demo.sh resume-feeders restart any feeder that stopped (leaves a gap, annotated) +# demo/run_live_demo.sh load on [N]|off start/stop the query load: N simulated users [LOAD_USERS or 8], # each sending every query at its interval (staggered) to every engine # that runs it, no throttling; annotated on the dashboards -# ./run_live_demo.sh watchdog start the detached watchdog (start does it): every 30 s, restarts any +# demo/run_live_demo.sh watchdog start the detached watchdog (start does it): every 30 s, restarts any # component whose process died (feeders from the next second, annotated) -# ./run_live_demo.sh pin re-apply the cpusets below to the running processes -# ./run_live_demo.sh reset stop and delete the live data (TSDBs, views) +# demo/run_live_demo.sh pin re-apply the cpusets below to the running processes +# demo/run_live_demo.sh reset stop and delete the live data (TSDBs, views) # # Environment (defaults in brackets): -# ASAPQ_BENCH BIN_DIR (required; see bench/demo/README.md) +# ASAPQ_BENCH BIN_DIR (required; see eval/README.md) # SERIES input series per metric, a multiple of 200 [10000] # WORKLOAD demo workload under workloads/ [dashboard-live]; asap-demo for the presentation # dashboard (uid asap-demo; metrics lat and reqs) @@ -35,7 +35,7 @@ # (the feeders and the proxies run on AUX_CPUS) # LIMITS=1 both engines under identical enforced limits (cgroup cpu.max + cpuset, memory.max # with page cache, fixed-size filesystem): LIMIT_CORES [12], LIMIT_MEMORY_BYTES and -# LIMIT_DISK_BYTES [the planner's targets in live/planner/cost_inputs.json] +# LIMIT_DISK_BYTES [the planner's targets in demo/live/planner/cost_inputs.json] # EXACT_STEP_S step of the Prometheus (exact) panels when not the plan's, e.g. 300 at 10k series, # where Prometheus cannot evaluate every 15 s step of a 1 h range within its 2 min timeout # [300 from 10000 series up, else the plan step] @@ -48,9 +48,10 @@ set -euo pipefail [ -n "${BENCH_ENV:-}" ] && [ -f "$BENCH_ENV" ] && source "$BENCH_ENV" export ASAPQ_BENCH=${ASAPQ_BENCH:?set ASAPQ_BENCH} export BIN_DIR=${BIN_DIR:?set BIN_DIR} -mkdir -p "$ASAPQ_BENCH/monitoring/grafana/dashboards" "$ASAPQ_BENCH/monitoring/textfile" +MON=$ASAPQ_BENCH/../deployment/monitoring # this repository's deployment/monitoring +mkdir -p "$MON/grafana/dashboards" "$MON/textfile" BASE=$ASAPQ_BENCH -LIVE=$BASE/live +LIVE=$BASE/demo/live SERIES=${SERIES:-10000} WORKLOAD=${WORKLOAD:-dashboard-live} RANGE=${RANGE:-15:3600:15} @@ -59,7 +60,7 @@ VM_VERSION=${VM_VERSION:-1.156.0} # VictoriaMetrics single-node release (fetch EXACT=${EXACT:-0} # 1: also run Prometheus 3.5 (the exact column of asap-vs-vm-live); off by default # LIMITS=1: both engines under the same enforced limits (harness/cgroup_limits.sh): cpu.max of # LIMIT_CORES cores plus the engine's cpuset, memory.max (page cache included), and a fixed-size -# filesystem of LIMIT_DISK_BYTES for its data. Defaults: the planner's targets (live/planner). +# filesystem of LIMIT_DISK_BYTES for its data. Defaults: the planner's targets (demo/live/planner). # (|| true: under set -e/pipefail a missing limits.env must not end the script.) LIMITS=${LIMITS:-$(sed -n 's/^LIMITS=//p' "$LIVE/limits.env" 2>/dev/null || true)} LIMITS=${LIMITS:-0} @@ -67,7 +68,7 @@ LIMIT_CORES=${LIMIT_CORES:-12} LIMIT_MEMORY_BYTES=${LIMIT_MEMORY_BYTES:-$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["cost_model"]["cluster_capacity"]["memory_bytes"])' "$LIVE/planner/cost_inputs.json" 2>/dev/null || echo 68719476736)} LIMIT_DISK_BYTES=${LIMIT_DISK_BYTES:-$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["cost_model"]["cluster_capacity"]["disk_bytes"])' "$LIVE/planner/cost_inputs.json" 2>/dev/null || echo 214748364800)} CGL="$BASE/harness/cgroup_limits.sh" -# The ingestion exporter's probes (live/ingest_exporter.py): a gauge, a planned per-series query, and a +# The ingestion exporter's probes (demo/live/ingest_exporter.py): a gauge, a planned per-series query, and a # planned sample count over 5 min (empty: no visible-fraction probe, e.g. a workload with no such query). INGEST_GAUGE=${INGEST_GAUGE:-lat} INGEST_SERIES_QUERY=${INGEST_SERIES_QUERY-max_over_time(lat[30m])} @@ -90,7 +91,7 @@ else fi LOGS=$LIVE/logs PIDS=$LIVE/pids -COMPOSE="$BASE/monitoring/docker-compose.yml" +COMPOSE="$MON/docker-compose.yml" mkdir -p "$DATA" "$LOGS" "$PIDS" log() { echo "$(date -u +%FT%TZ) $*"; } @@ -225,7 +226,7 @@ start_accuracy() { spawn accuracy python3 "$LIVE/accuracy.py" --asap http://127.0.0.1:$P_ASAP --vm http://127.0.0.1:$P_VM \ --reference http://127.0.0.1:$P_REF --reference-start-ms "$(cat "$LIVE/reference_start_ms" 2>/dev/null || echo 0)" \ --queries "$PREP/queries.json" --behind-s "$QUERY_DELAY_S" \ - --textfile "$BASE/monitoring/textfile/asap_demo.prom" --report-data "$REPORT_DATA" + --textfile "$MON/textfile/asap_demo.prom" --report-data "$REPORT_DATA" } resume_feeder() { # sink port: restart its feeders that stopped (a feeder stops when every request @@ -286,13 +287,13 @@ monitoring() { start() { prepare - python3 "$BASE/monitoring/grafana/make_live_dashboard.py" --queries "$PREP/queries.json" --shift-s "$QUERY_DELAY_S" \ + python3 "$MON/grafana/make_live_dashboard.py" --queries "$PREP/queries.json" --shift-s "$QUERY_DELAY_S" \ --exact-step-s "${EXACT_STEP_S:-$( (( SERIES >= 10000 )) && echo 300 || echo 0)}" \ $( [ "$EXACT" = 1 ] || echo --no-exact ) >/dev/null # The presentation dashboard (ASAP vs VictoriaMetrics only). local run_start_ms run_start_ms=$(( ($(date +%s) / 60 + 1) * 60 * 1000 )) - python3 "$BASE/monitoring/grafana/make_demo_dashboard.py" --prep "$PREP" --shift-s "$QUERY_DELAY_S" \ + python3 "$MON/grafana/make_demo_dashboard.py" --prep "$PREP" --shift-s "$QUERY_DELAY_S" \ --planner-dir "$LIVE/planner" --run-start-ms "$run_start_ms" --cores "$LIMIT_CORES" \ $( [ "$LIMITS" = 1 ] && echo --memory-bytes "$LIMIT_MEMORY_BYTES" --disk-bytes "$LIMIT_DISK_BYTES" ) >/dev/null local start_ms=$run_start_ms @@ -396,7 +397,7 @@ case "${1:-status}" in spawn query-load python3 "$LIVE/query_load.py" --queries "$PREP/queries.json" \ --engine "asap=http://127.0.0.1:$P_ASAP" --engine "victoriametrics=http://127.0.0.1:$P_VM" \ --users "$users" --delay-s "$QUERY_DELAY_S" --timeout-s 600 --listen 127.0.0.1:19725 \ - --log "$LOGS/query-load.jsonl" --accuracy-textfile "$BASE/monitoring/textfile/asap_demo.prom" \ + --log "$LOGS/query-load.jsonl" --accuracy-textfile "$MON/textfile/asap_demo.prom" \ --ingest-metrics http://127.0.0.1:19724/metrics annotate "query load ON: $users simulated users, every query at its own interval, to every engine that runs it" ;; off) if [ -f "$PIDS/query-load" ]; then kill "$(cat "$PIDS/query-load")" 2>/dev/null || true diff --git a/bench/demo/fetch_binaries.sh b/eval/fetch_binaries.sh similarity index 100% rename from bench/demo/fetch_binaries.sh rename to eval/fetch_binaries.sh diff --git a/bench/demo/harness/README.md b/eval/harness/README.md similarity index 85% rename from bench/demo/harness/README.md rename to eval/harness/README.md index cc8af0c4e..aa04c6335 100644 --- a/bench/demo/harness/README.md +++ b/eval/harness/README.md @@ -1,6 +1,8 @@ # Three-arm runner for ASAPQuery's random workloads -The comparison harness. `$ASAPQ_BENCH` is the working directory (see `../README.md`). +The comparison harness. `$ASAPQ_BENCH` (this repository's `eval/`) is the working +directory (see `../README.md`). Paths that start with `../` are relative to this +directory (`eval/harness/`); the others are relative to `$ASAPQ_BENCH`. Arms, on the same data and query schedule: @@ -123,7 +125,7 @@ SERIES="1000 10000" ARM_CORES=16 QUERY_PHASE_S=600 WORKLOADS="demo/dashboard-hea `run_vm_demo.sh` downloads missing pinned binaries into `$BIN_DIR`, builds `paced_feeder`/`data_plane`/`control_plane` there when missing (from `$BACKEND_DIR`), starts the monitoring stack -(`../monitoring`: docker compose, or `run_binaries.sh` without docker), and +(`../../deployment/monitoring`: docker compose, or `run_binaries.sh` without docker), and for each workload runs prepare → run (`--metrics-port 19093`) → `report.py` → `demo_table.py` (also into the monitoring textfile directory). `PROFILE=1` runs `../profile/profile_query_phase.sh` beside it. Grafana: @@ -157,25 +159,25 @@ written and read (`/proc//io` write_bytes/read_bytes) are recorded per phase and shown per component; `resources.json` `storage_bytes` has each data directory's size at the end. -## Live Grafana demo (`../run_live_demo.sh`) +## Live Grafana demo (`../demo/run_live_demo.sh`) A long-running setup for showing the comparison in Grafana: one paced feeder per engine (same seed and start, real time, continuous) sends the same samples to the ASAP data plane (`--no-forward`, the plan of `workloads/dashboard-live.json` planned with `range_evaluation` step 15 s, -span 1 h; views persisted in `live/data/asap-views`), VictoriaMetrics (no +span 1 h; views persisted in `demo/live/data/asap-views`), VictoriaMetrics (no stream aggregation) and Prometheus 3.5 (exact). Each engine runs on its own cpuset (`ASAP_CPUS`, `VM_CPUS`, `PROM_CPUS`; feeders and proxies on `AUX_CPUS`). `dashboard-live` is dashboard-heavy's query shapes aggregated to at most 20 output series (so a panel stays readable at 10k input series) at 1 sample/s. -Grafana queries each engine through `live/proxy.py`, a pass-through that logs +Grafana queries each engine through `demo/live/proxy.py`, a pass-through that logs every request (start/end/step, status, the data plane's refusal reason) to -`live/logs/requests-*.jsonl` and exports `live_proxy_*` metrics. Data sources +`demo/live/logs/requests-*.jsonl` and exports `live_proxy_*` metrics. Data sources `ASAP`, `VictoriaMetrics`, `Prometheus (exact)` are provisioned -(`monitoring/grafana/provisioning/datasources/live.yml`); the dashboard -`asap-vs-vm-live` (`monitoring/grafana/make_live_dashboard.py`) has one row +(`../deployment/monitoring/grafana/provisioning/datasources/live.yml`); the dashboard +`asap-vs-vm-live` (`../deployment/monitoring/grafana/make_live_dashboard.py`) has one row per query with the three panels side by side, all `query_range` over the last hour at a 15 s step (min interval 15 s, max data points 11000), shifted 6 s back (the query delay). Grafana aligns start and end down to a multiple of the step (UTC @@ -188,17 +190,17 @@ has no rows for, so the ASAP panels answer once span + longest window they show the refusal. ```sh -SERIES=10000 ../run_live_demo.sh start # plan, start, wire up monitoring -../run_live_demo.sh status # processes, ingestion, recent requests -../run_live_demo.sh verify --since-minutes 30 # per data source and query: statuses, start/end/step seen -EXACT=1 ../run_live_demo.sh compare # ASAP and VM vs Prometheus on the plan's grid (needs EXACT=1 at start) -../run_live_demo.sh browse --minutes 10 # headless browser holds the dashboard open; screenshots +SERIES=10000 ../demo/run_live_demo.sh start # plan, start, wire up monitoring +../demo/run_live_demo.sh status # processes, ingestion, recent requests +../demo/run_live_demo.sh verify --since-minutes 30 # per data source and query: statuses, start/end/step seen +EXACT=1 ../demo/run_live_demo.sh compare # ASAP and VM vs Prometheus on the plan's grid (needs EXACT=1 at start) +../demo/run_live_demo.sh browse --minutes 10 # headless browser holds the dashboard open; screenshots ssh -N -L 13000:127.0.0.1:13000 # then http://127.0.0.1:13000/d/asap-vs-vm-live ``` ## Screenshots -`monitoring/screenshot.sh [var=value]` renders a +`../deployment/monitoring/screenshot.sh [var=value]` renders a dashboard (whole page) and each panel alone to PNG with headless Chromium (pinned Playwright image). `run_vm_demo.sh` does it for `asap-vs-vm` over each run's time range with `SCREENSHOTS=1`. The report panels read gauges written @@ -206,26 +208,26 @@ after the run, so render with `to` at or after the report time. ## Presentation dashboard (`asap-demo`) -`SERIES=1000 WORKLOAD=asap-demo ../run_live_demo.sh start` runs the live setup +`SERIES=1000 WORKLOAD=asap-demo ../demo/run_live_demo.sh start` runs the live setup on `workloads/asap-demo.json` (gauge `lat` and counter `reqs` per series; `http_requests_total` with 20 status codes, one 5xx, uniform increments so 5% of requests are 5xx; gauge `queue_depth`; all 1 sample/s) and generates -`monitoring/grafana/make_demo_dashboard.py` -> uid `asap-demo`: ASAP vs +`../deployment/monitoring/grafana/make_demo_dashboard.py` -> uid `asap-demo`: ASAP vs VictoriaMetrics only, resource usage only. A reference VictoriaMetrics with its -own feeder and no query load is the reference for `live/accuracy.py` (max relative error per query +own feeder and no query load is the reference for `demo/live/accuracy.py` (max relative error per query and the answers table, every minute, at a time on the plan's grid) and is never shown. The Resources and Scale rows read the final experiment from `REPORT_DATA` (a final experiment's report_data.json, not in this repository; keys in -`live/experiment_to_textfile.py`); without it those rows stay empty. ASAP answers a panel once window + 1 h +`demo/live/experiment_to_textfile.py`); without it those rows stay empty. ASAP answers a panel once window + 1 h span of data exist (2 h for the 1 h windows, 7 h for the 6 h window). ### Ingestion while querying (live) -`../run_live_demo.sh load on|off` starts or stops the query load -(`live/query_load.py`): the planned queries at their intervals, sent alike to +`../demo/run_live_demo.sh load on|off` starts or stops the query load +(`demo/live/query_load.py`): the planned queries at their intervals, sent alike to both engines, 6 s after each evaluation time, at most one request in flight per engine and query. Starting and stopping it posts annotations on the -dashboards. `live/ingest_exporter.py` (port 19724) exports, per engine: +dashboards. `demo/live/ingest_exporter.py` (port 19724) exports, per engine: - the feeder's start lag and its overrun ticks (from the feeder logs); - what the feeder offers; - answer freshness: VictoriaMetrics' `now - max(timestamp(lat))`, and ASAP's diff --git a/bench/demo/harness/accuracy_vs_vm.py b/eval/harness/accuracy_vs_vm.py similarity index 100% rename from bench/demo/harness/accuracy_vs_vm.py rename to eval/harness/accuracy_vs_vm.py diff --git a/bench/demo/harness/cgroup_limits.sh b/eval/harness/cgroup_limits.sh similarity index 100% rename from bench/demo/harness/cgroup_limits.sh rename to eval/harness/cgroup_limits.sh diff --git a/bench/demo/harness/common.py b/eval/harness/common.py similarity index 100% rename from bench/demo/harness/common.py rename to eval/harness/common.py diff --git a/bench/demo/harness/compression.py b/eval/harness/compression.py similarity index 100% rename from bench/demo/harness/compression.py rename to eval/harness/compression.py diff --git a/bench/demo/harness/demo_table.py b/eval/harness/demo_table.py similarity index 100% rename from bench/demo/harness/demo_table.py rename to eval/harness/demo_table.py diff --git a/bench/demo/harness/merge_plans.py b/eval/harness/merge_plans.py similarity index 100% rename from bench/demo/harness/merge_plans.py rename to eval/harness/merge_plans.py diff --git a/bench/demo/harness/prepare.py b/eval/harness/prepare.py similarity index 100% rename from bench/demo/harness/prepare.py rename to eval/harness/prepare.py diff --git a/bench/demo/harness/report.py b/eval/harness/report.py similarity index 100% rename from bench/demo/harness/report.py rename to eval/harness/report.py diff --git a/bench/demo/harness/run.py b/eval/harness/run.py similarity index 100% rename from bench/demo/harness/run.py rename to eval/harness/run.py diff --git a/bench/demo/harness/tables.py b/eval/harness/tables.py similarity index 100% rename from bench/demo/harness/tables.py rename to eval/harness/tables.py diff --git a/bench/demo/harness/tables2.py b/eval/harness/tables2.py similarity index 100% rename from bench/demo/harness/tables2.py rename to eval/harness/tables2.py diff --git a/bench/demo/profile/profile_query_phase.sh b/eval/profile/profile_query_phase.sh similarity index 96% rename from bench/demo/profile/profile_query_phase.sh rename to eval/profile/profile_query_phase.sh index 892d44b69..0b72dc33a 100755 --- a/bench/demo/profile/profile_query_phase.sh +++ b/eval/profile/profile_query_phase.sh @@ -11,7 +11,7 @@ # victoriametrics Go pprof from /debug/pprof/profile?seconds=N (top via # `go tool pprof` when Go is installed, else the raw profile # only), and perf record (frame pointers) -> flamegraph -# asap the backend's scripts/profile.sh when $BACKEND_DIR has it +# asap the backend's benchmarks/scripts/profile.sh when $BACKEND_DIR has it # (ASAP_PROFILE_CMD: its command line, with {pid} {seconds} # {out}), else perf record (DWARF call graphs) -> flamegraph # @@ -88,7 +88,7 @@ profile_asap() { local out=$RUN_DIR/asap/profile pid script mkdir -p "$out" pid=$(state asap pids data_plane) - script=${BACKEND_DIR:+$BACKEND_DIR/scripts/profile.sh} + script=${BACKEND_DIR:+$BACKEND_DIR/benchmarks/scripts/profile.sh} if [ -n "$script" ] && [ -x "$script" ]; then local cmd=${ASAP_PROFILE_CMD//\{script\}/$script} cmd=${cmd//\{pid\}/$pid}; cmd=${cmd//\{seconds\}/$SECS}; cmd=${cmd//\{out\}/$out} diff --git a/bench/demo/run_vm_demo.sh b/eval/run_vm_demo.sh similarity index 91% rename from bench/demo/run_vm_demo.sh rename to eval/run_vm_demo.sh index fe3e4fc31..f44ac1b24 100755 --- a/bench/demo/run_vm_demo.sh +++ b/eval/run_vm_demo.sh @@ -9,7 +9,7 @@ # and demo_table.py (the absolute-numbers table, also exported to Grafana). # # Environment (defaults in brackets): -# ASAPQ_BENCH base directory (required) +# ASAPQ_BENCH base directory: this repository's eval/ (required) # BIN_DIR binaries; pinned releases are downloaded here when missing (required) # SERIES series per metric, one run per value, each a multiple of 200 # (4 regions x 5 services x 10 jobs x label_0) ["1000 10000"] @@ -23,10 +23,10 @@ # MONITORING docker | binaries | none [docker when `sudo -n docker` works, else binaries] # PROFILE 1: CPU-profile VM and the data plane in each query phase [0]; PROFILE_SECONDS [60] # BACKEND_DIR ASAPQuery-backend checkout: builds data_plane/control_plane into BIN_DIR when -# missing, and its scripts/profile.sh profiles the data plane [$ASAPQ_BENCH/backend] +# missing, and its benchmarks/scripts/profile.sh profiles the data plane [$ASAPQ_BENCH/backend] # RUN_TAG prefix of run directories [vmdemo] # SCREENSHOTS 1: render the asap-vs-vm dashboard (whole page and every panel) over each run's -# time range into /screenshots (monitoring/screenshot.sh) [0] +# time range into /screenshots (../deployment/monitoring/screenshot.sh) [0] # MODES measurement groups, run and reported apart ["instant range"]: # instant = /api/v1/query at each evaluation time; range = /api/v1/query_range # RANGE range group's STEP_S:SPAN_S[:REFRESH_S], as a Grafana panel [15:3600 = 1h span, @@ -43,7 +43,8 @@ set -euo pipefail [ -n "${BENCH_ENV:-}" ] && [ -f "$BENCH_ENV" ] && source "$BENCH_ENV" export ASAPQ_BENCH=${ASAPQ_BENCH:?set ASAPQ_BENCH} export BIN_DIR=${BIN_DIR:?set BIN_DIR} -mkdir -p "$ASAPQ_BENCH/monitoring/grafana/dashboards" "$ASAPQ_BENCH/monitoring/textfile" +MON=$ASAPQ_BENCH/../deployment/monitoring # this repository's deployment/monitoring +mkdir -p "$MON/grafana/dashboards" "$MON/textfile" BASE=$ASAPQ_BENCH SERIES=${SERIES:-1000 10000} ARM_CORES=${ARM_CORES:-16} @@ -92,19 +93,19 @@ if [[ ",$ARMS," == *",asap,"* ]]; then fi # 2. Monitoring. -python3 "$BASE/monitoring/grafana/make_dashboard.py" >/dev/null +python3 "$MON/grafana/make_dashboard.py" >/dev/null MONITORING=${MONITORING:-} if [ -z "$MONITORING" ]; then if sudo -n docker info >/dev/null 2>&1; then MONITORING=docker; else MONITORING=binaries; fi fi case $MONITORING in - docker) sudo -n -E docker compose -f "$BASE/monitoring/docker-compose.yml" up -d + docker) sudo -n -E docker compose -f "$MON/docker-compose.yml" up -d # Monitoring on the auxiliary cores, off the arms' cpusets. [ -n "$AUX_CPUS" ] && sudo -n docker update --cpuset-cpus "$AUX_CPUS" \ - $(sudo -n docker compose -f "$BASE/monitoring/docker-compose.yml" ps -q) >/dev/null ;; - binaries) "$BASE/monitoring/run_binaries.sh" start + $(sudo -n docker compose -f "$MON/docker-compose.yml" ps -q) >/dev/null ;; + binaries) "$MON/run_binaries.sh" start if [ -n "$AUX_CPUS" ]; then - for f in "${MON_DATA:-$BASE/monitoring/data}"/pids/*; do + for f in "${MON_DATA:-$MON/data}"/pids/*; do taskset -apc "$AUX_CPUS" "$(cat "$f")" >/dev/null 2>&1 || sudo -n taskset -apc "$AUX_CPUS" "$(cat "$f")" >/dev/null 2>&1 || true done fi ;; @@ -153,7 +154,7 @@ for w in $WORKLOADS; do python3 compression.py "$R" "${VICTORIAMETRICS_BIN:-$BIN_DIR/victoria-metrics-${VICTORIAMETRICS_VERSION:-v1.156.0}}" \ > "$R.compression.txt" 2>&1 || log "compression.py failed: see $R.compression.txt" python3 report.py --prep "$P" --run "$R" > "$R.summary.txt" 2>&1 || log "report.py failed: see $R.summary.txt" - python3 demo_table.py --prep "$P" --run "$R" --textfile-dir "$BASE/monitoring/textfile" \ + python3 demo_table.py --prep "$P" --run "$R" --textfile-dir "$MON/textfile" \ | tee "$R.demo_table.txt" || true # Disk limits (run.py: each engine's data dir is its own loop-mounted filesystem of the # planner's disk limit): unmount them now that the reference and reports are done; the @@ -161,7 +162,7 @@ for w in $WORKLOADS; do for m in $(findmnt -rn -o TARGET | grep "^$R/" || true); do sudo -n umount "$m" || log "umount $m failed"; done if [ "${SCREENSHOTS:-0}" = 1 ] && [ "$MONITORING" != none ]; then # Every panel of the dashboard (and the whole page) over this run's time range. - AUX_CPUS=$AUX_CPUS "$BASE/monitoring/screenshot.sh" asap-vs-vm "$run_from_ms" "$(( $(date +%s) * 1000 ))" \ + AUX_CPUS=$AUX_CPUS "$MON/screenshot.sh" asap-vs-vm "$run_from_ms" "$(( $(date +%s) * 1000 ))" \ "$R/screenshots" "run=$(basename "$R")" > "$R.screenshots.log" 2>&1 || log "screenshots failed: see $R.screenshots.log" fi log "done $w ($MODE): $R" diff --git a/bench/demo/workloads/asap-demo-complex-full.json b/eval/workloads/asap-demo-complex-full.json similarity index 100% rename from bench/demo/workloads/asap-demo-complex-full.json rename to eval/workloads/asap-demo-complex-full.json diff --git a/bench/demo/workloads/asap-demo-complex.json b/eval/workloads/asap-demo-complex.json similarity index 100% rename from bench/demo/workloads/asap-demo-complex.json rename to eval/workloads/asap-demo-complex.json diff --git a/bench/demo/workloads/asap-demo.json b/eval/workloads/asap-demo.json similarity index 100% rename from bench/demo/workloads/asap-demo.json rename to eval/workloads/asap-demo.json diff --git a/bench/demo/workloads/dashboard-heavy-short.json b/eval/workloads/dashboard-heavy-short.json similarity index 100% rename from bench/demo/workloads/dashboard-heavy-short.json rename to eval/workloads/dashboard-heavy-short.json diff --git a/bench/demo/workloads/dashboard-heavy.json b/eval/workloads/dashboard-heavy.json similarity index 100% rename from bench/demo/workloads/dashboard-heavy.json rename to eval/workloads/dashboard-heavy.json diff --git a/bench/demo/workloads/dashboard-live-short.json b/eval/workloads/dashboard-live-short.json similarity index 100% rename from bench/demo/workloads/dashboard-live-short.json rename to eval/workloads/dashboard-live-short.json diff --git a/bench/demo/workloads/dashboard-live.json b/eval/workloads/dashboard-live.json similarity index 100% rename from bench/demo/workloads/dashboard-live.json rename to eval/workloads/dashboard-live.json diff --git a/bench/demo/workloads/demo48.json b/eval/workloads/demo48.json similarity index 100% rename from bench/demo/workloads/demo48.json rename to eval/workloads/demo48.json diff --git a/bench/demo/workloads/seed862-base-joint.json b/eval/workloads/seed862-base-joint.json similarity index 100% rename from bench/demo/workloads/seed862-base-joint.json rename to eval/workloads/seed862-base-joint.json diff --git a/bench/demo/workloads/seed862-long-joint.json b/eval/workloads/seed862-long-joint.json similarity index 100% rename from bench/demo/workloads/seed862-long-joint.json rename to eval/workloads/seed862-long-joint.json diff --git a/bench/demo/workloads/smoke.json b/eval/workloads/smoke.json similarity index 100% rename from bench/demo/workloads/smoke.json rename to eval/workloads/smoke.json diff --git a/bench/demo/workloads/typical-dashboard-10hz.json b/eval/workloads/typical-dashboard-10hz.json similarity index 100% rename from bench/demo/workloads/typical-dashboard-10hz.json rename to eval/workloads/typical-dashboard-10hz.json diff --git a/bench/demo/workloads/typical-dashboard-60s-10hz.json b/eval/workloads/typical-dashboard-60s-10hz.json similarity index 100% rename from bench/demo/workloads/typical-dashboard-60s-10hz.json rename to eval/workloads/typical-dashboard-60s-10hz.json diff --git a/bench/demo/workloads/typical-dashboard-60s.json b/eval/workloads/typical-dashboard-60s.json similarity index 100% rename from bench/demo/workloads/typical-dashboard-60s.json rename to eval/workloads/typical-dashboard-60s.json diff --git a/bench/demo/workloads/typical-dashboard.json b/eval/workloads/typical-dashboard.json similarity index 100% rename from bench/demo/workloads/typical-dashboard.json rename to eval/workloads/typical-dashboard.json diff --git a/bench/demo/workloads/zipf-resets.json b/eval/workloads/zipf-resets.json similarity index 100% rename from bench/demo/workloads/zipf-resets.json rename to eval/workloads/zipf-resets.json