File size: 1,152 Bytes
ad6901d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
# Start the scoring API on localhost for solo development / self-testing.
#
# Usage:
#   GT_DIR=~/graphtestbed-private/ground_truth ./server/run_local.sh
#
# Then in another shell:
#   export GRAPHTESTBED_API=http://localhost:8080
#   gtb submit <task> --file preds.csv --agent <name>

set -euo pipefail

: "${GT_DIR:?Set GT_DIR to a directory containing <task>.csv ground-truth files}"

# Sensible defaults for local dev — sqlite in a tmp file, manifest from the
# repo this script lives in, quota relaxed so debugging doesn't burn it.
export GT_DB="${GT_DB:-/tmp/gtb_leaderboard.db}"
export GT_MANIFEST="${GT_MANIFEST:-$(cd "$(dirname "$0")/.." && pwd)/datasets/manifest.yaml}"
export GT_QUOTA="${GT_QUOTA:-1000}"
export PORT="${PORT:-8080}"

echo "GraphTestbed API (local)"
echo "  GT_DIR:      $GT_DIR"
echo "  GT_DB:       $GT_DB"
echo "  GT_MANIFEST: $GT_MANIFEST"
echo "  GT_QUOTA:    $GT_QUOTA / day / IP / task"
echo "  PORT:        $PORT"
echo
echo "Healthz: curl http://localhost:$PORT/healthz"
echo "Submit:  GRAPHTESTBED_API=http://localhost:$PORT gtb submit <task> ..."
echo

cd "$(dirname "$0")"
exec python api.py