From 283b83f5c64f321703e420225a3b6fbd2196e04a Mon Sep 17 00:00:00 2001 From: zzylol Date: Thu, 26 Nov 2026 18:21:59 +0000 Subject: [PATCH 1/2] refactor: eval/scripts and eval/baselines, deployment Dockerfile and compose (layout step 9) Move the eval entry points (run_vm_demo.sh, fetch_binaries.sh, build.sh, profile_query_phase.sh) into eval/scripts/ and update every reference. Add pinned ClickHouse and Elasticsearch compose files under eval/baselines/, a Baselines section in eval/README.md, and deployment/Dockerfile (control_plane + data_plane, multi-stage, pinned bases) with a compose file that plans a workload and serves the plan. --- .gitignore | 2 - README.md | 9 +++- deployment/Dockerfile | 34 ++++++++++++ deployment/Dockerfile.dockerignore | 9 ++++ deployment/docker-compose.yml | 37 +++++++++++++ deployment/monitoring/.gitignore | 2 +- .../monitoring/grafana/make_dashboard.py | 2 +- deployment/monitoring/run_binaries.sh | 4 +- eval/README.md | 52 +++++++++++++++---- eval/baselines/clickhouse/docker-compose.yml | 29 +++++++++++ .../elasticsearch/docker-compose.yml | 28 ++++++++++ eval/campaign/demo_job.sh | 4 +- eval/campaign/diag_job.sh | 4 +- eval/campaign/final_run.sh | 4 +- eval/campaign/launch.sh | 4 +- eval/campaign/r2_reference_watcher.sh | 2 +- eval/campaign/rerun_job.sh | 4 +- eval/campaign/scale_job.sh | 4 +- eval/harness/README.md | 8 +-- eval/harness/common.py | 2 +- eval/harness/run.py | 2 +- eval/{ => scripts}/build.sh | 0 eval/{ => scripts}/fetch_binaries.sh | 4 +- .../profile_query_phase.sh | 4 +- eval/{ => scripts}/run_vm_demo.sh | 6 +-- 25 files changed, 216 insertions(+), 44 deletions(-) create mode 100644 deployment/Dockerfile create mode 100644 deployment/Dockerfile.dockerignore create mode 100644 deployment/docker-compose.yml create mode 100644 eval/baselines/clickhouse/docker-compose.yml create mode 100644 eval/baselines/elasticsearch/docker-compose.yml rename eval/{ => scripts}/build.sh (100%) rename eval/{ => scripts}/fetch_binaries.sh (94%) rename eval/{profile => scripts}/profile_query_phase.sh (96%) rename eval/{ => scripts}/run_vm_demo.sh (98%) diff --git a/.gitignore b/.gitignore index 074f49056..445612ab8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ target/ __pycache__/ .claude/ -# Evaluation results are never committed (docs/design/repo-layout.md). -eval/results/ diff --git a/README.md b/README.md index c139f74ad..ddb612f99 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,11 @@ cargo run -p control_plane -- \ cargo run -p data_plane -- --plan plan.json --prometheus-url http://localhost:9090 ``` +`deployment/Dockerfile` builds both binaries into one image +(`docker build -f deployment/Dockerfile -t asap-backend .` from the +repository root), and `deployment/docker-compose.yml` plans a workload +(`WORKLOAD`, Example 1 by default) and serves the plan on port 8088. + Besides Prometheus Remote Write, the data plane ingests VictoriaMetrics Remote Write (the same protobuf, zstd-compressed) on `/api/v1/import` and OTLP/HTTP metrics (protobuf, optionally gzip) on `/v1/metrics`, the routes @@ -262,8 +267,8 @@ not stored) with a Prometheus `execution` error (422, | `crates/adapters/query/elastic-http/` | package `elastic_http`: `_sql` and `_search` bodies and the fallback client of an Elasticsearch server, `POST /_sql`, `POST /_search` | | `crates/adapters/query/prometheus-http/` | package `prometheus_http`: query parameters, response bodies and the fallback client of a Prometheus-compatible server | | `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 | +| `eval/` | comparisons with other systems (`baselines/`, `harness/`, `scripts/`, `workloads/`) and the live demo; see [eval/README.md](eval/README.md) | +| `deployment/` | the backend's Docker image (`Dockerfile`) and Compose file; `monitoring/`: Prometheus, exporters and Grafana for the demo and the comparisons | | `docs/` | design documents and `examples/` workloads | | `scripts/` | CI and the Planner dependency updater | diff --git a/deployment/Dockerfile b/deployment/Dockerfile new file mode 100644 index 000000000..69763447b --- /dev/null +++ b/deployment/Dockerfile @@ -0,0 +1,34 @@ +# syntax=docker/dockerfile:1 +# The backend's binaries in one image: control_plane (workload -> plan file) +# and data_plane (serves a plan: ingestion and query routes). Build from the +# repository root: +# +# docker build -f deployment/Dockerfile -t asap-backend . +# docker run --rm asap-backend data_plane --help +# +# deployment/docker-compose.yml plans a workload and serves the plan. +FROM rust:1.99.0-slim-bookworm AS build +# git: Cargo fetches the pinned git dependencies with the git CLI (.cargo/config.toml). +RUN apt-get update \ + && apt-get install -y --no-install-recommends git ca-certificates \ + && rm -rf /var/lib/apt/lists/* +WORKDIR /src +COPY . . +RUN --mount=type=cache,target=/usr/local/cargo/registry \ + --mount=type=cache,target=/usr/local/cargo/git \ + --mount=type=cache,target=/src/target \ + cargo build --release --locked -p control_plane -p data_plane \ + && install -m 0755 target/release/control_plane target/release/data_plane /usr/local/bin/ + +FROM debian:bookworm-20261104-slim +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates \ + && rm -rf /var/lib/apt/lists/* \ + && useradd --system --uid 10001 --home-dir /data asap \ + && mkdir /data && chown asap /data +COPY --from=build /usr/local/bin/control_plane /usr/local/bin/data_plane /usr/local/bin/ +USER asap +# data_plane writes its views (--view-dir, default asap-views) under the working directory. +WORKDIR /data +EXPOSE 8088 +CMD ["data_plane", "--help"] diff --git a/deployment/Dockerfile.dockerignore b/deployment/Dockerfile.dockerignore new file mode 100644 index 000000000..e5d9fcc0b --- /dev/null +++ b/deployment/Dockerfile.dockerignore @@ -0,0 +1,9 @@ +# Build context for deployment/Dockerfile (the repository root): only what +# `cargo build` needs. BuildKit reads this file because it sits next to the +# Dockerfile. +**/target +.git +.worktrees +eval +deployment +docs diff --git a/deployment/docker-compose.yml b/deployment/docker-compose.yml new file mode 100644 index 000000000..1d9d21440 --- /dev/null +++ b/deployment/docker-compose.yml @@ -0,0 +1,37 @@ +# Plan a workload once with control_plane, then serve the plan with +# data_plane on port 8088 (Remote Write on /api/v1/write, the Prometheus +# query API on /api/v1/query[_range]). Run from this directory: +# +# docker compose up --build +# WORKLOAD=/path/to/workload.json PROMETHEUS_URL=http://prometheus:9090 docker compose up +# docker compose down -v +# +# WORKLOAD defaults to the planner-layering Example 1 in docs/examples. +# PROMETHEUS_URL answers the queries the plan does not; the default is a +# Prometheus on the Docker host. +services: + plan: + build: + context: .. + dockerfile: deployment/Dockerfile + image: asap-backend + command: ["control_plane", "--workload", "/workload.json", "--out", "/data/plan.json", "--report", "/data/report.json"] + volumes: + - ${WORKLOAD:-../docs/examples/planner-layering-example1.json}:/workload.json:ro + - data:/data + + data-plane: + image: asap-backend + depends_on: + plan: + condition: service_completed_successfully + command: ["data_plane", "--plan", "/data/plan.json", "--listen", "0.0.0.0:8088", "--prometheus-url", "${PROMETHEUS_URL:-http://host.docker.internal:9090}"] + ports: + - "${DATA_PLANE_PORT:-8088}:8088" + extra_hosts: + - "host.docker.internal:host-gateway" + volumes: + - data:/data + +volumes: + data: diff --git a/deployment/monitoring/.gitignore b/deployment/monitoring/.gitignore index a4a83430c..6180db40d 100644 --- a/deployment/monitoring/.gitignore +++ b/deployment/monitoring/.gitignore @@ -1,3 +1,3 @@ -# What the monitoring stack writes (eval/run_vm_demo.sh, eval/demo/run_live_demo.sh). +# What the monitoring stack writes (eval/scripts/run_vm_demo.sh, eval/demo/run_live_demo.sh). /textfile/ /grafana/dashboards/ diff --git a/deployment/monitoring/grafana/make_dashboard.py b/deployment/monitoring/grafana/make_dashboard.py index dbdeaa6c9..e006eb75b 100644 --- a/deployment/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). " - "eval/profile/profile_query_phase.sh gives the function-level CPU profile.", + "eval/scripts/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/deployment/monitoring/run_binaries.sh b/deployment/monitoring/run_binaries.sh index da490e41c..a814dc01d 100755 --- a/deployment/monitoring/run_binaries.sh +++ b/deployment/monitoring/run_binaries.sh @@ -1,7 +1,7 @@ #!/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 -# eval/fetch_binaries.sh when missing). State lives in $MON_DATA. +# eval/scripts/fetch_binaries.sh when missing). State lives in $MON_DATA. # # deployment/monitoring/run_binaries.sh start|stop|status # @@ -28,7 +28,7 @@ start_one() { # name, command... case "${1:-start}" in start) - BIN_DIR=$BIN_DIR "$BASE/fetch_binaries.sh" prometheus node_exporter process_exporter grafana + BIN_DIR=$BIN_DIR "$BASE/scripts/fetch_binaries.sh" prometheus node_exporter process_exporter grafana start_one prometheus "$BIN_DIR/prometheus-3.5.0" --config.file="$MON/prometheus/prometheus.yml" \ --storage.tsdb.path="$MON_DATA/prometheus" --storage.tsdb.retention.time=30d \ --web.listen-address=127.0.0.1:19090 diff --git a/eval/README.md b/eval/README.md index c515ca887..fb8c7f4e9 100644 --- a/eval/README.md +++ b/eval/README.md @@ -3,20 +3,22 @@ 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 (`results/` is git-ignored). Paths below are relative +outputs are kept here (`.gitignore` lists where runs write: `prep/`, `runs/`, +`report_demo/`, `logs/`). Paths below are relative to this directory, `$ASAPQ_BENCH`. | Path | What it holds | |---|---| | `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`. | +| `scripts/run_vm_demo.sh` | The batch comparison: prepare, run the arms one after another on one feed, report. | +| `scripts/fetch_binaries.sh`, `scripts/build.sh` | Pinned third-party binaries (sha256-checked); builds of the paced feeder and this repository into `$BIN_DIR`. | +| `scripts/profile_query_phase.sh` | CPU profiles of each arm's query phase (`scripts/run_vm_demo.sh` with `PROFILE=1`). | +| `baselines/` | Compared systems that run as their own service (`baselines//docker-compose.yml`); see [Baselines](#baselines). | | `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`. | | `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). | +| `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; `scripts/build.sh` applies it). | `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 @@ -34,8 +36,8 @@ export BIN_DIR=/path/to/bin # pinned binaries and the built feeder/da 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 -./build.sh # paced_feeder, data_plane, control_plane into $BIN_DIR +scripts/fetch_binaries.sh # VictoriaMetrics, Prometheus, exporters, Grafana, FlameGraph +scripts/build.sh # paced_feeder, data_plane, control_plane into $BIN_DIR ``` | Variable | Used by | Meaning | @@ -43,12 +45,12 @@ cd "$ASAPQ_BENCH" | `ASAPQ_BENCH` | all | the working directory above (required) | | `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) | +| `ASAP_PLANNER_DIR` | `scripts/build.sh`, `harness/prepare.py` | an ASAPPlanner checkout (optional for `scripts/build.sh`; `prepare.py` checks Planner features by commit) | | `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 `demo/run_live_demo.sh` and `run_vm_demo.sh` list every other +The headers of `demo/run_live_demo.sh` and `scripts/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. @@ -76,7 +78,7 @@ here); without it they stay empty. ## Comparison ```sh -SERIES=1000 QUERY_PHASE_S=600 WORKLOADS="demo/dashboard-heavy" ./run_vm_demo.sh +SERIES=1000 QUERY_PHASE_S=600 WORKLOADS="demo/dashboard-heavy" scripts/run_vm_demo.sh ``` For each workload this prepares the plan (timed as a one-time offline @@ -86,3 +88,33 @@ on the same feed and query schedule, each on its own cpuset, and writes memory, disk, latency and accuracy; Grafana's `asap-vs-vm` dashboard (`../deployment/monitoring/grafana/make_dashboard.py`) shows the runs. `harness/README.md` describes the arms, flags and outputs. + +## Baselines + +The systems the backend is compared with. "Harness arm" means +`harness/run.py --arms` starts, feeds and queries it; the other systems run +as their own service and are, for now, only what the backend's routes forward +to. No results are kept here. + +| System | Version | How it runs | Harness arm | +|---|---|---|---| +| Prometheus | 3.5.0 | binary from `scripts/fetch_binaries.sh`, flags in `harness/run.py` | `prometheus` (the exact reference), and beside `backend` and `asapquery` | +| VictoriaMetrics single-node | v1.156.0 | binary from `scripts/fetch_binaries.sh`, flags in `harness/run.py` (`VM_SEARCH_FLAGS`) | `victoriametrics`; also the reference of `demo/run_live_demo.sh` | +| VictoriaMetrics cluster | v1.156.0 | `vmstorage`, `vmselect`, `vminsert` installed by hand as `$BIN_DIR/-` (not fetched) | `vmcluster` | +| ASAPQuery query engine | the ASAPQuery checkout | `ASAPQUERY_ENGINE=1 scripts/build.sh` | `asapquery` | +| ClickHouse | 25.8.33.6 | `docker compose -f baselines/clickhouse/docker-compose.yml up -d`, then `data_plane --clickhouse-url http://localhost:8123` | none yet | +| Elasticsearch | 9.5.3 | `docker compose -f baselines/elasticsearch/docker-compose.yml up -d`, then `data_plane --elastic-url http://localhost:9200` | none yet | + +Not ported yet: + +- ClickHouse and Elasticsearch arms in `harness/run.py`: loading the same + data into their tables or indexes, and SQL or Query DSL workloads. The + backend forwards every SQL and Query DSL query today (no planned SQL + answers), so such an arm would measure the forward path only. +- ASAPQuery's ClickHouse experiment runner and data loaders + (`asap-tools/experiments/experiment_run_clickhouse.py`, ClickBench and H2O + loads) and its Elasticsearch benchmarking scripts + (`asap-tools/execution-utilities/elastic-asap-benchmarking/`): they are + tied to ASAPQuery's experiment framework and query engine. +- PilotDB-style sampling baselines: ASAPQuery has no infrastructure for them + to port. diff --git a/eval/baselines/clickhouse/docker-compose.yml b/eval/baselines/clickhouse/docker-compose.yml new file mode 100644 index 000000000..e6340fe10 --- /dev/null +++ b/eval/baselines/clickhouse/docker-compose.yml @@ -0,0 +1,29 @@ +# ClickHouse single server, the system the backend's ClickHouse route +# (`data_plane --clickhouse-url http://localhost:8123`) forwards to and is +# compared with. Ported from ASAPQuery's experiment service template, with the +# image pinned. It listens on localhost only and keeps its data in a named +# volume (`down -v` removes it). +# +# docker compose -f eval/baselines/clickhouse/docker-compose.yml up -d +# curl 'http://localhost:8123/?query=SELECT%20version()' +# docker compose -f eval/baselines/clickhouse/docker-compose.yml down -v +services: + clickhouse: + image: clickhouse/clickhouse-server:25.8.33.6 + ports: + - "127.0.0.1:${CLICKHOUSE_HTTP_PORT:-8123}:8123" + volumes: + - clickhouse-data:/var/lib/clickhouse + environment: + - CLICKHOUSE_DB=default + - CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 + # Naive datetime literals in SQL parse the same here as in the backend. + - TZ=UTC + ulimits: + nofile: + soft: 262144 + hard: 262144 + restart: "no" + +volumes: + clickhouse-data: diff --git a/eval/baselines/elasticsearch/docker-compose.yml b/eval/baselines/elasticsearch/docker-compose.yml new file mode 100644 index 000000000..81b2a08f0 --- /dev/null +++ b/eval/baselines/elasticsearch/docker-compose.yml @@ -0,0 +1,28 @@ +# Elasticsearch single node, the system the backend's Elasticsearch routes +# (`data_plane --elastic-url http://localhost:9200`) forward to and are +# compared with. Security is off: it listens on localhost for experiments +# only. Data stays in a named volume (`down -v` removes it); ELASTIC_HEAP +# sets the JVM heap (default 1g). +# +# docker compose -f eval/baselines/elasticsearch/docker-compose.yml up -d +# curl http://localhost:9200 +# docker compose -f eval/baselines/elasticsearch/docker-compose.yml down -v +services: + elasticsearch: + image: elasticsearch:9.5.3 + ports: + - "127.0.0.1:${ELASTIC_HTTP_PORT:-9200}:9200" + volumes: + - elasticsearch-data:/usr/share/elasticsearch/data + environment: + - discovery.type=single-node + - xpack.security.enabled=false + - ES_JAVA_OPTS=-Xms${ELASTIC_HEAP:-1g} -Xmx${ELASTIC_HEAP:-1g} + ulimits: + nofile: + soft: 65536 + hard: 65536 + restart: "no" + +volumes: + elasticsearch-data: diff --git a/eval/campaign/demo_job.sh b/eval/campaign/demo_job.sh index 1b5620f10..5eb763f0d 100755 --- a/eval/campaign/demo_job.sh +++ b/eval/campaign/demo_job.sh @@ -33,12 +33,12 @@ rm -rf "$B"/runs/$tag.* meta=$B/runs/$tag.meta { echo "tag=$tag driver=$(hostname) engine=$ENGINE_SSH ($ENGINE_ADDR) backend_commit=$(cat $BIN_DIR/BACKEND_COMMIT) start=$(date -u +%FT%TZ)" env | grep -E '^(SERIES|QUERY_[A-Z_]*|QUERIES_FROM_START|ENGINE_LIMITS|ENGINE_ADDR|ARM_CPUS|ARMS|VM_MAX_QUERY_DURATION|PRECOMPUTE_THREADS|FEEDER_[A-Z_]*|ZIPF_[A-Z]*|ANSWER_RESULTS_EVERY|KEEP_VM_DATA|CONCURRENT|MODES|WORKLOADS|DATA_PLANE_EXTRA_ARGS|NET_IFACE|VICTORIAMETRICS_VERSION)=' | sort - echo "harness_sha256_16=$(cd $B && cat harness/*.py run_vm_demo.sh fetch_binaries.sh | sha256sum | cut -c1-16)" + echo "harness_sha256_16=$(cd $B && cat harness/*.py scripts/run_vm_demo.sh scripts/fetch_binaries.sh | sha256sum | cut -c1-16)" echo "victoria-metrics: $($BIN_DIR/victoria-metrics-$VICTORIAMETRICS_VERSION -version 2>&1 | head -1)" sha256sum $BIN_DIR/data_plane $BIN_DIR/control_plane $BIN_DIR/victoria-metrics-$VICTORIAMETRICS_VERSION $FEEDER_BIN echo "engine host: $(ssh $ENGINE_SSH_OPTS $ENGINE_SSH 'hostname; lscpu | grep "Model name"; lsblk -d -o NAME,ROTA,MODEL | tr "\n" " "; df -h / | tail -1')" } > "$meta" -(cd $B && ./run_vm_demo.sh) > "$B/runs/$tag.campaign.log" 2>&1 +(cd $B && ./scripts/run_vm_demo.sh) > "$B/runs/$tag.campaign.log" 2>&1 rc=$? echo "end=$(date -u +%FT%TZ) rc=$rc" >> "$meta" grep -q VM_DEMO_DONE "$B/runs/$tag.campaign.log" || exit 1 diff --git a/eval/campaign/diag_job.sh b/eval/campaign/diag_job.sh index 4fb237cb9..c28db5143 100755 --- a/eval/campaign/diag_job.sh +++ b/eval/campaign/diag_job.sh @@ -21,9 +21,9 @@ rm -rf "$B"/runs/$RUN_TAG.* meta=$B/runs/$RUN_TAG.meta { echo "diag tag=$tag host=$(hostname) backend_commit=$(cat $BIN_DIR/BACKEND_COMMIT) start=$(date -u +%FT%TZ)" env | grep -E "^(SERIES|MODES|WORKLOADS|ARMS|CONCURRENT|QUERY_DELAY_S|QUERY_USERS|QUERY_PHASE_S|ENGINE_LIMITS|DATA_PLANE_EXTRA_ARGS|PRECOMPUTE_THREADS|FEEDER_VALUES|ZIPF_S|ZIPF_N|FEEDER_BIN|ARM_CORES|KEEP_VM_DATA)=" | sort - echo "harness_sha256_16=$(cd $B && cat harness/*.py run_vm_demo.sh fetch_binaries.sh | sha256sum | cut -c1-16)" + echo "harness_sha256_16=$(cd $B && cat harness/*.py scripts/run_vm_demo.sh scripts/fetch_binaries.sh | sha256sum | cut -c1-16)" sha256sum $BIN_DIR/data_plane $BIN_DIR/control_plane $FEEDER_BIN; } > "$meta" -(cd $B && ./run_vm_demo.sh) > "$B/runs/$RUN_TAG.campaign.log" 2>&1 +(cd $B && ./scripts/run_vm_demo.sh) > "$B/runs/$RUN_TAG.campaign.log" 2>&1 for d in "$B"/runs/$RUN_TAG.*/; do [ -d "$d" ] || continue p=$B/prep/$(basename "$d" | sed "s/^$RUN_TAG\.//") diff --git a/eval/campaign/final_run.sh b/eval/campaign/final_run.sh index dc9b576f0..af7c0bcb4 100755 --- a/eval/campaign/final_run.sh +++ b/eval/campaign/final_run.sh @@ -23,10 +23,10 @@ grep -v '^#' "$jobs" | grep . | while IFS='|' read -r cfg round series modes ran meta=$B/runs/$RUN_TAG.meta { echo "cfg=$cfg round=$round host=$(hostname) backend_commit=$(cat $BIN_DIR/BACKEND_COMMIT) start=$(date -u +%FT%TZ)" echo "SERIES=$SERIES MODES=$MODES RANGE=${RANGE:-} WORKLOADS=$WORKLOADS ARMS=$ARMS CONCURRENT=$CONCURRENT QUERY_DELAY_S=$QUERY_DELAY_S KEEP_VM_DATA=$KEEP_VM_DATA ARM_CORES=$ARM_CORES QUERY_PHASE_S=$QUERY_PHASE_S" - echo "harness_sha256_16=$(cd $B && cat harness/*.py run_vm_demo.sh fetch_binaries.sh | sha256sum | cut -c1-16)" + echo "harness_sha256_16=$(cd $B && cat harness/*.py scripts/run_vm_demo.sh scripts/fetch_binaries.sh | sha256sum | cut -c1-16)" echo "victoriametrics: $("$vm" -version 2>&1 | head -1)" sha256sum $BIN_DIR/data_plane $BIN_DIR/control_plane "$vm"; } > "$meta" - (cd $B && ./run_vm_demo.sh) > "$B/runs/$RUN_TAG.campaign.log" 2>&1 + (cd $B && ./scripts/run_vm_demo.sh) > "$B/runs/$RUN_TAG.campaign.log" 2>&1 for d in "$B"/runs/$RUN_TAG.*/; do [ -d "$d" ] && (cd $B && BIN_DIR=$BIN_DIR report_demo/collect_meta.sh "$d/host_meta.json" >/dev/null) && \ python3 -c "import json,sys; p=sys.argv[1]; m=json.load(open(p)); m['victoriametrics_version']=sys.argv[2]; json.dump(m,open(p,'w'),indent=1)" \ diff --git a/eval/campaign/launch.sh b/eval/campaign/launch.sh index 481c27943..abfd31ad7 100755 --- a/eval/campaign/launch.sh +++ b/eval/campaign/launch.sh @@ -14,8 +14,8 @@ cd $ASAPQ_BENCH export RUN_TAG=camp1120-$cfg ARM_CORES=${ARM_CORES:-12} CONCURRENT=1 QUERY_PHASE_S=600 MONITORING=none PROFILE=0 { echo "cfg=$cfg host=$(hostname) backend_commit=$(cat $BIN_DIR/BACKEND_COMMIT) start=$(date -u +%FT%TZ)"; echo "SERIES=$SERIES MODES=$MODES WORKLOADS=$WORKLOADS RANGE=${RANGE:-} ARM_CORES=$ARM_CORES ARMS=$ARMS CONCURRENT=1 QUERY_PHASE_S=600 ASAP_PERSIST_FLAG=${ASAP_PERSIST_FLAG:-default} QUERY_DELAY_S=${QUERY_DELAY_S:-3}"; - echo "harness_sha256_16=$(cat harness/*.py run_vm_demo.sh fetch_binaries.sh | sha256sum | cut -c1-16)"; + echo "harness_sha256_16=$(cat harness/*.py scripts/run_vm_demo.sh scripts/fetch_binaries.sh | sha256sum | cut -c1-16)"; echo "victoriametrics: $("$vm" -version 2>&1 | head -1)"; sha256sum $BIN_DIR/data_plane $BIN_DIR/control_plane "$vm"; } > $CAMPAIGN_DIR/$cfg.meta -nohup setsid ./run_vm_demo.sh > $CAMPAIGN_DIR/$cfg.log 2>&1 < /dev/null & +nohup setsid ./scripts/run_vm_demo.sh > $CAMPAIGN_DIR/$cfg.log 2>&1 < /dev/null & echo "launched $cfg pid $!" diff --git a/eval/campaign/r2_reference_watcher.sh b/eval/campaign/r2_reference_watcher.sh index 9d5bfc655..1e1295da2 100755 --- a/eval/campaign/r2_reference_watcher.sh +++ b/eval/campaign/r2_reference_watcher.sh @@ -23,7 +23,7 @@ log "replay done: $($SSH $REF_HOST "tr '\n' ' ' < $BENCH_ROOT/replay/replay-$sta rm -rf $BENCH_ROOT/replay-ref-$start; mkdir -p $BENCH_ROOT/replay-ref-$start $SSH $REF_HOST "tar -C $BENCH_ROOT/replay -cf - vm-data-$start" | tar -C $BENCH_ROOT/replay-ref-$start -xf - log "copied: $(du -sh $BENCH_ROOT/replay-ref-$start/vm-data-$start | cut -f1)" -until grep -q "^end=" $ASAPQ_BENCH/runs/$TAG.meta 2>/dev/null && ! pgrep -f "^/bin/bash ./run_vm_demo.sh" >/dev/null; do sleep 60; done +until grep -q "^end=" $ASAPQ_BENCH/runs/$TAG.meta 2>/dev/null && ! pgrep -f "^/bin/bash ./scripts/run_vm_demo.sh" >/dev/null; do sleep 60; done log "run and post-run ended; re-scoring against the replay" cd $CAMPAIGN_DIR && REF_START=$start REF_DIR=$BENCH_ROOT/replay-ref-$start/vm-data-$start ./redo_accuracy.sh $TAG > redo-r2.out 2>&1 log "re-scoring done" diff --git a/eval/campaign/rerun_job.sh b/eval/campaign/rerun_job.sh index e1ccc02d5..1bfc312f8 100755 --- a/eval/campaign/rerun_job.sh +++ b/eval/campaign/rerun_job.sh @@ -33,10 +33,10 @@ rm -rf "$B"/runs/$RUN_TAG.* "$B"/runs/$RUN_TAG.done meta=$B/runs/$RUN_TAG.meta { echo "cfg=$cfg round=$round host=$(hostname) backend_commit=$(cat $BIN_DIR/BACKEND_COMMIT) start=$(date -u +%FT%TZ)" echo "SERIES=$SERIES MODES=$MODES RANGE=${RANGE:-} WORKLOADS=$WORKLOADS ARMS=$ARMS CONCURRENT=$CONCURRENT QUERY_DELAY_S=$QUERY_DELAY_S KEEP_VM_DATA=$KEEP_VM_DATA ARM_CORES=$ARM_CORES QUERY_PHASE_S=$QUERY_PHASE_S QUERY_USERS=${QUERY_USERS:-} PLANNER_COST_INPUTS=${PLANNER_COST_INPUTS:-} PRECOMPUTE_THREADS=$PRECOMPUTE_THREADS FEEDER_VALUES=${FEEDER_VALUES:-original} ZIPF_S=$ZIPF_S ZIPF_N=$ZIPF_N FEEDER_BIN=${FEEDER_BIN:-}" - echo "harness_sha256_16=$(cd $B && cat harness/*.py run_vm_demo.sh fetch_binaries.sh | sha256sum | cut -c1-16)" + echo "harness_sha256_16=$(cd $B && cat harness/*.py scripts/run_vm_demo.sh scripts/fetch_binaries.sh | sha256sum | cut -c1-16)" echo "victoriametrics: $("$vm" -version 2>&1 | head -1)" sha256sum $BIN_DIR/data_plane $BIN_DIR/control_plane "$vm"; } > "$meta" -(cd $B && ./run_vm_demo.sh) > "$B/runs/$RUN_TAG.campaign.log" 2>&1 +(cd $B && ./scripts/run_vm_demo.sh) > "$B/runs/$RUN_TAG.campaign.log" 2>&1 rc=$? for d in "$B"/runs/$RUN_TAG.*/; do [ -d "$d" ] || continue diff --git a/eval/campaign/scale_job.sh b/eval/campaign/scale_job.sh index 6a9724988..895f8b047 100755 --- a/eval/campaign/scale_job.sh +++ b/eval/campaign/scale_job.sh @@ -40,12 +40,12 @@ meta=$B/runs/$tag.meta { echo "tag=$tag step=$step driver=$(hostname) engine=$ENGINE_SSH ($ENGINE_ADDR) backend_commit=$(cat $BIN_DIR/BACKEND_COMMIT) start=$(date -u +%FT%TZ)" env | grep -E '^(SERIES|QUERY_|ENGINE_LIMITS|ENGINE_ADDR|VMCLUSTER_LAYOUT|ARM_CPUS|ARMS|VM_MAX_QUERY_DURATION|PRECOMPUTE_THREADS|FEEDER_|ZIPF_|KEEP_VM_DATA|CONCURRENT|MODES|WORKLOADS|DATA_PLANE_EXTRA_ARGS|NET_IFACE|VICTORIAMETRICS_VERSION)=' | sort echo "vm_flags: single-node and vmselect -search.maxQueryDuration=$VM_MAX_QUERY_DURATION -search.latencyOffset=${QUERY_DELAY_S}s; concurrency limits default; client timeout ${QUERY_TIMEOUT_S}s" - echo "harness_sha256_16=$(cd $B && cat harness/*.py run_vm_demo.sh fetch_binaries.sh | sha256sum | cut -c1-16)" + echo "harness_sha256_16=$(cd $B && cat harness/*.py scripts/run_vm_demo.sh scripts/fetch_binaries.sh | sha256sum | cut -c1-16)" for c in victoria-metrics vmstorage vmselect vminsert; do echo "$c: $($BIN_DIR/$c-$VICTORIAMETRICS_VERSION -version 2>&1 | head -1)"; done sha256sum $BIN_DIR/data_plane $BIN_DIR/control_plane $BIN_DIR/*-v1.156.0 $FEEDER_BIN echo "engine host: $(ssh $ENGINE_SSH_OPTS $ENGINE_SSH 'hostname; lscpu | grep "Model name"; lsblk -d -o NAME,ROTA,MODEL | tr "\n" " "; df -h / | tail -1')" } > "$meta" -(cd $B && ./run_vm_demo.sh) > "$B/runs/$tag.campaign.log" 2>&1 +(cd $B && ./scripts/run_vm_demo.sh) > "$B/runs/$tag.campaign.log" 2>&1 rc=$? echo "end=$(date -u +%FT%TZ) rc=$rc" >> "$meta" grep -q VM_DEMO_DONE "$B/runs/$tag.campaign.log" || exit 1 diff --git a/eval/harness/README.md b/eval/harness/README.md index aa04c6335..7ed03a61b 100644 --- a/eval/harness/README.md +++ b/eval/harness/README.md @@ -20,7 +20,7 @@ sink, real time (1 s of event time per second). `--label0` scales the series cou ```sh export CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-target} -../build.sh # feeder, engine, backend, converter +../scripts/build.sh # feeder, engine, backend, converter python3 prepare.py --set seed-862 --workload workload-01 --label0 5 \ --out ../prep/seed-862.workload-01.s1000 # 4*5*10*5 = 1,000 series python3 run.py --prep ../prep/seed-862.workload-01.s1000 --out ../runs/w01 --rounds 3 @@ -63,7 +63,7 @@ Two arms under test, one reference, on the same feed and query schedule: beside it), installing ASAPPlanner's joint plan (`prep/.../backend/plan.json`). A query the plan cannot answer is refused, never forwarded. - `victoriametrics`: VictoriaMetrics single-node `v1.156.0` (the latest release, pinned with its - sha256 in `../fetch_binaries.sh`), **no stream aggregation** (no + sha256 in `../scripts/fetch_binaries.sh`), **no stream aggregation** (no `-streamAggr.config`), fed by the same paced feeder over Remote Write (`/api/v1/write`) and queried with `/api/v1/query` at the same evaluation times. Explicit flags (`run.py: VM_FLAGS`): `-retentionPeriod=1d`, @@ -120,7 +120,7 @@ hits/misses/computes and backlog, VictoriaMetrics' counters), which `demo_table.py` prints. ```sh -SERIES="1000 10000" ARM_CORES=16 QUERY_PHASE_S=600 WORKLOADS="demo/dashboard-heavy" ../run_vm_demo.sh +SERIES="1000 10000" ARM_CORES=16 QUERY_PHASE_S=600 WORKLOADS="demo/dashboard-heavy" ../scripts/run_vm_demo.sh ``` `run_vm_demo.sh` downloads missing pinned binaries into `$BIN_DIR`, builds `paced_feeder`/`data_plane`/`control_plane` @@ -128,7 +128,7 @@ there when missing (from `$BACKEND_DIR`), starts the monitoring stack (`../../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: +runs `../scripts/profile_query_phase.sh` beside it. Grafana: `http://127.0.0.1:13000/d/asap-vs-vm`. Ports: arms prometheus 19100, victoriametrics 19500, asap 19601; monitoring diff --git a/eval/harness/common.py b/eval/harness/common.py index b651c2f09..0405f604b 100644 --- a/eval/harness/common.py +++ b/eval/harness/common.py @@ -17,7 +17,7 @@ DEMO_WORKLOADS = BENCH / "workloads" TARGET = Path(os.environ.get("CARGO_TARGET_DIR", "target")) / "release" -# Pinned releases (../fetch_binaries.sh downloads and checks them). +# Pinned releases (../scripts/fetch_binaries.sh downloads and checks them). PROMETHEUS_VERSION = "3.5.0" # VICTORIAMETRICS_VERSION=v1.155.0 runs an older pinned release. VICTORIAMETRICS_VERSION = os.environ.get("VICTORIAMETRICS_VERSION", "v1.156.0") diff --git a/eval/harness/run.py b/eval/harness/run.py index bf17681f6..a82946842 100644 --- a/eval/harness/run.py +++ b/eval/harness/run.py @@ -1120,7 +1120,7 @@ def start_vmcluster(self, p): def write_state(self, phase, query_url): """/state.json: the phase and every process' pid, for the - profiling wrapper (profile/profile_query_phase.sh) to attach to.""" + profiling wrapper (scripts/profile_query_phase.sh) to attach to.""" write_json(self.dir / "state.json", { "arm": self.name, "phase": phase, "query_url": query_url, "time": time.time(), "pids": {role: proc.pid for role, proc in self.procs.items() if proc.poll() is None}, diff --git a/eval/build.sh b/eval/scripts/build.sh similarity index 100% rename from eval/build.sh rename to eval/scripts/build.sh diff --git a/eval/fetch_binaries.sh b/eval/scripts/fetch_binaries.sh similarity index 94% rename from eval/fetch_binaries.sh rename to eval/scripts/fetch_binaries.sh index bbe43ce82..f08ad6e80 100755 --- a/eval/fetch_binaries.sh +++ b/eval/scripts/fetch_binaries.sh @@ -3,8 +3,8 @@ # $BIN_DIR (required), each checked against its pinned sha256. # Already-present binaries are kept. Linux amd64 only. # -# BIN_DIR=$BIN_DIR ./fetch_binaries.sh # everything -# ./fetch_binaries.sh victoriametrics prometheus # only these +# BIN_DIR=$BIN_DIR scripts/fetch_binaries.sh # everything +# scripts/fetch_binaries.sh victoriametrics prometheus # only these set -euo pipefail BIN_DIR=${BIN_DIR:?set BIN_DIR} mkdir -p "$BIN_DIR" diff --git a/eval/profile/profile_query_phase.sh b/eval/scripts/profile_query_phase.sh similarity index 96% rename from eval/profile/profile_query_phase.sh rename to eval/scripts/profile_query_phase.sh index 0b72dc33a..45fa24a6e 100755 --- a/eval/profile/profile_query_phase.sh +++ b/eval/scripts/profile_query_phase.sh @@ -1,7 +1,7 @@ #!/bin/bash # CPU-profile the demo arms during their query phase. # -# profile/profile_query_phase.sh RUN_DIR [SECONDS] [ARMS] +# scripts/profile_query_phase.sh RUN_DIR [SECONDS] [ARMS] # # Start it next to run.py (run_vm_demo.sh does with PROFILE=1). For each arm # in ARMS (default "victoriametrics asap") it waits for RUN_DIR//state.json @@ -31,7 +31,7 @@ for d in "${FG:-}" "${FLAMEGRAPH_DIR:-}"; do [ -n "$d" ] && [ -x "$d/flamegraph.pl" ] && { FG=$d; break; } done if [ ! -x "$FG/flamegraph.pl" ]; then - BIN_DIR=$BIN_DIR "$BASE/fetch_binaries.sh" flamegraph >/dev/null && FG=$BIN_DIR/FlameGraph-41fee1f + BIN_DIR=$BIN_DIR "$BASE/scripts/fetch_binaries.sh" flamegraph >/dev/null && FG=$BIN_DIR/FlameGraph-41fee1f fi GO=${GO:-$(command -v go || true)} for g in "${GO_BIN:-}" "$(command -v go || true)"; do [ -z "$GO" ] && [ -x "$g" ] && GO=$g; done diff --git a/eval/run_vm_demo.sh b/eval/scripts/run_vm_demo.sh similarity index 98% rename from eval/run_vm_demo.sh rename to eval/scripts/run_vm_demo.sh index f44ac1b24..370ec39e9 100755 --- a/eval/run_vm_demo.sh +++ b/eval/scripts/run_vm_demo.sh @@ -1,7 +1,7 @@ #!/bin/bash # ASAP data plane vs VictoriaMetrics demo, one command: # -# SERIES=1000 QUERY_PHASE_S=600 WORKLOADS="demo/dashboard-heavy" ./run_vm_demo.sh +# SERIES=1000 QUERY_PHASE_S=600 WORKLOADS="demo/dashboard-heavy" scripts/run_vm_demo.sh # # For each workload: prepare (scaled manifest, feeder table, ASAPPlanner's # plan through the backend's control plane, timed as a one-time offline @@ -76,7 +76,7 @@ else fi # 1. Binaries: pinned releases, and the Rust binaries built when missing. -"$BASE/fetch_binaries.sh" victoriametrics prometheus flamegraph +"$BASE/scripts/fetch_binaries.sh" victoriametrics prometheus flamegraph build() { # dir, cargo args..., then copies the named binaries local dir=$1; shift local bins=$1; shift @@ -133,7 +133,7 @@ for w in $WORKLOADS; do log "no joint plan for $w (see $P/backend/plan_joint_summary.json); skipping"; continue fi if [ "$PROFILE" = 1 ]; then - ${AUX_CPUS:+taskset -c "$AUX_CPUS"} "$BASE/profile/profile_query_phase.sh" "$R" "$PROFILE_SECONDS" "victoriametrics asap" > "$R.profile.log" 2>&1 & + ${AUX_CPUS:+taskset -c "$AUX_CPUS"} "$BASE/scripts/profile_query_phase.sh" "$R" "$PROFILE_SECONDS" "victoriametrics asap" > "$R.profile.log" 2>&1 & PROFILER=$! fi log "run $w ($MODE): arms $ARMS, query phase ${QUERY_PHASE_S}s" From 659d53b0312af6dcb4b364ce0152e3a0451ed6e0 Mon Sep 17 00:00:00 2001 From: zzylol Date: Thu, 26 Nov 2026 18:31:07 +0000 Subject: [PATCH 2/2] fix(layout step 9): Dockerfile build deps, review fixes in eval README and compose files The build stage needs make (jemalloc) and cmake, g++, libclang-dev (HiGHS); the runtime stage needs no packages (rustls ships its roots). Baselines table points at the files that pin each version; compose files drop settings that restate defaults. --- README.md | 2 +- deployment/Dockerfile | 9 +++---- deployment/docker-compose.yml | 2 +- deployment/monitoring/.gitignore | 1 + eval/README.md | 25 +++++++++---------- eval/baselines/clickhouse/docker-compose.yml | 3 --- .../elasticsearch/docker-compose.yml | 1 - eval/scripts/build.sh | 2 +- 8 files changed, 20 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index ddb612f99..300266b77 100644 --- a/README.md +++ b/README.md @@ -267,7 +267,7 @@ not stored) with a Prometheus `execution` error (422, | `crates/adapters/query/elastic-http/` | package `elastic_http`: `_sql` and `_search` bodies and the fallback client of an Elasticsearch server, `POST /_sql`, `POST /_search` | | `crates/adapters/query/prometheus-http/` | package `prometheus_http`: query parameters, response bodies and the fallback client of a Prometheus-compatible server | | `benchmarks/` | the backend alone: `micro/` benchmarks (examples of `data_plane`) and `scripts/` | -| `eval/` | comparisons with other systems (`baselines/`, `harness/`, `scripts/`, `workloads/`) and the live demo; see [eval/README.md](eval/README.md) | +| `eval/` | comparisons with other systems and the live demo; see [eval/README.md](eval/README.md) | | `deployment/` | the backend's Docker image (`Dockerfile`) and Compose file; `monitoring/`: Prometheus, exporters and Grafana for the demo and the comparisons | | `docs/` | design documents and `examples/` workloads | | `scripts/` | CI and the Planner dependency updater | diff --git a/deployment/Dockerfile b/deployment/Dockerfile index 69763447b..955880fcc 100644 --- a/deployment/Dockerfile +++ b/deployment/Dockerfile @@ -9,8 +9,10 @@ # deployment/docker-compose.yml plans a workload and serves the plan. FROM rust:1.99.0-slim-bookworm AS build # git: Cargo fetches the pinned git dependencies with the git CLI (.cargo/config.toml). +# make: tikv-jemalloc-sys builds jemalloc. cmake, g++, libclang-dev: highs-sys +# (the Planner's MILP solver) builds HiGHS and generates its bindings. RUN apt-get update \ - && apt-get install -y --no-install-recommends git ca-certificates \ + && apt-get install -y --no-install-recommends git make cmake g++ libclang-dev \ && rm -rf /var/lib/apt/lists/* WORKDIR /src COPY . . @@ -21,10 +23,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ && install -m 0755 target/release/control_plane target/release/data_plane /usr/local/bin/ FROM debian:bookworm-20261104-slim -RUN apt-get update \ - && apt-get install -y --no-install-recommends ca-certificates \ - && rm -rf /var/lib/apt/lists/* \ - && useradd --system --uid 10001 --home-dir /data asap \ +RUN useradd --system --uid 10001 --home-dir /data asap \ && mkdir /data && chown asap /data COPY --from=build /usr/local/bin/control_plane /usr/local/bin/data_plane /usr/local/bin/ USER asap diff --git a/deployment/docker-compose.yml b/deployment/docker-compose.yml index 1d9d21440..13ed4f4b7 100644 --- a/deployment/docker-compose.yml +++ b/deployment/docker-compose.yml @@ -15,7 +15,7 @@ services: context: .. dockerfile: deployment/Dockerfile image: asap-backend - command: ["control_plane", "--workload", "/workload.json", "--out", "/data/plan.json", "--report", "/data/report.json"] + command: ["control_plane", "--workload", "/workload.json", "--out", "/data/plan.json"] volumes: - ${WORKLOAD:-../docs/examples/planner-layering-example1.json}:/workload.json:ro - data:/data diff --git a/deployment/monitoring/.gitignore b/deployment/monitoring/.gitignore index 6180db40d..be2afaee7 100644 --- a/deployment/monitoring/.gitignore +++ b/deployment/monitoring/.gitignore @@ -1,3 +1,4 @@ # What the monitoring stack writes (eval/scripts/run_vm_demo.sh, eval/demo/run_live_demo.sh). /textfile/ +/data/ /grafana/dashboards/ diff --git a/eval/README.md b/eval/README.md index fb8c7f4e9..eafa31ba7 100644 --- a/eval/README.md +++ b/eval/README.md @@ -1,11 +1,10 @@ # 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 (`.gitignore` lists where runs write: `prep/`, `runs/`, -`report_demo/`, `logs/`). Paths below are relative -to this directory, `$ASAPQ_BENCH`. +Scripts that run the ASAP data plane next to other systems (see +[Baselines](#baselines)) on the same Remote Write feed and the same queries, +check them against a reference, and show them on Grafana. Code and +configuration only: run outputs are git-ignored (`.gitignore`). Paths below +are relative to this directory, `$ASAPQ_BENCH`. | Path | What it holds | |---|---| @@ -13,7 +12,7 @@ to this directory, `$ASAPQ_BENCH`. | `scripts/run_vm_demo.sh` | The batch comparison: prepare, run the arms one after another on one feed, report. | | `scripts/fetch_binaries.sh`, `scripts/build.sh` | Pinned third-party binaries (sha256-checked); builds of the paced feeder and this repository into `$BIN_DIR`. | | `scripts/profile_query_phase.sh` | CPU profiles of each arm's query phase (`scripts/run_vm_demo.sh` with `PROFILE=1`). | -| `baselines/` | Compared systems that run as their own service (`baselines//docker-compose.yml`); see [Baselines](#baselines). | +| `baselines/` | ClickHouse and Elasticsearch, the compared systems that run as their own service (`baselines//docker-compose.yml`); see [Baselines](#baselines). | | `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`. | | `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`). | @@ -96,14 +95,14 @@ The systems the backend is compared with. "Harness arm" means as their own service and are, for now, only what the backend's routes forward to. No results are kept here. -| System | Version | How it runs | Harness arm | +| System | Version pinned in | How it runs | Harness arm | |---|---|---|---| -| Prometheus | 3.5.0 | binary from `scripts/fetch_binaries.sh`, flags in `harness/run.py` | `prometheus` (the exact reference), and beside `backend` and `asapquery` | -| VictoriaMetrics single-node | v1.156.0 | binary from `scripts/fetch_binaries.sh`, flags in `harness/run.py` (`VM_SEARCH_FLAGS`) | `victoriametrics`; also the reference of `demo/run_live_demo.sh` | -| VictoriaMetrics cluster | v1.156.0 | `vmstorage`, `vmselect`, `vminsert` installed by hand as `$BIN_DIR/-` (not fetched) | `vmcluster` | +| Prometheus | `scripts/fetch_binaries.sh`, `harness/common.py` | binary from `scripts/fetch_binaries.sh`, flags in `harness/run.py` | `prometheus` (the exact reference), and beside `backend`, `backend_alone` and `asapquery` | +| VictoriaMetrics single-node | `scripts/fetch_binaries.sh`, `harness/common.py` | binary from `scripts/fetch_binaries.sh`, flags in `harness/run.py` (`VM_SEARCH_FLAGS`) | `victoriametrics`; the raw store of `asap_forward`; the reference of `demo/run_live_demo.sh` | +| VictoriaMetrics cluster | `harness/common.py` (the single-node release) | `vmstorage`, `vmselect`, `vminsert` installed by hand as `$BIN_DIR/-` (not fetched) | `vmcluster` | | ASAPQuery query engine | the ASAPQuery checkout | `ASAPQUERY_ENGINE=1 scripts/build.sh` | `asapquery` | -| ClickHouse | 25.8.33.6 | `docker compose -f baselines/clickhouse/docker-compose.yml up -d`, then `data_plane --clickhouse-url http://localhost:8123` | none yet | -| Elasticsearch | 9.5.3 | `docker compose -f baselines/elasticsearch/docker-compose.yml up -d`, then `data_plane --elastic-url http://localhost:9200` | none yet | +| ClickHouse | `baselines/clickhouse/docker-compose.yml` | `docker compose -f baselines/clickhouse/docker-compose.yml up -d`, then `data_plane --clickhouse-url http://localhost:8123` | none yet | +| Elasticsearch | `baselines/elasticsearch/docker-compose.yml` | `docker compose -f baselines/elasticsearch/docker-compose.yml up -d`, then `data_plane --elastic-url http://localhost:9200` | none yet | Not ported yet: diff --git a/eval/baselines/clickhouse/docker-compose.yml b/eval/baselines/clickhouse/docker-compose.yml index e6340fe10..484a57615 100644 --- a/eval/baselines/clickhouse/docker-compose.yml +++ b/eval/baselines/clickhouse/docker-compose.yml @@ -15,15 +15,12 @@ services: volumes: - clickhouse-data:/var/lib/clickhouse environment: - - CLICKHOUSE_DB=default - - CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 # Naive datetime literals in SQL parse the same here as in the backend. - TZ=UTC ulimits: nofile: soft: 262144 hard: 262144 - restart: "no" volumes: clickhouse-data: diff --git a/eval/baselines/elasticsearch/docker-compose.yml b/eval/baselines/elasticsearch/docker-compose.yml index 81b2a08f0..e81bc9e38 100644 --- a/eval/baselines/elasticsearch/docker-compose.yml +++ b/eval/baselines/elasticsearch/docker-compose.yml @@ -22,7 +22,6 @@ services: nofile: soft: 65536 hard: 65536 - restart: "no" volumes: elasticsearch-data: diff --git a/eval/scripts/build.sh b/eval/scripts/build.sh index 83bc5dfbe..2c6dc56d4 100755 --- a/eval/scripts/build.sh +++ b/eval/scripts/build.sh @@ -2,7 +2,7 @@ # Build the paced feeder (with campaign/paced-feeder-realistic.diff applied, for # FEEDER_VALUES=realistic), this repository's data_plane and control_plane, and # optionally ASAPQuery's query engine, and install the binaries into $BIN_DIR. -# ASAPQ_BENCH, BIN_DIR required (see README.md) +# ASAPQ_BENCH, BIN_DIR required (see eval/README.md) # ASAP_PLANNER_DIR optional: also build the Planner's random-workload example # ASAPQUERY_ENGINE=1 also build ASAPQuery's query_engine_rust (the harness's asapquery arm) set -euo pipefail