Project

General

Profile

MLCR Deployment » History » Version 40

Rogers, Chris, 15 July 2013 14:58

1 1 Rogers, Chris
h1. MLCR Deployment
2
3 31 Rogers, Chris
* The MAUS online person is *Chris Rogers*
4
5 30 Rogers, Chris
There are four installations of MAUS in the MICE Local Control Room:
6 1 Rogers, Chris
7
* The current version @.maus_release@ (bound to lp:maus)
8
* The previous version @.maus_release_old@ (bound to lp:maus)
9
* A development copy @.maus_control-room@ (bound to lp:~maus-mlcr/maus/control-room/)
10 30 Rogers, Chris
* A copy for cdb uploads @.maus_cdb@ (bound to lp:maus, third party libraries from .maus_release)
11 1 Rogers, Chris
12 32 Rogers, Chris
The current and previous version are updated by leapfrogging; at the moment only the control-room version is used for online reconstruction, the control room stuff was never merged into the trunk. Note that versions are in hidden folders (prefixed by '.'). To see them do 
13
14
<pre>cd MAUS
15
ls -a</pre> 
16
17
There is a soft link that points to the "default" version (for use by shifters). This should usually point at the current version @.maus_release@.
18 1 Rogers, Chris
19 33 Rogers, Chris
There is also a .maus_cdb version, specifically for doing uploads/etc. This is hackable, but the MAUS online person will occasionally clean it out, so don't leave code there. It is disabled for running online recon, however.
20 30 Rogers, Chris
21 2 Rogers, Chris
h2. New version of main MAUS release
22
23 1 Rogers, Chris
To update to a new version:
24
25 15 Rogers, Chris
# Let MOM know what you are doing
26 3 Rogers, Chris
# First move the current MAUS install onto the fall back release
27 12 Rogers, Chris
## @mv .maus_release_old .maus_release_old_@
28
## @mv .maus_release .maus_release_old@
29
## Reconfigure the old install 
30
*** @cd .maus_release_old; ./configure; source env.sh@
31 13 Rogers, Chris
## Check it is okay
32
*** @bash tests/unit_tests.bash; bash tests/application_tests.bash@
33 3 Rogers, Chris
# Next get the current MAUS release copy (or a version as specified by MAUS experts)
34 21 Rogers, Chris
## Do @bzr checkout lp:maus .maus_release@
35 4 Rogers, Chris
## Build the code @cd .maus_release; ./install_build_test.bash@
36 24 Rogers, Chris
## Rebuild with added online library @bash third_party/bash/70daq.bash; scons -j8@
37 23 Rogers, Chris
## Run the integration tests @bash tests/application_tests.bash >& application_tests.log@
38
*** If there is a SKIPPED, this is bad - should not skip any tests
39 26 Rogers, Chris
*** If you are working through a terminal, there is a test which fails if you don't forward X11 connections (test_help.py)
40 6 Rogers, Chris
## Check that the online libraries are running okay @python python tests/integration/test_distributed_processing/_test_online_okay.py@
41 22 Rogers, Chris
## Run @tests/integration/test_analyze_data_online/test_analyze_data_online.py@. -Bring up a browser and look at pretty plots.-
42 6 Rogers, Chris
## Check that the integration tests passed; check that analyze_data_online and test_multi_vs_single_threaded tests did not skip.
43 40 Rogers, Chris
## @cp bin/online/online_env.sh   ./all.sh@
44 19 Rogers, Chris
# Check for changes in power cycle procedure [[Onrec_power_cycle_procedure]] or "shifter instructions":http://micewww.pp.rl.ac.uk/documents/32
45
# Check the updated installation functions correctly by following the "shifter instructions":http://micewww.pp.rl.ac.uk/documents/32
46 9 Rogers, Chris
** A cosmics run is ideal
47 7 Rogers, Chris
# Remove the old old release @rm -rf .maus_release_old_@
48 18 Rogers, Chris
# Add a note in the ELog
49 7 Rogers, Chris
# Email MOGUL head and MOM to let them know that something changed
50 6 Rogers, Chris
51 4 Rogers, Chris
52 2 Rogers, Chris
53 5 Rogers, Chris
h2. New version of control room branch
54 1 Rogers, Chris
55 15 Rogers, Chris
56 1 Rogers, Chris
To update the control room branch
57
58 30 Rogers, Chris
# Let MOM and MAUS online person know what you are doing.
59 20 Rogers, Chris
# cd MAUS/.maus_control_room
60
# @bzr update@
61
# @./install_build_test.bash@
62 1 Rogers, Chris
# Run whatever tests you want
63 20 Rogers, Chris
64 30 Rogers, Chris
h2. New version of cdb branch
65 1 Rogers, Chris
66 30 Rogers, Chris
To update the cdb branch
67
68
# Let MOM and MAUS online person know what you are doing 
69
# @cd MAUS/.maus_cdb@
70
# @bzr update@
71
# @rm bin/analyze_data_online@
72
# @./install_build_test.bash ../.maus_release@
73
# Run whatever tests you want
74 9 Rogers, Chris
75 16 Rogers, Chris
h2. -Apache server- (Not used)
76 1 Rogers, Chris
77
If you want to use the Apache web server, then:
78
79
* Configure the web server,
80
<pre>
81
cd /home/mice/MAUS.new/maus-apps
82
./configure
83
rm -rf media/thumbs/*
84
rm -rf media/raw/*
85
</pre>
86
* As super user, restart Apache,
87
<pre>
88
/usr/local/apache2/bin/apachectl restart
89
</pre>
90
* Check the logs,
91
<pre>
92
more /usr/local/apache2/logs/error_log 
93
</pre>
94
* You should see something like,
95
<pre>
96
[Mon Mar 12 12:41:16 2012] [notice] Apache/2.2.22 (Unix) mod_wsgi/3.3 
97
 Python/2.7.2 configured -- resuming normal operations
98
</pre>
99
* If you get a warning like,
100
<pre>
101
httpd: Syntax error on line 55 of /usr/local/apache2/conf/httpd.conf: 
102
Cannot load /usr/local/apache2/modules/mod_wsgi.so into server: libpython2.7.so.1.0: 
103
cannot open shared object file: No such file or directory
104
</pre>
105
** Then unset @MAUS_ROOT_DIR@ and try again:
106
<pre>
107
unset MAUS_ROOT_DIR
108
/usr/local/apache2/bin/apachectl restart
109
</pre>
110 27 Rogers, Chris
111
h2. Install from Scratch
112
113 29 Rogers, Chris
The following libraries/services need to be installed and do not come as part of the MAUS prepacked stuff.
114
115 36 Rogers, Chris
Nb: in a few places we have @/usr/sbin/service@; on some systems this should just be @/sbin/service@
116
117 27 Rogers, Chris
h3. Install MongoDB
118 29 Rogers, Chris
119
MongoDB can be installed using @yum@ as follows.
120
121
 * Log in as a super-user by using @sudo su -@ or @su@.
122
 * Edit @/etc/yum.repos.d/10gen.repo@ and add the lines
123
<pre>
124
[10gen]
125
name=10gen Repository
126
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
127
gpgcheck=0
128
</pre>
129 38 Rogers, Chris
* Run 
130 29 Rogers, Chris
<pre>
131
$ yum install mongo-10gen
132
 ...
133
 mongo-10gen         i686         2.0.1-mongodb_1           10gen          28 M
134
 ...
135
$ yum install mongo-10gen-server
136
 ...
137
 mongo-10gen-server       i686       2.0.1-mongodb_1          10gen       5.4 M
138
...
139 1 Rogers, Chris
</pre>
140 38 Rogers, Chris
* Check @/usr/bin/mongod@ executes properly
141
** Trying this on a 64 bit system, failed because the 10gen-server install is a 32 bit build; so required some 32 bit dependencies like @libstdc++-4.4.7-3.el6.i686@, @glibc-2.12-1.107.el6.i686@ 
142
* Start the server
143 29 Rogers, Chris
<pre>
144 35 Rogers, Chris
$ /usr/sbin/service mongod start
145 29 Rogers, Chris
Starting mongod: forked process: 4357
146
                                                           [  OK  ]
147
all output going to: /var/log/mongo/mongod.log
148 35 Rogers, Chris
$ /usr/sbin/service mongod status
149 29 Rogers, Chris
mongod (pid 4357) is running...
150
</pre>
151
(as an alternative to @service mongod@ you can use @/etc/init.d/mongod@)
152
153
By default MongoDB is available on http://localhost:27017/.
154
155 27 Rogers, Chris
156 28 Rogers, Chris
h3. Install RabbitMQ
157
158
To install on Scientific Linux or RedHat you should:
159
160 34 Rogers, Chris
* Follow the rabbitmq installation guide "here":http://www.rabbitmq.com/install-rpm.html
161
** Install erlang from VMware 
162 37 Rogers, Chris
** Install rabbitmq-server by running as su:
163 28 Rogers, Chris
<pre>
164
$ yum install rabbitmq-server
165
166
Installing:
167
 rabbitmq-server        noarch        2.2.0-1.el5          epel           890 k
168
Installing for dependencies:
169
 erlang                 i386          R12B-5.10.el5        epel            39 M
170
 unixODBC               i386          2.2.11-7.1           sl-base        832 k
171
</pre>
172
* Start the RabbitMQ server:
173
<pre>
174 35 Rogers, Chris
$ /usr/sbin/service rabbitmq-server start
175 28 Rogers, Chris
</pre>
176
* Create a MAUS username and password pair e.g.
177
<pre>
178
$ rabbitmqctl add_user maus suam
179
Creating user "maus" ...
180
...done.
181
</pre>
182
* Create a MAUS virtual host:
183
<pre>
184
$ rabbitmqctl add_vhost maushost
185
Creating vhost "maushost" ...
186
...done.
187
</pre>
188
* Set the permissions for the user on this host:
189
<pre>
190
$ rabbitmqctl set_permissions -p maushost maus ".*" ".*" ".*"
191
Setting permissions for user "maus" in vhost "maushost" ...
192
...done.
193
</pre>
194
* Check it is running OK:
195
<pre>
196
$ /sbin/service rabbitmq-server status
197
Status of all running nodes...
198
Node 'rabbit@maus' with Pid 1377: running
199
done.
200
</pre>
201
202
Default port:
203
204
By default RabbitMQ uses port 5672. If you want worker nodes outside your firewall to use the RabbitMQ broker then you will need to open this port.