-
Notifications
You must be signed in to change notification settings - Fork 4
phenopipe iap setup
First you need to install MongoDb 3.4.
Create a new system user and group for running the phenopipe application:
sudo adduser -r -m -s /sbin/nologin phenopipe
Next create the directory to which we want to install the application and give our user access:
sudo mkdir /var/www/phenopipe
sudo chown phenopipe:phenopipe /var/www/phenopipe/
If you don't have git installed already install it. (e.g. for centOS)
yum install git
To build and install the application you have to download the source code to your server via
git clone --recursive https://github.com/Gregor-Mendel-Institute/PhenoBox-System.git
Now you have to create/adapt some configuration files in order to build it successfully. Under 'PhenoBox-System/phenopipe-iap-server/src/main/resources/' you have to add a file called 'shared_folder_map.properties'. This file should contain the mapping from your smb file share (its SMB URL) to the local mount point. It should look like the following.
smb\://url.of.your.server/share=/your/local/mountpoint/
Afterwards you have to run the following commands as the phenopipe user (e.g. sudo -u phenopipe bash):
cd PhenoBox-System/phenopipe-iap-server
./gradlew build
tar -xvf build/distributions/phenopipe-iap-server.tar -C /var/www/phenopipe/
sudo chown -R phenopipe:phenopipe /var/www/phenopipe/phenopipe-iap-server/
Now that the application is built we have to create a service to start it automatically
Using systemd we can do the following:
Create the service description at /etc/systemd/system/phenopipe-iap-server.service
This file should look like this:
[Unit]
Description=Phenopipe IAP analysis service
Wants=network-online.target
After=network-online.target
[Service]
ExecStart=/var/www/phenopipe/phenopipe-iap-server/bin/phenopipe-iap-server
User=phenopipe
Group=phenopipe
[Install]
WantedBy=multi-user.target
To start and enable the service do the following:
sudo systemctl daemon-reload
sudo sytemctl enable phenopipe-iap-server
Now the server should start everytime you restart the system.
During the first run of the application initialization IAP will create a hidden directory (.iap_2.0) in the home folder of the user running the process (e.g. /home/phenopipe). In this folder there is the configuration file of IAP (iap.ini). In this file you have to make all necessary configurations to be able to use IAP correctly.
You can either create an appropriate configuration on a client computer where you have access to IAPs GUI and the copy the relevant parts to the server or edit the file directly. Passwords must be set on the server because a different key is used on each machine. You can encrypt the passwords on the server using the following command:
/var/wwww/phenopipe/phenopipe-iap-server/bin/phenopipe-iap-server -encrypt-pw yourPassword
where phenopipe-iap-server is the built executable of the phenopipe server.
This will give you something like this encrypted:N5YAdxcaKq8=
. Take the whole output
and paste it in the appropriate place in the config file.
The most important part is the configuration of the grid storage: This is an example configuration with one grid storage instance
[GRID-STORAGE]
n = 1
retry-count in case of error = 0
Data Source Read-Timeout (s) = 240
Experiment-Navigation Mode-radio-selection = Group by type then coordinator//Group by type then import user//Group by import user group then import user//[x]Group by coordinator then type//Group by import user then coordinator//Group by type only
Sort Substances upon Loading = true
Sort Conditions upon Loading = true
connections per host = 5
connect timeout = 300000
threads allowed to wait for connection = 10000
socket timeout = 300000
max wait time = 300000
socket keep alive = true
auto connect retry = true
Load missing input from LT storage = false
User Name Mapping = oldname/newname
User Name Mapping =
[GRID-STORAGE-1]
enabled = true
title = Store
database_name = storage
host = 127.0.0.1
port = 27017
login = your_monogodb_username
password = <yourEncryptedPw>
You may also want to configure a VFS for file storage to not store all the images inside the mongodb as described in the IAP documentation
For general system settings edit the [SYSTEM] section of the configuration
[SYSTEM]
Issue GC Memory Usage Threshold Percent = 60
Reduce Workload Memory Usage Threshold Percent = 70
cpu_n = 4
cpu_use_half_n = false
Detect Idle Tasks = true
Reduce Workload in Low Memory Situation = false
Issue GC upon high memory use = false