/
startup.run
executable file
·91 lines (87 loc) · 2.03 KB
/
startup.run
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
# . /pi/bin/inc/wait_funcs.sh
# . /pi/bin/inc/matchers.sh
# . /pi/bin/inc/docker_utils.sh
function start_inventory(){
# mysqld: ready for connections.
start_docker inventory "$msg_mysql"
}
export PYTHONPATH=/pi/stack:$PYTHONPATH
python="$HOME/miniconda3/envs/rasa/bin/python"
jupyter="$HOME/miniconda3/envs/rasa/bin/jupyter"
streamlit="$HOME/miniconda3/envs/rasa/bin/streamlit"
rasa="$HOME/miniconda3/envs/rasa/bin/rasa"
# startup
if [ $# -lt 1 ]; then
echo "available opts: all, zk, storm, repl, ..."
else
CMD=$1
case "$CMD" in
"redis")
start_docker redis "$msg_redis"
;;
"build")
# $python setup.py sdist bdist_wheel
$python setup.py bdist_wheel
;;
"local")
pip install --no-deps -e .
;;
"dist")
rm ./dist/*
# python setup.py sdist bdist_wheel
python setup.py bdist_wheel
python -m twine upload dist/*
;;
"note")
$jupyter notebook
;;
"sl")
$python -m sagas.tool.creators normal ${@:2}
$streamlit run ${@:2}
;;
"agent_servant")
$python -m saai.agent_servant app
;;
"agent_servant_prod")
$python -m saai.agent_servant app agents_prod
;;
"genesis_actions")
cd bots/genesis && $python -m rasa_sdk --actions actions.actions
# $rasa run actions.actions
;;
"saya_actions")
cd bots/saya && $python -m rasa_sdk --actions actions.actions --port 5088
# $rasa run actions.actions
;;
"saya_nlg")
$python -m saai.nlg.nlg_server --domain /pi/ws/sagas-ai/bots/saya/domain.yml
;;
"saya")
cd bots/saya
$rasa shell --endpoints endpoints.yml
;;
"saya_en")
cd bots/saya
$rasa shell --endpoints endpoints_en.yml
;;
"nlu")
model_dir='/pi/ws/sagas-ai/nlu_multilang/models'
if [ $# -gt 2 ]; then
lang=$2
port=$3
echo "run server for lang $lang on port $port ..."
$rasa run --enable-api -m ${model_dir}/${lang}_current.tar.gz -p $port
else
echo "use: start nlu <lang> <port>"
fi
;;
"nlu_multilang")
$python -m saai.multi_nlu_servant
;;
*)
# default proc
handle_cmd ${@:1}
;;
esac
fi