This repository has no description
1# ── build ────────────────────────────────────────────────────────────
2
3# build the server (debug)
4build:
5 zig build
6
7# release build (use this for anything perf-shaped)
8build-release:
9 zig build -Doptimize=ReleaseFast
10
11# rebuild on save with incremental compilation (restart the server yourself —
12# zig doesn't hot-swap a running process)
13watch:
14 zig build --watch -fincremental
15
16# run unit tests
17test:
18 zig build test
19
20# ── infrastructure ───────────────────────────────────────────────────
21
22# bring up the appview redis (compose.yml)
23up:
24 docker compose up -d --wait
25
26# tear it down
27down:
28 docker compose down
29
30# ── run ──────────────────────────────────────────────────────────────
31
32# serve weir against the compose redis, with the ui if fetched
33serve: build-release up
34 WEIR_CACHE=redis WEIR_REDIS_PORT=6390 ./zig-out/bin/weir
35
36# serve with zero infrastructure (embedded burner-redis appview)
37serve-embedded: build-release
38 ./zig-out/bin/weir
39
40# the full demo: redis + ui bundle + weir. then open http://127.0.0.1:4200
41# and in other shells: `just demo-flow` and `just mirror`
42demo: up
43 #!/usr/bin/env bash
44 set -euo pipefail
45 test -d ui || just fetch-ui
46 just build-release
47 echo "weir: http://127.0.0.1:4200 (ui + api + xrpc)"
48 WEIR_CACHE=redis WEIR_REDIS_PORT=6390 ./zig-out/bin/weir
49
50# ── drive it ─────────────────────────────────────────────────────────
51
52# basic flow against a running server
53smoke:
54 PREFECT_API_URL=http://localhost:4200/api ./scripts/test-flow
55
56# task-rich etl flow (mapped fan-out, retries, a tolerated failure)
57demo-flow:
58 PREFECT_API_URL=http://localhost:4200/api ./scripts/demo-flow
59
60# mirror the repo into the waow.tech workspace space on zds
61# (needs ATPROTO_WAOW_PASSWORD, e.g. from ~/tangled.org/.env)
62mirror:
63 ./scripts/space-mirror --interval 2
64
65# read benchmark against any prefect-shaped targets
66bench-reads *args:
67 ./scripts/bench-reads {{args}}
68
69# concurrent scale gauntlet against a running server
70bench-scale *args:
71 ./scripts/bench-scale {{args}}
72
73# ── inspect ──────────────────────────────────────────────────────────
74
75# fetch the workspace's full orchestration history as a signed CAR
76export-car out="workspace.car":
77 curl -s http://localhost:4200/xrpc/com.atproto.sync.getRepo -o {{out}}
78 @echo "wrote {{out}} — verify offline against the workspace did"
79
80# list records in a collection (e.g. just records io.prefect.v0.flowRun)
81records collection="io.prefect.v0.event":
82 curl -s 'http://localhost:4200/xrpc/com.atproto.repo.listRecords?collection={{collection}}' | jq .
83
84# ── assets & state ───────────────────────────────────────────────────
85
86# copy the prefect react ui bundle out of the python package
87fetch-ui:
88 #!/usr/bin/env bash
89 set -euo pipefail
90 src=$(uv run --quiet --with prefect python3 -c "import prefect, pathlib; print(pathlib.Path(prefect.__file__).parent / 'server' / 'ui-v2')")
91 rm -rf ui && cp -r "$src" ui
92 # substitute the serve-base placeholder the python server rewrites at startup
93 find ui -type f \( -name '*.html' -o -name '*.js' -o -name '*.css' -o -name '*.json' \) \
94 -exec sed -i '' 's|/PREFECT_UI_SERVE_BASE_REPLACE_PLACEHOLDER||g' {} +
95 echo "ui bundle copied from $src (serve base: /)"
96
97# wipe local state (signing key + repo CAR)
98clean-data:
99 rm -rf data