Conversation
Sibling of e2e-smoke.sh. Boots the same M1 pipeline plus the Next.js dev server, prints a single ready URL, and blocks on Ctrl-C. No assertions — this is a developer ergonomics script for the visual demo + day-to-day inner loop. Volumes are preserved across runs (ClickHouse history persists). LOGS=1 multiplexes all four service logs to stdout with a [service] prefix. SKIP_BUILD=1 skips cargo + go compile when binaries are already fresh. PID polling is used in place of wait -n so the script runs on macOS bash 3.2. Teardown reaps rust + go + node processes by name and brings the compose stack down (without -v) so the next run starts hot.
HIGH-1: Next.js worker grandchildren survived teardown. The recorded PID is the pnpm wrapper; pkill -f "next dev" / "next-server" misses the worker tree whose argv doesn't contain either string. Teardown now walks two layers of children under the tracked FRONTEND_PID before falling back to pkill + the port sweep. HIGH-2: A background service crashing during the readiness wait was silently swallowed (bash pipefail doesn't apply to backgrounded jobs). Added check_services_alive between every wait_until so a dead ingestion or engine fails the boot loud instead of greeting the operator with READY plus a dark chart. MED-1: Added pre-flight check_port_free for API_PORT + FRONTEND_PORT. A stale process on the same port can return 200 to the health probe and let our fresh binary die on EADDRINUSE unnoticed. MED-2: Guarded teardown with _TEARING_DOWN so the trap can't fire twice when SIGINT delivers and the in-trap `exit` triggers EXIT. Previously re-entered, ran compose down twice, and clobbered the propagated rc. MED-3: Teardown now prunes /tmp/volx-dev-* older than 2 days. The launcher runs many times per day; /tmp would grow unbounded otherwise. LOW findings either match the e2e-smoke sibling for consistency (redundant CHILD_PIDS expansion, narrow lsof sweep) or do not apply (volx-normalizer is library, not binary).
Owner
Author
Review r1 — addressed in fixup
|
| Severity | Finding | Status |
|---|---|---|
| HIGH-1 | Next.js worker grandchildren survive teardown (pkill -f misses workers whose argv lacks "next") |
Fixed — pgrep -P walks two layers under tracked FRONTEND_PID before pkill fallback |
| HIGH-2 | Service crash during readiness wait silently swallowed (background exit doesn't trip pipefail) | Fixed — check_services_alive between every wait_until |
| MED-1 | No port pre-flight; stale process on same port can serve the health probe | Fixed — check_port_free for API_PORT + FRONTEND_PORT after compose-up |
| MED-2 | EXIT trap re-fires when SIGINT handler calls exit → double compose down, clobbered rc |
Fixed — _TEARING_DOWN latch |
| MED-3 | /tmp/volx-dev-* log dirs accumulate unbounded |
Fixed — teardown prunes -mtime +2 |
| LOW-1 | lsof sweep narrow | Skipped — matches sibling e2e-smoke.sh |
| LOW-2 | Redundant CHILD_PIDS[@]:- fallback |
Skipped — same as smoke, harmless |
| LOW-3 | Missing volx-normalizer pkill |
N/A — normalizer is library inside ingestion, not a separate binary |
Live verification still pending per operator decision.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/dev-stack.sh— one-shot launcher for the full M1 stack plus the Next.js dev server. Sibling ofe2e-smoke.shbut inverted: no assertions, no auto-teardown, just boot every service in dependency order, print a single ready URL, and block until Ctrl-C.Closes #70.
What it does
Ready URLs
http://localhost:${FRONTEND_PORT}http://localhost:${FRONTEND_PORT}/chart/bvolhttp://localhost:${API_PORT}/v1/healthhttp://localhost:${API_PORT}/v1/index/bvol/latestConfiguration
LOGS01tails all four service logs to stdout, each line prefixed[service]SKIP_BUILD01skips cargo + go compile; fails fast if binaries missingFRONTEND_PORT3000API_PORT8080CLICKHOUSE_HTTP_PORT8123Design choices
down -vin startup or teardown.pnpm dev, notpnpm build && start. Hot module reload, ~2 s cold start vs ~30 s for a production bundle. Matches the day-to-day inner loop.wait -n.wait -nis bash 4+; macOS ships bash 3.2 by default. A 5-second poll over the recorded child PIDs catches unexpected exits with no perceptible latency.cargo runparents fork-exec the compiled binary, andnext devspawns workers that don't inherit the SIGTERM from killing thepnpmwrapper. The teardown trappkill -fs each binary name explicitly before falling back to recorded PIDs and alsofport sweep.File map
scripts/dev-stack.shDependencies
docker(compose v2)cargo(Rust ≥ 1.85)go(1.25)pnpm(9.x)curllsof,pkillOut of scope
pnpm build && pnpm start) — dev mode chosen for HMRe2e-smoke.shand GitHub Actions: CI (lint + test, no deploy) #28 will wire that into Actionsingestion-okx/ingestion-bybitspawn lines when those crates landTest plan
bash -n scripts/dev-stack.shclean on macOS bash 3.2/chart/bvolpaints the live chart, Ctrl-C tears down with no orphansLOGS=1streams every service log with[service]prefixSKIP_BUILD=1skips both build phases when binaries exist; fails fast when they do notLive verification deferred per operator decision — will run before/at merge. Two un-checked test-plan items are smoke (clean boot + clean teardown); the third (
LOGS=1) and fourth (SKIP_BUILD=1) are flag paths to exercise on second run.