Project

General

Profile

Start with existing ANY Linux flavor OS » History » Version 25

Amber Herold, 01/27/2010 03:10 PM

1 1 Amber Herold
h1. Start with existing ANY Linux flavor OS
2
3 3 Amber Herold
{{>toc}}
4
5 1 Amber Herold
*Appion Install Manual Referenced to Leginion Installation*
6
7
=====================
8
9
_The Appion Team_
10
11
email: *appion@scripps.edu* for any help you need.
12
13 2 Amber Herold
h2. 1. Introduction 
14 1 Amber Herold
15 2 Amber Herold
This document describes a general installation of Appion, concentrating on the installation and setup on the database and web servers.  Most sections refer to the Leginon installation documentation since the two share the same general architecture.   If you want to run real Leginon on the microscope, you just need to follow the additional installation starting from "Processing Server Window Installation Chapter of Leginon installation manual":http://emg.nysbc.org/documentation/leginon/bk02ch04s08.php.
16 1 Amber Herold
17 15 Amber Herold
h2. 2 Setup MySQL databases 
18 2 Amber Herold
19 5 Amber Herold
h3. see "Leginon database server-side installation manual":http://emg.nysbc.org/documentation/leginon/bk02ch04s06.php  for details, including how to increasing cache size. 
20 2 Amber Herold
21
h3. Preliminary steps if you have an existing project database from a previous installation 
22
23 1 Amber Herold
We need to remove a table in the project database called "install".  This will allow the new default tables to be defined when we set up on the web-server side.
24 2 Amber Herold
25
<pre>
26 1 Amber Herold
$ mysql projectdata -u usr_object
27
mysql> drop table install;
28
mysql> exit
29 2 Amber Herold
</pre>
30
31
32
h3. Additional work 
33
34 1 Amber Herold
You need to decide what prefix you will use for the processing databases.  We will be creating them on the fly later.  Our default is *ap* followed by a project id number.  More about this later.
35
At this point, you need to do the following to grant privileges to users for any database whose name starts with *ap*
36 2 Amber Herold
37
<pre>
38 1 Amber Herold
$ mysql -u root -p
39 2 Amber Herold
</pre>
40
41 1 Amber Herold
Note: If you didn't set a mysql root password, don't use -p option.
42 2 Amber Herold
43
<pre>
44 1 Amber Herold
mysql> GRANT ALL PRIVILEGES ON `ap%`.* TO usr_object@"%";
45
mysql> exit
46
</pre>
47 2 Amber Herold
48 16 Amber Herold
h2. 3 Web server side installation 
49 3 Amber Herold
50 2 Amber Herold
h3. Follow instructions in "Leginon Database server-side installation manual":http://emg.nysbc.org/documentation/leginon/bk02ch04s07.php. 
51 3 Amber Herold
52 2 Amber Herold
h3. Continue with the instructions in "Leginon Web server set up and Installation":http://emg.nysbc.org/documentation/leginon/bk02ch04s08.php. 
53 3 Amber Herold
54 2 Amber Herold
h3. Additional work 
55 3 Amber Herold
56 4 Amber Herold
* Edit project`_`1`_`2/config.php to assign the same prefix to your processing db as defined in your MyQL setup.
57 2 Amber Herold
58
<pre>
59 1 Amber Herold
$DEF_PROCESSING_PREFIX = "ap";
60 2 Amber Herold
</pre>
61
62 4 Amber Herold
* Enable the processing plug-in by uncommenting out the following line in the file`dbem_1_5_1/config.php`
63 2 Amber Herold
64
<pre>
65 1 Amber Herold
addplugin("processing");
66 2 Amber Herold
</pre>
67
68 4 Amber Herold
* Copy `dbem_1_5_1/processing/config_processing.php.template` to `dbem_1_5_1/processing/config_processing.php`
69
* Edit `dbem_1_5_1/processing/config_processing.php`
70 2 Amber Herold
71
<pre>
72 1 Amber Herold
$PROCESSING_DB_HOST = "your_db_host";
73
$PROCESSING_DB_USER = "usr_object";
74
$PROCESSING_DB_PASS = ""; 
75
$PROCESSING_DB = "";
76
</pre>
77 2 Amber Herold
78
    Remember that the last line should be kept empty as this will be set dynamically.
79 1 Amber Herold
80
We will not include the processing host or cluster registration now. It is covered in the last part of this document.
81
82 16 Amber Herold
h2. 4 Create a test project and processing database
83 2 Amber Herold
84
h3. Follow the instructions on "how to create new project":http://emg.nysbc.org/documentation/leginon/bk02ch06.php in the Leginon Manual.
85
86
h3. Additional work 
87
88
# Click on a project name on the webpage `http://your_host/project_1_2/project.php`. This will take you to a new webpage `http://your_host/project_1_2/getproject.php?pId=1`.  The number following "pId=" depends on the project id automatically assigned to the project.
89
# At the end of the Info table, you should see:
90
91
<pre>
92 1 Amber Herold
processing db*: not set (create processing db) *db name* ap1
93 2 Amber Herold
</pre>
94
95 7 Amber Herold
You can create the default numbered style database ap... or give it a new name with the same prefix.  If you want to specify a database name that does not use the default prefix, please note that your db user specified in the config.php in project_1_2 needs to have the necessary privileges for that database.  You may additionally want to change the value assigned to $DEF_PROCESSING_PREFIX in project_1_2/config.php if you want to use your new prefix all the time.
96 6 Amber Herold
# Enter the processing database name and click "create processing db".
97 2 Amber Herold
# The page should refresh and display the linked database like this:
98
99
<pre>
100 1 Amber Herold
processing db: ap1
101 2 Amber Herold
</pre>
102 1 Amber Herold
103 7 Amber Herold
See next section on trouble shooting if you get the original page instead.
104
105 1 Amber Herold
* *Repeat the above process for all your projects.*
106
107
If you want all your processing databases combined in one single database (not recommended, as this becomes large very fast), just use the same name for all your projects.
108
109
The above procedure not only creates the database, but also create some of the tables that you need to start processing.
110 2 Amber Herold
111
h3. Trouble Shooting 
112
113 1 Amber Herold
If the 'getproject.php' webpage remains unchanged, your processing database link is not accepted.  This is usually
114
caused by an incorrect setting such as:
115 2 Amber Herold
# The mysql user does not have the privileges to create the named database.
116 7 Amber Herold
    See Section-5.3 on what you should do.  To try it again after your mysql correction, you should repeat Section-5.2 to allow reinitialization from the project_1_2 web page and then try 7.2 again.
117 2 Amber Herold
# You have accessed an earlier version of project web page after you reinitialized the install table in your existing project database.
118 1 Amber Herold
    The install table in the project database is set to deny further changes once any project web page is accessed.  As a result, required table property changes and new table insertion would fail.
119
    Here is how to fix it:
