Project

General

Profile

MLCR Deployment » History » Version 30

Rogers, Chris, 27 June 2013 11:51

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