-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathserver.sh
54 lines (42 loc) · 1.16 KB
/
server.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
set -e
if [ "$1" == "prod" ]; then
FLAG=""
else
export FLASK_ENV=development
FLAG="--wsgi"
fi
if [ "$2" == "" ]; then
DIR=/workspace/sm-dev
else
DIR=$2
fi
if [ "$3" == "" ]; then
PORT=5524
else
PORT=$3
fi
DB=$DIR/data/home/sand/db.sqlite
if [ ! -f "$DB" ];
then
DIRNAME=$(dirname $DB)
if [ ! -d "$DIRNAME" ]
then
mkdir -p $DIRNAME
fi
python -m sand init --db $DB
# load the auto-labeled wikipedia tables
python -m sand create --db $DB --description 'auto-labeled wikipedia tables' wtauto-200
python -m sand load --db $DB -p wtauto-200 --dataset $DIR/data/home/datasets/wtauto-200
# load the manually labeled wikipedia tables
python -m sand create --db $DB --description 'manually labeled wikipedia tables' wt250
python -m sand load --db $DB -p wt250 --dataset $DIR/datasets/250wt
fi
python -m sand start $FLAG \
--db $DB \
--externaldb $DIR/data/home/databases \
-p $PORT
# python -m sand init --db $DIR/data/home/sand-demo/sand.db
# python -m sand start $FLAG \
# --db $DIR/data/home/sand-demo/sand.db \
# --externaldb $DIR/data/home/sand-demo #--externaldb-proxy