-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun_webserver_summit.sh
More file actions
63 lines (47 loc) · 1.05 KB
/
run_webserver_summit.sh
File metadata and controls
63 lines (47 loc) · 1.05 KB
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
55
56
57
58
59
60
61
62
63
#!/bin/bash
if [ "$1" != "" ]; then
LOG_DIR=$1
else
rm -rf "`pwd`/temp/logs"
mkdir -p "`pwd`/temp/logs"
LOG_DIR="`pwd`/temp/logs"
fi
if [ "$2" != "" ]; then
CELERY_ARGS=$2
else
CELERY_ARGS="--loglevel=info --pool=gevent --concurrency=5"
fi
if [ "$3" != "" ]; then
PORT=$3
else
PORT=5002
fi
redis=$4
HOST=`hostname`
echo "LOG_DIR: ${LOG_DIR}"
echo "CELERY ARGS: ${CELERY_ARGS}"
echo "HOST: ${HOST}, PORT: ${PORT}"
echo "Redis: ${redis}"
#echo "pip list"
#pip list
echo "Current Path: `pwd`"
export CELERY_BROKER_URL="redis://${HOST}:6379"
echo "create db ..."
python3 manager.py createdb
echo "run redis ..."
redis-stable/src/redis-server ${redis}
sleep 5
echo "run celery ..."
python3 manager.py celery ${CELERY_ARGS} \
2>&1 | tee "${LOG_DIR}/celery.log" &
sleep 10
echo "run webserver ..."
python3 run_server.py $HOST $PORT \
2>&1 | tee "${LOG_DIR}/webserver.log" &
sleep 2
echo "redis ping-pong ..."
redis-stable/src/redis-cli -h $HOST -p 6379 ping
# save hostname
echo $HOST >> webserver.host
echo $PORT >> webserver.port
ls -l