Viewing files at commit c10cefe7abe5Commit detailsView latest

Browse files
oakmark/run-local.sh 42 lines · 1.7 KB · bash
1
#!/usr/bin/env bash
2
# Run the full oakmark local matrix against a throwaway `oak serve`:
3
# both transports (cli floor + protocol ceiling) for the branch strategy, plus a
4
# cli session run for clones/hour. Reports land in results/.
5
#
6
# Usage: ./run-local.sh [PORT] [CONCURRENCY_CSV] [DURATION]
7
set -euo pipefail
8
cd "$(dirname "$0")"
9
10
PORT="${1:-8096}"
11
CONC="${2:-1,8,32,128}"
12
DUR="${3:-20s}"
13
OAK="${OAK_BIN:-oak}"
14
ENGINE="oak-engine/target/release/oak-engine"
15
16
command -v go >/dev/null || { echo "need go on PATH" >&2; exit 1; }
17
[[ -x "$ENGINE" ]] || { echo "build the engine first: ./build-engine.sh" >&2; exit 1; }
18
19
mkdir -p results
20
go build -o ./oakmark .
21
22
DATA="$(mktemp -d)"; trap 'kill "$SP" 2>/dev/null || true; rm -rf "$DATA"' EXIT
23
"$OAK" serve --dir "$DATA" --port "$PORT" >results/serve.log 2>&1 &
24
SP=$!; sleep 2
25
REMOTE="http://127.0.0.1:$PORT"
26
27
echo "== branch / cli (real-agent floor) =="
28
./oakmark -remote "$REMOTE" -transport cli -strategy branch -owner bench -repo tp-cli \
29
  -concurrency "$CONC" -duration "$DUR" -warmup 5s \
30
  -out results/branch-cli.json -report results/branch-cli.md
31
32
echo "== branch / protocol (in-process ceiling) =="
33
./oakmark -remote "$REMOTE" -transport protocol -engine-bin "$ENGINE" -strategy branch \
34
  -owner bench -repo tp-proto -concurrency "$CONC" -duration "$DUR" -warmup 5s \
35
  -out results/branch-protocol.json -report results/branch-protocol.md
36
37
echo "== session / cli (clones/hour) =="
38
./oakmark -remote "$REMOTE" -transport cli -strategy session -owner bench -repo tp-sess \
39
  -session-commits 5 -clone-depth 1 -concurrency "$CONC" -duration "$DUR" -warmup 5s \
40
  -out results/session-cli.json -report results/session-cli.md
41
42
echo "reports in results/: branch-cli.md, branch-protocol.md, session-cli.md"