-
Notifications
You must be signed in to change notification settings - Fork 13
Rodan worker
This will set up Rodan worker. First, check out Rodan source, either by git
(make sure to do a recursive clone for populating all submodules):
$> git clone --recursive https://github.com/DDMAL/Rodan.git
...or Rodan release (TODO).
Following instructions will use $RODAN_HOME
as the absolute path where you have checked out the Rodan source code.
Rodan is based on Python 2.7.x. Python 3 does not work with Rodan.
We recommend that all Python packages (see requirements.txt) should be installed inside a dedicated virtual environment for Rodan, because a virtual environment allows you to have multiple Python "environments" on the same machine:
$> sudo pip install virtualenv
$> cd $RODAN_HOME
$> virtualenv --no-site-packages rodan_env
(Note: from now on, we assume that we are in $RODAN_HOME.)
Then activate virtual environment:
$> source rodan_env/bin/activate
Note that your prompt looks like the following:
(rodan_env)$>
Whatever Python modules are installed from now on will only be available while in this virtual environment. (To exit your virtual environment, simply use the command deactivate
.)
Then we install all Python packages. You may need system libraries before compiling some of them. On Ubuntu, perform:
(rodan_env)$> sudo apt-get install libpython-dev lib32ncurses5-dev libxml2-dev libxslt1-dev zlib1g-dev lib32z1-dev libjpeg-dev libpq-dev
For other Linux distributions, please find corresponding names.
Install Python packages:
(rodan_env)$> pip install -r requirements.txt
Now, exit virtual environment by executing:
(rodan_env)$> deactivate
(rodan_env)$> apt-get install nfs-common inotify-tools
Create a folder for mounting NFS folder as $RESOURCE_FOLDER_MOUNT_POINT
.
Install autoconf
(using apt-get
). Change directory to Rodan source code directory, and run following commands:
$> autoconf
$> ./configure --enable-debug=no --enable-diva MODE="worker" \
RODAN_VENV_DIR=/myapps/Rodan/rodan_env/ \
RODAN_DATA_DIR=/myapps/Rodan/data \
AMQP_HOST="localhost" AMQP_PORT="5672" AMQP_VHOST="rodan" \
AMQP_USER="rodan" AMQP_PASSWORD="12345" \
DB_HOST="localhost" DB_PORT="5432" \
DB_NAME="rodan" DB_USER="rodan" DB_PASSWORD="12345" \
DB_REDIS_PORT="6379" DB_REDIS_DBNUMBER=0 \
WWW_USER="www-data" WWW_GROUP="www-data" \
--with-graphicsmagick-search-path="/myhome/bin/" \ # not required if not using some of native jobs
--with-kdu_compress-search-path="/myhome/bin/" \ # not required if not using some of native jobs
--with-xmllint-search-path="/myhome/bin/" \ # not required if not using some of native jobs
--with-vips-search-path="/myhome/bin/" # not required if not using some of native jobs
$WWW_USER
and $WWW_GROUP
are the user and group that actually run the Rodan code. In a production environment, it is highly recommended to set up the dedicated account for limiting the permission of the application.
The configure script will output the command for altering the user and group for Rodan application and data directories, like follows:
$> sudo chgrp -R $WWW_GROUP $RODAN_HOME/*
$> sudo chown $WWW_USER:$WWW_GROUP $RESOURCE_FOLDER_MOUNT_POINT
We use supervisor to register Rodan as system services.
Install supervisor:
$> sudo apt-get install supervisor
Copy generated supervisor configurations:
$> cp $RODAN_HOME/etc/supervisor/conf.d/rodan.conf /etc/supervisor/conf.d/
Set up requirements for image processing jobs (optional if you do not intend to use Rodan for optical music recognition)
- Repository Structure
- Working on Rodan
- Testing Production Locally
- Working on Interactive Classifier
- Job Queues
- Testing New Docker Images
- Set up Environment Variables
- Set up SSL with Certbot
- Set up SSH with GitHub
- Deploying on Staging
- Deploying on Production
- Import Previous Data