]> Git — Sourcephile - gargantext.git/blob - devops/debian/install
max cliques with apax to 2
[gargantext.git] / devops / debian / install
1 #!/bin/bash
2
3 # ____ _ _
4 # / ___| __ _ _ __ __ _ __ _ _ __ | |_ _____ _| |_
5 # | | _ / _` | '__/ _` |/ _` | '_ \| __/ _ \ \/ / __|
6 # | |_| | (_| | | | (_| | (_| | | | | || __/> <| |_
7 # \____|\__,_|_| \__, |\__,_|_| |_|\__\___/_/\_\\__|
8 # |___/
9
10 # This receipe is for specific use (Open Stack && Debien)
11 # Step by step installation process (advanced user mainly)
12 # For others: a docker image is coming
13
14 ########################################################################
15 # To be sure to have updated packages
16 sudo apt update
17 sudo apt upgrade
18
19 # Tmux to avoid disconnections during the installation process
20 # Htop for visual monitoring
21 sudo apt install tmux htop
22
23 ########################################################################
24 tmux
25 ########################################################################
26 # Open Stack only: attach volumes
27 # attach the volume created (OS interface or API)
28 sudo fdisk -l
29 sudo fisk /dev/vdb (n,p,t,83,w)
30 sudo mkfs.ext4 /dev/vdb1
31
32 sudo blkid
33 # copy UUID in fstab (same parameters)
34 sudo vim /etc/fstab
35
36 ########################################################################
37
38 sudo sed -i "s/stretch/buster/g" /etc/apt/sources.list
39 sudo apt update
40 sudo apt dist-upgrade
41 # sudo reboot #recommended
42 ########################################################################
43
44 sudo apt update
45 sudo apt install liblzma-dev libpcre3-dev libblas-dev liblapack-dev pkg-config libgsl-dev libbz2-dev postgresql postgresql-server-dev-11 nginx libigraph0-dev
46
47
48 sudo apt install git
49 git config --global user.email "contact@gargantext.org"
50 git config --global user.name "Gargantua"
51
52
53 ########################################################################
54
55 echo "Which user?"
56 read USER
57 USER="gargantua"
58 sudo adduser --disabled-password --gecos "" $USER
59
60 cd /home
61 sudo mv -if /home/$USER /srv/
62 sudo ln -s /srv/$USER
63
64 curl -sSL https://get.haskellstack.org/ | sh
65
66 sudo apt install curl
67 sudo su $USER
68 stack update
69 stack upgrade
70
71 git clone https://gitlab.iscpif.fr/gargantext/haskell-gargantext.git
72
73 cd haskell-gargantext
74 ##########
75 git clone https://gitlab.iscpif.fr/gargantext/purescript-gargantext
76 cd purescript-gargantext
77
78 # as sudoer
79 curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
80 echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
81 sudo apt update
82 sudo apt install yarn
83 # as user
84 yarn install && yarn install-ps && yarn build
85
86 # temporary bug (help welcome)
87 cp src/index.html dist/index.html
88
89 #########################################################################
90
91 # stack install should be enough but all process is the following steps
92 stack setup && stack build && stack install
93
94 #########################################################################
95 # build deps
96
97
98 #!/bin/bash
99 mkdir deps
100 cd deps
101
102 git clone https://gitlab.iscpif.fr/gargantext/clustering-louvain-cplusplus.git
103 cd clustering-louvain-cplusplus
104 ./install
105 cd ..
106
107 sudo apt install default-jdk
108 wget https://dl.gargantext.org/coreNLP.tar.bz2
109 tar xvjf coreNLP.tar.bz2
110 # CoreNLP needs to be started
111 # ./startServer.sh
112
113
114
115 # Specific to our servers
116
117 #### Configure timezone and locale ###################################
118 # todo sync dates
119 #echo "########### LOCALES & TZ #################"
120 #echo "Europe/Paris" > /etc/timezone
121 #dpkg-reconfigure --frontend=noninteractive tzdata
122 ##ENV TZ "Europe/Paris"
123 #
124 #sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
125 #sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
126 #locale-gen && \
127 #update-locale LANG=fr_FR.UTF-8 && \
128 #update-locale LANGUAGE=fr_FR.UTF-8 && \
129 #update-locale LC_ALL=fr_FR.UTF-8
130 #################################################################
131
132 # Database configuration
133 # CREATE USER gargantua WITH PASSWORD $(grep DB_PASS gargantext.ini)
134 # GRANT ALL PRIVILEGES ON DATABASE gargandbV4 to gargantua
135
136 #######################################################################
137 ## POSTGRESQL DATA (as ROOT)
138 #######################################################################
139
140 PGVersion = 11
141 GARGDATA = "/srv/gargantua/gargandata"
142 mkdir $GARGDATA
143 sudo apt install rsync
144 sudo sed -iP "s%^data_directory.*%data_directory = \'$GARGADATA\'%" /etc/postgresql/$PGVersion/main/postgresql.conf
145 sudo rsync -av /var/lib/postgresql/$PGVersion/main $GARGDATA
146
147 # configure the database with script in devops/postgres
148 # edit gargantext.ini
149
150
151
152 ..........,,;;;;,,,oKXNNNNNNNNNXXXXXKK0OOxdl::ccc:::::;;;;,,,'..
153 .........';;;;;;,,,,'''''''''dXNMMMMMMMMMMMMMMMMMMMWWWNNNWNNNNNNXXXXKKK0Oxddlcc::::::::;;;,,,'....
154 .........',,,;;;;,,,'''''''''''''''''''oXNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWWWWWNNNNNNNXXXXKKK0Oxddlcccc::;;
155 .::cccllc:;''''''''''''''''''''.''''''''oXNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNNNXXXXKK0O
156 ...';;;;;;;;;,'''''''''''''''''''''''''''''oXNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWWWWNNNNNNX0
157 ;;,,'''''''''''''''''''''''''''''''''''''''oXNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
158 '''''''''''''''''''''''''''''''''',;:::cclldkOOOOO00000KKKXXNWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNX
159 '''''''''''''''''''''''''''';:loodkkOO0KKXXkc:;;;;:::::cccloodxkkO0NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNX
160 ''''''''''''''''''','''''',,:okKKNMMMMMMMMMk;,'''''''',''''''',;;cd0MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNX
161 ''''''''''''''''''''''',:lxxk0KNNWMWWWNXKKKkoooolllcc:;,''''''',,:lOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
162 ''''''''''''''''''',:llx0XWWMMWWWX0kddolcccx0KXXXXKKK0Okxxo:;'''';:OMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
163 '''''''''''''''''':oOXXNMMMMNXOddl:,'''''''oXNMMMMMMMMMMWWX0l'''';:kMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
164 '''''''''''''''':lONWMMMMNXXkl:,,''''''''''dXNMMMMMMMMMMMMWWx,,'';:kMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
165 ,'''''''''''',::xXNMMMMWWOoo:''''''''''''''dXNMMMMWNNNNWWWMMk:;'';cOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
166 ,'''''''''''':oo0MMMMMMWXd,,,,''''''''''',,dXNMMMMNXXXXNWWMMOc;'';cOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
167 '''''''''''''lOOXMMMMMMXkl'''''''''''''''''dXNMMWNKOOOO0KKNMKxoccod0MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
168 ,'''''''''',:kWWWMMMWWWk:,'''''''''''''''''dXNMMXOkxxxxxxx0NNNXKKKXNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
169 ,''''''''''cxKMMMMMMNKKo'''''''''''''''''''dXNMMXOkxxxxxxx0NWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
170 '''''''''''oKNMMMMMMKddc'''''''''''''''''''dXWMMNX0OOOkO00XWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
171 ,''''''''''dNWMMMMMM0oo:'''''''''''''''''''oXNMMWWX000OKNNWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
172 ,'''''''',,xWWMMMMMMOcc;'''''''''''''''''''oXNMMMWNNNXXNWWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
173 ,''''''',;;kMMMMMMMMk;;,'''''''''''''''''''dXWMMMMMMMMWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
174 ,''''''',::kMMMMMMMMk;;,'''''''''''''''''''dXNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
175 ,''''''';::kMMMMMMMMk;;,'''''''''''''''''''dXNMMNKOkkkkkkkkkkkkkkkkkkkkkOOOXMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
176 ,''''''',;;kMMMMMMMMO::;'''''''''''''''''''dXNMMKxo::::;,,,,,,,,,,,;;;;:cll0MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
177 ,''''''',,,kMMMMMMMMOcc;'''''''''''''''''''oXNMMXkocc::;,,,''''''''',,;:loo0MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
178 ,'''''''',,xWWMMMMMM0ll:'''''''''''''''''''oXNMMNX0OOOkkxxc'''''',,cxxkkO00XMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
179 ,''''''''''oKNMMMMMMKkkc'''''''''''''''''''dXWMMMMMMMMMWWWx,,'''',;kMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
180 ,''''''''''cdKMMMMMMNXXo'''''''''''''''''''dXWMMMMMMMMMMMMk,,'''',:kMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
181 ,'''''''''',;xWWWMMMMWWk:;'''''''''''''''''dXNMMMMMMMMMMMMk,,'''',:kMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNX
182 ,''''''''''''lkkKMMMMMMX0o'''''''''''''''''dXNMMMMMMMMMMMMx,,'''',:kMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
183 ,'''''''''''':llOMMMMMMWWx,,,''''''''''''''dXNWWMMMMMMMMMMk,,'''',:kMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
184 ,'''''''''''',::xXNMMMMMW0oo:''''''''''''''dXNMMMMMMMMMMMMk,,'''',;kMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWX
185 ;,,''''''''''''':lONWMMMMWNNOl:''''''''''''oXNMMMMMMMMMMMMx,,'''',:kMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNX
186 .';,,,,''''''''''':dONNWMMMMWXOddl:,'''''''dXNMMMMMMMMMMMMk,,'''',:kMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNX
187 .',,,;,''''',,''',:ookKNMMMMWWWXOxddlc:;;xXNWWWWWWWNXXKKd,,'''',:kMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNX
188 .'',:;''''''''''''''cxKMMMMMMMMMWNN0xollxKXWWWWNXXK0Okkl,''''';:kWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNX
189 ....';;,''''''''''';cokk0XWMMMMWWWXK0OOkxxxxdddddoolcc;'''',,:lOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNK0
190 ...,;,,,,'''',,'',,,:odkkO0KXXNNWWWk:;'''',,,;;:ccclodxkkO0XMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNNNX0kko:;,
191 .';;;;,'''''''''''',,;:clloodddxxxxxxxkkkOO000KXNWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNNXX0kocc:;'..
192 ....';,''''''''''''''''''''''dXNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNNXX0koc:;;'.
193 ..,;;;,''''''''''''''''''dXNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWWWNXKOOd::;;'.
194 .cc:,''''''''''''''''''dXWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNXXK0dcc.
195 ...,;;,,,''''''''''''''dXWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNNNNKOdcc::,...
196 ..'',;,''''''''''''oXNMMMMMMMMMMMMMMMMMMMMMMMMMMWNNNXKOOd::::,..
197 ..';;,'''''''''oKNMMMMMMMMMMMMMMMMMMMWWNXXKOd::::,...
198 ..';;,,,''''oXNMMMMMMMMMMMMWWNXKOOdc:;;,.. TODO, too big, what diet for this ascii art ?
199 .::;;,''''oXNWWMMMMMMMMMMWNK0d::.
200 ..',,,,,''oKNMMMMWWWNX0OOdc:;,..
201 ....';;o0KXXKOdcc:;,...
202 .ccdOO00xl.
203
204