Project

General

Profile

MLCR Deployment » History » Version 34

Rogers, Chris, 09 July 2013 11:04

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 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
44
# Check the updated installation functions correctly by following the "shifter instructions":http://micewww.pp.rl.ac.uk/documents/32
45 9 Rogers, Chris
** A cosmics run is ideal
46 7 Rogers, Chris
# Remove the old old release @rm -rf .maus_release_old_@
47 18 Rogers, Chris
# Add a note in the ELog
48 7 Rogers, Chris
# Email MOGUL head and MOM to let them know that something changed
49 6 Rogers, Chris
50 4 Rogers, Chris
51 2 Rogers, Chris
52 5 Rogers, Chris
h2. New version of control room branch
53 1 Rogers, Chris
54 15 Rogers, Chris
55 1 Rogers, Chris
To update the control room branch
56
57 30 Rogers, Chris
# Let MOM and MAUS online person know what you are doing.
58 20 Rogers, Chris
# cd MAUS/.maus_control_room
59
# @bzr update@
60
# @./install_build_test.bash@
61 1 Rogers, Chris
# Run whatever tests you want
62 20 Rogers, Chris
63 30 Rogers, Chris
h2. New version of cdb branch
64 1 Rogers, Chris
65 30 Rogers, Chris
To update the cdb branch
66
67
# Let MOM and MAUS online person know what you are doing 
68
# @cd MAUS/.maus_cdb@
69
# @bzr update@
70
# @rm bin/analyze_data_online@
71
# @./install_build_test.bash ../.maus_release@
72
# Run whatever tests you want
73 9 Rogers, Chris
74 16 Rogers, Chris
h2. -Apache server- (Not used)
75 1 Rogers, Chris
76
If you want to use the Apache web server, then:
77
78
* Configure the web server,
79
<pre>
80
cd /home/mice/MAUS.new/maus-apps
81
./configure
82
rm -rf media/thumbs/*
83
rm -rf media/raw/*
84
</pre>
85
* As super user, restart Apache,
86
<pre>
87
/usr/local/apache2/bin/apachectl restart
88
</pre>
89
* Check the logs,
90
<pre>
91
more /usr/local/apache2/logs/error_log 
92
</pre>
93
* You should see something like,
94
<pre>
95
[Mon Mar 12 12:41:16 2012] [notice] Apache/2.2.22 (Unix) mod_wsgi/3.3 
96
 Python/2.7.2 configured -- resuming normal operations
97
</pre>
98
* If you get a warning like,
99
<pre>
100
httpd: Syntax error on line 55 of /usr/local/apache2/conf/httpd.conf: 
101
Cannot load /usr/local/apache2/modules/mod_wsgi.so into server: libpython2.7.so.1.0: 
102
cannot open shared object file: No such file or directory
103
</pre>
104
** Then unset @MAUS_ROOT_DIR@ and try again:
105
<pre>
106
unset MAUS_ROOT_DIR
107
/usr/local/apache2/bin/apachectl restart
108
</pre>
109 27 Rogers, Chris
110
h2. Install from Scratch
111
112 29 Rogers, Chris
The following libraries/services need to be installed and do not come as part of the MAUS prepacked stuff.
113
114 27 Rogers, Chris
h3. Install MongoDB
115 29 Rogers, Chris
116
MongoDB can be installed using @yum@ as follows.
117
118
 * Log in as a super-user by using @sudo su -@ or @su@.
119
 * Edit @/etc/yum.repos.d/10gen.repo@ and add the lines
120
<pre>
121
[10gen]
122
name=10gen Repository
123
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
124
gpgcheck=0
125
</pre>
126
 * Run 
127
<pre>
128
$ yum install mongo-10gen
129
 ...
130
 mongo-10gen         i686         2.0.1-mongodb_1           10gen          28 M
131
 ...
132
$ yum install mongo-10gen-server
133
 ...
134
 mongo-10gen-server       i686       2.0.1-mongodb_1          10gen       5.4 M
135
...
136
</pre>
137
 * Start the server
138
<pre>
139
$ /sbin/service mongod start
140
Starting mongod: forked process: 4357
141
                                                           [  OK  ]
142
all output going to: /var/log/mongo/mongod.log
143
$ /sbin/service mongod status
144
mongod (pid 4357) is running...
145
</pre>
146
(as an alternative to @service mongod@ you can use @/etc/init.d/mongod@)
147
148
By default MongoDB is available on http://localhost:27017/.
149
150 27 Rogers, Chris
151
h3. Install RabbitMQ
152 28 Rogers, Chris
153
154
To install on Scientific Linux or RedHat you should:
155
156 34 Rogers, Chris
* Follow the rabbitmq installation guide "here":http://www.rabbitmq.com/install-rpm.html
157
** Install erlang from VMware 
158
** Install rabbitmq-server
159 28 Rogers, Chris
* Log in as a super-user by using @sudo su -@ or @su@.
160
* Run:
161
<pre>
162
$ yum install rabbitmq-server
163
164
Installing:
165
 rabbitmq-server        noarch        2.2.0-1.el5          epel           890 k
166
Installing for dependencies:
167
 erlang                 i386          R12B-5.10.el5        epel            39 M
168
 unixODBC               i386          2.2.11-7.1           sl-base        832 k
169
</pre>
170
* Check that @/usr/sbin@ is in the @PATH@:
171
<pre>
172
$ echo %PATH
173
...
174
</pre>
175
* If not, then add it:
176
<pre>
177
$ export PATH=$PATH:/usr/sbin
178
</pre>
179
* Start the RabbitMQ server:
180
<pre>
181
$ /sbin/service rabbitmq-server start
182
</pre>
183
* Create a MAUS username and password pair e.g.
184
<pre>
185
$ rabbitmqctl add_user maus suam
186
Creating user "maus" ...
187
...done.
188
</pre>
189
* Create a MAUS virtual host:
190
<pre>
191
$ rabbitmqctl add_vhost maushost
192
Creating vhost "maushost" ...
193
...done.
194
</pre>
195
* Set the permissions for the user on this host:
196
<pre>
197
$ rabbitmqctl set_permissions -p maushost maus ".*" ".*" ".*"
198
Setting permissions for user "maus" in vhost "maushost" ...
199
...done.
200
</pre>
201
* Check it is running OK:
202
<pre>
203
$ /sbin/service rabbitmq-server status
204
Status of all running nodes...
205
Node 'rabbit@maus' with Pid 1377: running
206
done.
207
</pre>
208
209
Default port:
210
211
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.