-
Notifications
You must be signed in to change notification settings - Fork 6
/
install.sh
executable file
·129 lines (110 loc) · 4.34 KB
/
install.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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
echo '>> Updating information about packages...' >&2
sudo apt-get -y update
echo '>> Installing dependencies...' >&2
sudo apt-get -y install vim git python python-dev python-pip python-virtualenv build-essential libsqlite3-dev virtualenvwrapper python-numpy libffi-dev curl
echo '>> Removing default X server...' >&2
sudo service xserver stop
sudo rm /etc/init.d/xserver && sudo update-rc.d xserver remove
sudo killall Xorg
echo '>> Setting up Xfce...' >&2
sudo apt-get -y install xfce4 xserver-xorg-legacy
sudo sh -c '(echo "allowed_users=anybody"; echo "needs_root_rights=yes") > /etc/X11/Xwrapper.config'
sudo ed /etc/xdg/xfce4/xinitrc <<'END'
1a
unset SSH_CONNECTION
.
wq
END
echo '>> Setting up virtualenvwrapper...' >&2
rm -rf .virtualenvs
mkdir .virtualenvs
echo -e "\nexport WORKON_HOME=$HOME/.virtualenvs\nsource /usr/share/virtualenvwrapper/virtualenvwrapper.sh" >>.bash_profile
. .bash_profile
cd reprozip-examples
echo '>> Installing dependencies for digits-sklearn...' >&2
cd digits-sklearn/
mkvirtualenv --system-site-packages digits-sklearn
#sudo apt-get -y install libblas-dev liblapack-dev gfortran
pip install -r requirements.txt
deactivate
cd ..
echo '>> Installing dependencies for digits-sklearn-opencv...' >&2
cd digits-sklearn-opencv/
sudo apt-get -y install python-opencv
mkvirtualenv --system-site-packages digits-sklearn-opencv
pip install -r requirements.txt
deactivate
cd ..
echo '>> Installing dependencies for object-tracking...' >&2
cd object-tracking/
mkvirtualenv --system-site-packages object-tracking
pip install -r requirements.txt
deactivate
cd ..
echo '>> Downloading MNIST dataset from OSF...' >&2
mkdir -p $HOME/scikit_learn_data/mldata
curl -Lo $HOME/scikit_learn_data/mldata/mnist-original.mat 'https://files.osf.io/v1/resources/8uxpv/providers/osfstorage/58488b3a594d9001fa6debdf?direct=true&action=download'
echo '>> Installing dependencies for bechdel-test...' >&2
cd bechdel-test/
mkvirtualenv --system-site-packages bechdel-test
pip install -r requirements.txt
deactivate
cd ..
echo '>> Installing dependencies for irish-schools...' >&2
sudo apt-get -y install r-base r-cran-ggplot2
echo '>> Installing dependencies for bus-vis...' >&2
cd bus-vis/
sudo apt-get -y install default-jre default-jdk maven
test -e BusVis || git clone https://github.com/JosuaKrause/BusVis.git
cd BusVis/
mvn clean package
cd ../..
echo '>> Installing dependencies for stacked-up...' >&2
cd stacked-up
mkvirtualenv --system-site-packages stacked-up
test -e sdp_curricula || git clone https://github.com/fchirigati/sdp_curricula.git
cd sdp_curricula
sudo apt-get -y install postgresql-9.5 libpq-dev
sudo -u postgres pg_dropcluster --stop 9.5 main
sudo -u postgres pg_createcluster --port 5432 --locale en_US.UTF-8 --start 9.5 main
DB_NAME=sdp_curricula
sudo -u postgres createdb $DB_NAME
sudo -u postgres psql $DB_NAME <<END
CREATE ROLE vagrant LOGIN PASSWORD '@x1s2013';
GRANT ALL PRIVILEGES ON DATABASE $DB_NAME TO vagrant;
ALTER ROLE postgres WITH PASSWORD '@x1s2013';
END
sudo sh -c "echo 'local all all trust' >/etc/postgresql/9.5/main/pg_hba.conf"
sudo sh -c "echo 'host all all 127.0.0.1/32 trust' >>/etc/postgresql/9.5/main/pg_hba.conf"
sudo service postgresql restart
pip install -r requirements.txt
cat >manage.py <<'END'
#!/home/vagrant/.virtualenvs/stacked-up/bin/python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sdp_curricula.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
END
chmod +x manage.py
pg_restore -d $DB_NAME sdp_curricula.dump # load all the data
sudo /etc/init.d/postgresql stop
deactivate
cd ../..
echo '>> Installing brain-segmentation...' >&2
wget -O- http://neuro.debian.net/lists/xenial.au.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
sudo apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9
sudo apt-get -y update
sudo apt-get -y install python-dipy
echo '>> Installing ReproZip...' >&2
mkvirtualenv --system-site-packages reprozip
pip install --upgrade reprozip reprounzip[all]
mkdir $HOME/.bin
ln -s $HOME/.virtualenvs/reprozip/bin/reprozip $HOME/.virtualenvs/reprozip/bin/reprounzip $HOME/.bin/
echo -e 'PATH=$HOME/.bin:$PATH\nexport PATH' >>$HOME/.bash_profile
deactivate
echo '>> Installing Docker...' >&2
sudo apt-get -y install docker.io