Skip to content

test(integration): Gorilla-S3 e2e — agent → MinIO → backend exact PromQL (Phase 6) - #283

Merged
zzylol merged 1 commit into
mainfrom
test/gorilla-s3-e2e-integration-phase-6
May 6, 2026
Merged

zzylol merged 1 commit into
mainfrom
test/gorilla-s3-e2e-integration-phase-6

Conversation

@zzylol

@zzylol zzylol commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

End-to-end integration test for the Phase 6 (FINAL) Gorilla-S3 cold-engine pipeline:

fake-driver  ─OTLP─▶  sketchcol+gorillas3processor
                          │  encode (Gorilla XOR-delta)
                          ▼
                       MinIO   ─list/get─▶  GorillaS3ColdStore
                                                  │  decode
                                                  ▼
                                         GorillaQueryEngine
                                          exact PromQL
                                                  │
                                                  ▼
                                          backend HTTP /api/v1/query
                                          { accuracy: ε=0,
                                            data_source: gorilla_archive }

Lands integration/gorilla_s3_e2e/ mirroring the existing integration/parity/ + integration/cross_host_parity/ Go-test pattern. Validates the byte-format compatibility contract that ties together the Phase-1 Rust crate (asap-gorilla), the Phase-2 Go processor (gorillas3processor PR #282), the Phase-3 backend cold-store (PR #84), and the Phase-4/5 engine + router (PRs #85, #86).

Coordination strategy

Both of the brief's options:

  • Option A (separate ports + project) — overlay uses compose project asap-gorilla-e2e on 29xxx ports so it would NOT collide with the host sweep on 19xxx, AND
  • Option B (skip-if-busy) — at test setup, probe /proc/<sweep_pid> and t.Skip if alive (overridable via GORILLA_E2E_FORCE=1).

The double-defense matches the brief's "do not bring up docker unless the sweep is actually idle" gate; the live test only fires with GORILLA_E2E_LIVE=1 AND no sweep alive.

Subtests

TestGorillaS3End2End runs the live stack once and dispatches five subtests:

Subtest Asserts
HappyPath Chunks land in MinIO; in-test Go decoder reads the input value-set back
MultiChunkRange ≥1 chunk, with multi-chunk merge correctness if the spread crossed a 60s window
AccuracyExact Backend response carries kind=Exact, ε=0, δ=0 (SKIPS until EngineRouter is wired into HTTP — see below)
DataSourceMarker Backend response carries data_source: gorilla_archive (same SKIP gate)
CrossLanguageByteCompat Go-encoded chunk decoded by the Rust asap-gorilla crate via cargo test

Plus six docker-free subtests that always run and pin the byte format / fixture invariants in CI without needing Docker (decoder round-trips, header rejection paths, fixture sum invariant).

Phase-6 follow-up surfaced by writing the test

asap-query-engine/src/drivers/query/servers/http.rs still wires Arc<SimpleEngine> directly — the Phase-5 EngineRouter is built but not yet consumed by the HTTP path. Until that lands, AccuracyExact + DataSourceMarker SKIP with a clear annotation rather than fail. Documented in PROGRESS.md and the README; tracking item for a separate ASAPQuery-backend PR.

Test plan

  • go build ./... clean
  • go vet ./... clean
  • go test ./... passes 6 docker-free subtests + skips TestGorillaS3End2End with the documented "set GORILLA_E2E_LIVE=1" message
  • In-test decoder round-trips: single-point, flat sequence, 100-sample 1..N ramp (sums to 5050, mirrors live fixture)
  • GORILLA_E2E_LIVE=1 go test -v -run TestGorillaS3End2End ./... — deferred until sweep idle (sweep PID 2862786 still alive at submission time)
  • File domain respected: only integration/gorilla_s3_e2e/ (new) + one PROGRESS.md line
  • No submodule pointer drift; no Phase 1-5 Gorilla-S3 source touched

🤖 Generated with Claude Code

…mQL (Phase 6)

End-to-end integration test covering the full Gorilla-S3 cold-engine
pipeline (Phase 6, FINAL): drives 100 deterministic samples through
sketchcol+gorillas3processor, asserts MinIO chunks decode to the
input set, and verifies the backend response carries the
exact-accuracy + gorilla_archive markers. Also runs the Go-encoded
chunk through the Rust asap-gorilla decoder to pin the byte-format
parity contract.

Coordination strategy: separate compose project (asap-gorilla-e2e)
on a separate port range (29xxx) AND skip-if-sweep-busy gating, so
the test never competes with the host-wide sweep. Default
`go test ./...` runs fixture-only (decoder round-trips + fixture
sanity); the live docker path is opt-in via GORILLA_E2E_LIVE=1.

Surfaces one Phase-6 follow-up: the backend HTTP server still wires
Arc<SimpleEngine> directly — EngineRouter is built but not yet
consumed by the HTTP path. AccuracyExact + DataSourceMarker
subtests SKIP with a documented note until that wiring lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit ba1497e into main May 6, 2026
@zzylol
zzylol deleted the test/gorilla-s3-e2e-integration-phase-6 branch May 9, 2026 18:00
zzylol added a commit that referenced this pull request May 19, 2026
…10 Mbps double-hop) (#401)

The asap-gateway OTel-collector hop was originally the cross-agent
fan-in tier for sum-by-zone aggregations. Post ASAPQuery-backend
PRs #283 (B2 stage-emit) and #287/#290 (cumulative emit), the
wave-tier backend does that fan-in natively via the
`evaluate_exact_agg` reducer pulling sids from every agent. The
gateway became a pure forwarder that doubled every byte (agent →
gateway → backend) for no algorithmic reason, costing ~10 Mbps per
arm on the multinode demo (issue #400).

Scope:
- multinode `run_demo.sh`: remove `gateway_up` / `gateway_down`, drop
  the gateway out of `arm_up` / `arm_down`. `stop_node node1` stays in
  the teardown to reap any pre-#400 leftover container; `node1` is
  otherwise unused.
- multinode `topology.env`: drop the `--add-host=gateway:` alias and
  retire the node1 role note.
- multinode + singlenode agent yaml: OTLP `endpoint:` flips from
  `gateway:4317` to `backend:4317`. The backend already accepts OTLP on
  4317 (`--otel-grpc-port=4317` in `run_demo.sh` and base.yml).
- multinode + singlenode `mvp-workload.yaml`: the lone
  `assign_to_role: gateway` entry (sum-by-zone) becomes
  `assign_to_role: agent`. The controller's typed `split_typed_three_stage`
  emits only Edge + Backend stages when no Gateway stage is occupied,
  so `emit_gateway_yaml` simply doesn't fire and `push_to_role(Gateway, ...)`
  is a no-op — no controller code change needed.
- multinode `asap-otel-gateway-mvp-placeholder.yaml`: deleted.
- singlenode `base.yml`: gateway service removed; its host ports
  (14317 / 14318) reassigned to the backend container so external
  tooling that previously hit the gateway can hit the backend on the
  same host ports. `fake-exporter` default `EXPORTER_TARGET` flips to
  `backend:4317`; `depends_on` flips to `backend`.
- singlenode `agents-N{1,10,100}.yml` + `gen-agents.sh`: `depends_on`
  flips from `gateway` → `backend`.

Validation (multinode, 60 s NIC sample, asap arm, WARMUP_S=90):
- node1 docker ps: empty (no asap-gateway).
- node2 docker ps: backend + thanos-{query,store-gateway,compact} +
  minio + prometheus + controller; no gateway.
- All 5 wave queries against node2:9091 return `data_source: asap_query`:
    quantile_over_time(0.99, http_requests_total_latency_ms[5m])
      → 10000 series
    max by (zone) (quantile_over_time(0.99, ...))
      → 4 series
    sum by (zone) (http_requests_total)
      → 4 series
    sum by (zone) (rate(http_requests_total[5m]))
      → 4 series
    topk(5, sum by (zone) (rate(...)))
      → 4 series
- Per-node NIC bandwidth (enp130s0f0, 60 s):
    node0  RX 0.16 Mbps  TX 6.80 Mbps   (agent-a → backend)
    node1  RX 0.00 Mbps  TX 0.00 Mbps   (idle — pre-fix carried the gateway double-hop)
    node2  RX 13.56 Mbps TX 0.33 Mbps   (backend receives both agents)
    node3  RX 0.16 Mbps  TX 6.76 Mbps   (agent-b → backend)
  Pre-fix the node1 link carried ~13 Mbps in + ~13 Mbps out as a pure
  forwarder. Post-fix that ~26 Mbps of node1 wire traffic is gone; the
  remaining ~13.6 Mbps lives only on the agent→backend hop.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant