-
Notifications
You must be signed in to change notification settings - Fork 1
/
go
executable file
·66 lines (51 loc) · 1.85 KB
/
go
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
64
65
66
#!/bin/bash
trap : SIGTERM SIGINT
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ARGOS_ENV=$HOME/env/argos
echo -e "\n\n\n\n\n"
echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo -e "$(tput setaf 6)Summoning the $(tput setaf 3)Argos$(tput setaf 6) environment with PID $(tput setaf 1)$$$(tput sgr0)"
echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo -e "\n\n\n\n\n"
# Run everything in the background,
# but remember their process IDs.
redis-server &
REDIS_PID=$!
rabbitmq-server &
RABMQ_PID=$!
cd $ARGOS_ENV/ner
java -mx1000m -cp stanford-ner.jar edu.stanford.nlp.ie.NERServer -loadClassifier classifiers/english.conll.4class.distsim.crf.ser.gz -port 8080 -outputFormat inlineXML &
NERSV_PID=$!
cd $DIR
cd $ARGOS_ENV/jena/fuseki
./fuseki-server --loc=$ARGOS_ENV/data/knowledge/knodb /knowledge &
KNOSV_PID=$!
cd $DIR
cd $ARGOS_ENV/data/spotlight
java -jar -Xmx16g dbpedia-spotlight-0.7.jar en_2+2 http://localhost:2222/rest &
SPOTL_PID=$!
cd $DIR
RUN_WORKERS=${1:-false}
if [ "$RUN_WORKERS" = true ] ; then
source $ARGOS_ENV/bin/activate
celery multi start 2 --loglevel=DEBUG --app=argos.tasks.celery -Q:1 clustering -Q:2 broadcast_tasks -c:1 1 --pidfile=/var/run/celery/%n.pid --logfile=/var/log/celery/%n.log
WORKR_PID=$!
fi
wait
if [[ $? -gt 128 ]]
then
echo -e "\n\n\n\n\n"
echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo -e "$(tput setaf 6)Exiting the $(tput setaf 3)Argos$(tput setaf 6) environment.$(tput sgr0)"
echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo -e "\n\n\n\n\n"
kill $REDIS_PID
kill $RABMQ_PID
kill $NERSV_PID
kill $KNOSV_PID
kill $SPOTL_PID
if [ "$RUN_WORKERS" = true ] ; then
kill $WORKR_PID
ps auxww | grep 'celery worker' | awk '{print $2}' | xargs kill
fi
fi