120 2 Amber Herold
# Repeat Seciont-5.2 to allow reinitialization.
121
# Try Section-7.2 again.
122 1 Amber Herold
123 14 Amber Herold
h2. 5 Processing server side installation 
124 2 Amber Herold
125
h3. Follow "Leginon processing-server-side installation on Linux":http://emg.nysbc.org/documentation/leginon/bk02ch04s05.php 
126
127
h3. Additional work 
128
129 4 Amber Herold
* Go to your Leginon installation directory (typically /usr/lib/python2.4/site-packages/Leginon/)
130 2 Amber Herold
* Edit project.py. Change line 5 to:
131
132
<pre>
133 1 Amber Herold
use_processingdb_table = True
134 2 Amber Herold
</pre>
135
136
* Add the appionData module to sinedon.cfg, which you have already modified during the Leginon installation.
137
138
<pre>
139 1 Amber Herold
[appionData]
140
user:	usr_object
141 2 Amber Herold
</pre>
142
143 17 Amber Herold
144
*[Note]* The module names in brackets are case sensitive and need to be exact.
145 1 Amber Herold
The user name needs to match the name for which privileges have been granted on the `ap%` databases.
146
147 17 Amber Herold
148 2 Amber Herold
h3. Download and install pyappion 
149 1 Amber Herold
150 19 Amber Herold
h4. Install prerequisite processing packages that are not included in the Leginon installation
151
152
Find a list of these packages [[Appion_Installation_Manual#Packages-not-included-in-the-Leginon-installation|here]]. 
153 2 Amber Herold
154 1 Amber Herold
h4. "Download pyappion":http://appion.googlecode.com/files/pyappion-0.5.3-r3665.tgz 
155 2 Amber Herold
156 21 Amber Herold
h4. [[Start_with_existing_CentOS_installation#5-Compile-and-setup-Appion-python-programs|Compile and Setup Instructions]] 
157 1 Amber Herold
158 2 Amber Herold
h3. Install external packages 
159 17 Amber Herold
160 1 Amber Herold
Follow instructions for the individual packages.
161 22 Amber Herold
Instruction for compiling Xmipp for OpenMPI is [[Start_with_existing_CentOS_installation#8-Install-external-packages|here]].
162 1 Amber Herold
163 22 Amber Herold
h2. 6 Initialize Leginon with its admin tools 
164 2 Amber Herold
165
h3. DO NOT follow Leginon administration tool instructions.  We only need to upload images for appion processing, which is much simpler.
166
167
# Go to the webpage `http://your_host/dbem_1_5_1/addinstrument.php`
168
# Create a fake TEM instrument like this:
169
170
<pre>
171 1 Amber Herold
name: my_scope
172
hostname: whatever
173
type: Choose TEM
174 2 Amber Herold
</pre>
175
176
# Create a fake CCDCamera instrument like this:
177
178
<pre>
179 1 Amber Herold
name: my_scope
180
hostname: whatever
181
type: Choose CCDCamera
182
</pre>
183 2 Amber Herold
184 22 Amber Herold
*[Note]* If you use Leginon, and still want to upload non-Leginon images, make sure that you create a pair of fake instruments like these on a host solely for uploading.  It will be a disaster if you don't, as the pixelsize of the real instrument pair will be overwritten by your upload.
185 1 Amber Herold
186 17 Amber Herold
h2. 7 Start your first Appion session from the web 
187 2 Amber Herold
188
h3. Upload Images to a new session 
189 4 Amber Herold
190 11 Amber Herold
# Go to webpage `http://your_host/dbem_1_5_1/`  This is the general starting point for Leginon.
191
# Follow the link for the Project DB (bottom right)
192
# Select your test project, click on the name.  This takes you to the same page you created for the processing database.
193
# Below the experiment heading you will find a link that says "upload images to new session".  This takes you to your first Appion processing page, where you can use the web gui and instruction to upload your images.
194
# Once all fields are filled in click on "Just Show Command", which will bring you to a page that displays a command line.  Copy, paste, and execute this command into your text terminal, which will use the processing server programs and the database behind it.
195 22 Amber Herold
*[Note]* All images uploaded in an experiment session should have the same pixel size because they cannot easily be divided into groups during processing.
196 1 Amber Herold
197
h3. Good starting point for future reference 
198 4 Amber Herold
199 11 Amber Herold
* If you have been successful so far, the image you uploaded will show up in the viewers.  You may choose one of
200 22 Amber Herold
the viewers provided by dbem_1_5_1 as your starting point to select your session, to view the images, and to start processing by following the link at the top-left corner called "processing".
201 1 Amber Herold
202 24 Amber Herold
h2. 8 Remote Appion Processing through ssh
203 4 Amber Herold
 
204 1 Amber Herold
A more advanced way to run appion script is done through an ssh session.  This is equivalent of having you ssh into a computer and starting the appion processes.
205
206
There are two kinds of appion processes.  The first is a single-node process that can be run on a stand-alone workstation or the head-node of a computer cluster without PBS.  The second is a multiple-node process that requires PBS to run on the cluster.  When you use "Just Show Command" option, it is always a single-node process, but if you run through ssh it could be either, depending on the demand of the process.  For example,
207
imageuploader.py is always run as single-node process while maxlikeAlignment.py is either run on single-node with "Just Show Command" or as a PBS job submission when you run through ssh.
208
209 2 Amber Herold
h3. Install and setup ssh2 extension for php at your web-server 
210
211 1 Amber Herold
This enables an ssh session initialized from appionweb
212 11 Amber Herold
# Download and install the ssh2 extension for php as instructed at its download site:
213
* http://www.php.net/manual/en/ssh2.installation.php
214 1 Amber Herold
    Install openssl and compile libssh first before compiling php-ssh2 extension. Once you get the final ssh2.so, add it in your php.ini
215
216
The extension module is added to php in the same way as does the php-mrc module we distribute for the viewing mrc images through php.  To check whether it worked and for alternative way to make php recognize the module used in newer php, see http://emg.nysbc.org/documentation/leginon/bk02ch04s07.php under the section *Check php information* and *Alternative approach if mrc module does not show up in info.php output*
217
218 2 Amber Herold
h3. configuration at web server side 
219
220 25 Amber Herold
*IMPORTANT*: What we refer here as _your_cluster.php_ should not be taken literally.  For example, if you access your cluster through network with a name "bestclusterever", you should name your cluster configuration php file *bestclusterever.php*, not _your_cluster.php_.
221 23 Amber Herold
# Go to your_dbem_1_5_1/processing directory
222 25 Amber Herold
# Copy *default_cluster.php* to _your_cluster.php_
223 23 Amber Herold
# [[ClusterPhpSettings|Edit your_cluster.php]] to correspond to your cluster configuration.
224 25 Amber Herold
# Edit *config_processing.php* to add your cluster and, if desired, a stand-alone workstation as processing_host and register the _your_cluster.php_ you just created.
225 2 Amber Herold
226
<pre>
227 1 Amber Herold
$PROCESSING_HOSTS[]="your_stand-alone_processing_workstation";
228 23 Amber Herold
$PROCESSING_HOSTS[]="your_cluster";
229 1 Amber Herold
$CLUSTER_CONFIGS= array (
230 23 Amber Herold
  'your_cluster'
231 1 Amber Herold
);
232 2 Amber Herold
</pre>
233
234
235
h3. Setting up PBS on processing server side 
236
237 22 Amber Herold
Follow these [[Start_with_existing_CentOS_installation#9-Install-a-PBS-job-submission-system|instructions to set up PBS on your processing server]].
238 1 Amber Herold
239 2 Amber Herold
h3. Testing 
240
241
h4. Testing php-ssh2 installation
242
243 1 Amber Herold
Check your info.php as you did with mrctool installation.  Corrected installed extension should show up in the output of info.php.  Reference http://emg.nysbc.org/documentation/leginon/bk02ch04s07.php under the section *Check php information* and *Alternative approach if mrc module does not show up in info.php output*.
244 2 Amber Herold
245
h4. Testing ssh log in 
246
247 1 Amber Herold
Use the top right form on the processing page to log in as if doing an ssh session. The page will acknowledge that you have been logged in if the setup is correct.  You will be able to edit description of a run and to hide failed runs when logged in. The option for submitting the job appears at the bottom of the processing form whenever available.
248 2 Amber Herold
249
h4. Testing simple appion processing job submission 
250
251 1 Amber Herold
Upload template is a good example to try:
252 11 Amber Herold
# Create a small mrc image as your template to be uploaded.
253
# Select Upload template in Import tools in the appionweb processing menu of an existing session.
254
# Type in the needed information.
255
# When you finish filling the form, instead of clicking on "Just show command", choose your processing host and run the job by clicking "Upload Template".
256
# For simple process such as this, the webpage will take a little while to refresh until the job is completed.
257
# If you get the message "Template is uploaded", the process is successful and if you refresh the page you will find the template in the available list. 
258 2 Amber Herold
259
h4. Testing PBS-required appion processing job submission 
260
261 1 Amber Herold
Particle selection such as DogPicker is a good example to try:
262 11 Amber Herold
# Click on DoG Picking under Particle Selection menu
263
# Enter the required parameters
264
# When you finish filling a form for an appion processing, choose your processing host and run the job.  Pages for monitoring the job become available after the job is queued and subsequently begins running. If the status appears as "Running or Queued" at first, the setup is likely correct.
265
# After a while, the process will be completed and the status becomes "Done" when you click to have the Status updated on the page.
266 2 Amber Herold
267 25 Amber Herold
h4. Check _your_cluster.php_ setup 
268 2 Amber Herold
269 25 Amber Herold
For reconstructions involving iterations of different parameters such as EMAN reconstruction by refinement, the _your_cluster.php_ is used to generate the script.  Examine the script created on the web form and modify _your_cluster.php_  You can copy the script to your cluster and test run/modify it until it is correct.