Project

General

Profile

MLCR Deployment » History » Version 36

Rogers, Chris, 09 July 2013 11:10

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 36 Rogers, Chris
Nb: in a few places we have @/usr/sbin/service@; on some systems this should just be @/sbin/service@
115
116 27 Rogers, Chris
h3. Install MongoDB
117 29 Rogers, Chris
118
MongoDB can be installed using @yum@ as follows.
119
120
 * Log in as a super-user by using @sudo su -@ or @su@.
121
 * Edit @/etc/yum.repos.d/10gen.repo@ and add the lines
122
<pre>
123
[10gen]
124
name=10gen Repository
125
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
126
gpgcheck=0
127
</pre>
128
 * Run 
129
<pre>
130
$ yum install mongo-10gen
131
 ...
132
 mongo-10gen         i686         2.0.1-mongodb_1           10gen          28 M
133
 ...
134
$ yum install mongo-10gen-server
135
 ...
136
 mongo-10gen-server       i686       2.0.1-mongodb_1          10gen       5.4 M
137
...
138
</pre>
139
 * Start the server
140
<pre>
141 35 Rogers, Chris
$ /usr/sbin/service mongod start
142 29 Rogers, Chris
Starting mongod: forked process: 4357
143
                                                           [  OK  ]
144
all output going to: /var/log/mongo/mongod.log
145 35 Rogers, Chris
$ /usr/sbin/service mongod status
146 29 Rogers, Chris
mongod (pid 4357) is running...
147
</pre>
148
(as an alternative to @service mongod@ you can use @/etc/init.d/mongod@)
149
150
By default MongoDB is available on http://localhost:27017/.
151
152 27 Rogers, Chris
153 28 Rogers, Chris
h3. Install RabbitMQ
154
155
To install on Scientific Linux or RedHat you should:
156
157 34 Rogers, Chris
* Follow the rabbitmq installation guide "here":http://www.rabbitmq.com/install-rpm.html
158
** Install erlang from VMware 
159
** Install rabbitmq-server
160 28 Rogers, Chris
* Log in as a super-user by using @sudo su -@ or @su@.
161
* Run:
162
<pre>
163
$ yum install rabbitmq-server
164
165
Installing:
166
 rabbitmq-server        noarch        2.2.0-1.el5          epel           890 k
167
Installing for dependencies:
168
 erlang                 i386          R12B-5.10.el5        epel            39 M
169
 unixODBC               i386          2.2.11-7.1           sl-base        832 k
170
</pre>
171
* Start the RabbitMQ server:
172
<pre>
173 35 Rogers, Chris
$ /usr/sbin/service rabbitmq-server start
174 28 Rogers, Chris
</pre>
175
* Create a MAUS username and password pair e.g.
176
<pre>
177
$ rabbitmqctl add_user maus suam
178
Creating user "maus" ...
179
...done.
180
</pre>
181
* Create a MAUS virtual host:
182
<pre>
183
$ rabbitmqctl add_vhost maushost
184
Creating vhost "maushost" ...
185
...done.
186
</pre>
187
* Set the permissions for the user on this host:
188
<pre>
189
$ rabbitmqctl set_permissions -p maushost maus ".*" ".*" ".*"
190
Setting permissions for user "maus" in vhost "maushost" ...
191
...done.
192
</pre>
193
* Check it is running OK:
194
<pre>
195
$ /sbin/service rabbitmq-server status
196
Status of all running nodes...
197
Node 'rabbit@maus' with Pid 1377: running
198
done.
199
</pre>
200
201
Default port:
202
203
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.