-
Notifications
You must be signed in to change notification settings - Fork 2
/
install_ml.sh
executable file
·49 lines (39 loc) · 1.46 KB
/
install_ml.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
#!/bin/bash
#####################################################
#Script to Install the Giotto Machine Learning layer#
#####################################################
service=supervisor
echo 'Please make sure that you have installed BuildingDepot before proceeding forward!!\n'
if [[ $UID -ne 0 ]]; then
echo -e "\n$0 must be run as root. Most functions require super-user priviledges!\n"
exit 1
fi
#Copy code and path to PYTHON PATH
mkdir -p /srv
cp -r giotto/ /srv/
cp supervisor-ml.conf /etc/supervisor/conf.d/
echo 'export PYTHONPATH=${PYTHONPATH}:/srv' >> ~/.bashrc
source ~/.bashrc
echo -e "\nPlease provide the hostname or IP address of your BuildingDepot installation."
read bd_hostname
sed -i "s|<host_name>|$bd_hostname|g" /srv/giotto/config/buildingdepot_setting.json
echo -e "Please enter the OAuth id and key generated from your Dataservice (http://<hostname>:82)."
echo -e "OAuth Id:"
read oauth_id
echo -e "OAuth Key:"
read oauth_key
sed -i "s|<oauth_id>|$oauth_id|g" /srv/giotto/config/buildingdepot_setting.json
sed -i "s|<oauth_key>|$oauth_key|g" /srv/giotto/config/buildingdepot_setting.json
function install_packages {
#Install python dependencies
apt-get install python-numpy python-scipy python-sklearn
pip install pymongo==2.8.0
pip install influxdb==2.6.0
}
install_packages
service supervisor stop
echo -e "Please wait!"
while (( ($(service supervisor status | grep "is running" | wc -l)) > 0 ));do
continue
done
service supervisor start