Skip to content

Commit b89a124

Browse files
author
Tooru
committed
Fix lockfile check and document devserver scripts
1 parent 7373834 commit b89a124

2 files changed

Lines changed: 34 additions & 17 deletions

File tree

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,27 @@ Environment variables present in the shell always take precedence over `.env` va
8282
---
8383
## Launching the Benchmark Dashboard
8484

85+
### Quickstart scripts
86+
87+
Use the helper scripts to create/activate `.venv`, install the pinned dependencies (with hash verification), start `uvicorn`, and open the UI in your browser:
88+
89+
```bash
90+
./scripts/devserver.sh
91+
```
92+
93+
This serves the main dashboard at `http://127.0.0.1:8000/ui/index.html`.
94+
95+
For the QA dashboard (loads `OPENROUTER_API_KEY` from your shell or `.env` and supports custom host/port):
96+
97+
```bash
98+
./scripts/devserver_qa.sh
99+
```
100+
101+
Optional environment variables:
102+
103+
- `DEVSERVER_NO_REFRESH=1` (don’t auto-open the browser)
104+
- `DEVSERVER_HOST` / `DEVSERVER_PORT` (QA script only; defaults to `127.0.0.1:8000`, and auto-selects `8001-8100` if `8000` is busy)
105+
85106
1. **Start the FastAPI server**
86107
```bash
87108
uvicorn server.api:app --reload

scripts/check-deps.sh

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,29 @@ echo "Checking if lock files are up to date..."
3535
# Common pip-compile flags (must match compile-deps.sh)
3636
COMPILE_FLAGS="--quiet --strip-extras --generate-hashes --allow-unsafe"
3737

38-
# Compile to temporary files (with hashes to match compile-deps.sh)
39-
"${VENV_DIR}/bin/pip-compile" ${COMPILE_FLAGS} --output-file="${TEMP_DIR}/server-requirements.txt" server/requirements.in
40-
"${VENV_DIR}/bin/pip-compile" ${COMPILE_FLAGS} --output-file="${TEMP_DIR}/harness-requirements.txt" harness/requirements.in
41-
"${VENV_DIR}/bin/pip-compile" ${COMPILE_FLAGS} --output-file="${TEMP_DIR}/dev-requirements.txt" requirements-dev.in
42-
43-
# Compare with existing lock files (ignoring header comments with pip-compile command)
44-
# We filter out the comment line containing "pip-compile" as it includes
45-
# the output path which differs between runs
38+
# Compile without modifying tracked files.
39+
# Note: pip-compile prints the generated requirements to STDERR in --dry-run mode.
40+
"${VENV_DIR}/bin/pip-compile" ${COMPILE_FLAGS} --dry-run --output-file=server/requirements.txt server/requirements.in 1>/dev/null 2>"${TEMP_DIR}/server-requirements.txt"
41+
"${VENV_DIR}/bin/pip-compile" ${COMPILE_FLAGS} --dry-run --output-file=harness/requirements.txt harness/requirements.in 1>/dev/null 2>"${TEMP_DIR}/harness-requirements.txt"
42+
"${VENV_DIR}/bin/pip-compile" ${COMPILE_FLAGS} --dry-run --output-file=requirements-dev.txt requirements-dev.in 1>/dev/null 2>"${TEMP_DIR}/dev-requirements.txt"
43+
44+
strip_pip_compile_header() {
45+
awk 'BEGIN{started=0} started{print; next} /^[[:space:]]*$/{next} /^#/{next} {started=1; print}' "$1"
46+
}
47+
4648
CHANGES=0
4749

48-
if ! diff <(grep -v "^# pip-compile " server/requirements.txt) \
49-
<(grep -v "^# pip-compile " "${TEMP_DIR}/server-requirements.txt") \
50-
>/dev/null 2>&1; then
50+
if ! diff <(strip_pip_compile_header server/requirements.txt) <(strip_pip_compile_header "${TEMP_DIR}/server-requirements.txt") >/dev/null 2>&1; then
5151
echo "❌ server/requirements.txt is out of date"
5252
CHANGES=1
5353
fi
5454

55-
if ! diff <(grep -v "^# pip-compile " harness/requirements.txt) \
56-
<(grep -v "^# pip-compile " "${TEMP_DIR}/harness-requirements.txt") \
57-
>/dev/null 2>&1; then
55+
if ! diff <(strip_pip_compile_header harness/requirements.txt) <(strip_pip_compile_header "${TEMP_DIR}/harness-requirements.txt") >/dev/null 2>&1; then
5856
echo "❌ harness/requirements.txt is out of date"
5957
CHANGES=1
6058
fi
6159

62-
if ! diff <(grep -v "^# pip-compile " requirements-dev.txt) \
63-
<(grep -v "^# pip-compile " "${TEMP_DIR}/dev-requirements.txt") \
64-
>/dev/null 2>&1; then
60+
if ! diff <(strip_pip_compile_header requirements-dev.txt) <(strip_pip_compile_header "${TEMP_DIR}/dev-requirements.txt") >/dev/null 2>&1; then
6561
echo "❌ requirements-dev.txt is out of date"
6662
CHANGES=1
6763
fi

0 commit comments

Comments
 (0)