-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·103 lines (74 loc) · 2.49 KB
/
install.sh
File metadata and controls
executable file
·103 lines (74 loc) · 2.49 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
VENV=".venv"
usage(){
echo "install maple project."
echo ""
echo "Syntax:"
echo "./install.sh [-hpg] "
echo
echo "options"
echo "h help"
echo "p create pm2 tasks"
echo "g install required python packages."
echo
}
install_packages(){
[ -d $VENV ] && echo "$VENV already exists" || python3 -m venv $VENV
source $VENV/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install scrapy-fake-useragent
pip install scrapy-playwright
playwright install chromium
pip install --upgrade pip setuptools
pip install python-socketio python-socketio[client]
cd maple_structures
pip install -e .
cd ../maple_proc
pip install -e .
pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.6.0/en_core_web_sm-3.6.0.tar.gz
cd ../maple_interface
pip install -e .
cd ../maple_config
pip install -e .
cd ../maple_chat
pip install -e .
cd ../
cdir=$(pwd)
cd ~
[ -d rcs-utils ] && echo "rcs directory already exist" || git clone git@github.com:ResearchComputingServices/rcs-utils.git
cd rcs-utils
git pull
pip install -e .
cd ../
[ -d RTPTResearch ] && echo "RTPTResearch directory already exist" || git clone git@github.com:ResearchComputingServices/RTPTResearch.git
cd RTPTResearch
git pull
pip install -e .
cd $cdir
}
create_pm2_tasks(){
pm2 delete chatgpt 2> /dev/null && pm2 start runtime_scripts/chatgpt.py --interpreter .venv/bin/python3
pm2 delete data_fetcher 2> /dev/null && pm2 start runtime_scripts/data_fetcher.py --interpreter .venv/bin/python3 -- -e prod -i 600 -l info
pm2 delete delete_model_iteration 2> /dev/null && pm2 start runtime_scripts/delete_model_iteration.py --interpreter .venv/bin/python3 -- -t old -a -c -l debug --use_config
pm2 delete maple_models_bert 2> /dev/null && pm2 start runtime_scripts/maple_models.py --interpreter .venv/bin/python3 --name maple_models_bert -- --model bert --level debug --logname maple_models_bert
pm2 save
pm2 kill
pm2 resurrect
pm2 startup
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u $USER --hp $HOME
}
while getopts "hpg" arg; do
case "${arg}" in
p)
create_pm2_tasks
;;
g)
install_packages
;;
h)
usage
exit
;;
esac
done