Installation¶
Running the example project with Docker¶
The quickest way to try out the MOGI suite of Django applications is to use the docker image. This should be run with alongside the docker of a modified Worfklow4Metabolomics Galaxy docker that contains all the tools and workflows that are required. See below:
Start the Galaxy instance through docker:
docker run -p 8080:80 -p 8022:22 -p 8021:21 tomnl/w4m-docker-mogi
For full integration with mogi the w4m-docker-mogi should be used (but is still in development). However any Galaxy docker could be used e.g. workflow4metabolomics/galaxy-workflow4metabolomicsStart the Django-Celery-rabbitmq-redis services through docker (currently this has to be done with docker-compose)
git clone https://github.com/computational-metabolomics/django-mogisite
cd django-mogisite
docker-compose up
By default a user on the django-mogisite website called admin with password admin is already linked to the Galaxy user admin with password admin
An example ISA projects should also be pre-loaded
Running the example project locally¶
The following project site can also be used as a standard Django project. See below:
- Optionally create virtual environment with venv or conda (e.g.
conda create -n mogi python=3.6.5
) - The functionality for the MOGI applications has been tested using MySQL and SQLite databases, however MySQL is the
preferred database backend to use. Please ensure either mysqlclient is installed (e.g.
conda install mysqlcient
) if using the MySQL backend. pip install django-mogi
git clone https://github.com/computational-metabolomics/django-mogisite
cd django-mogisite
python manage.py migrate
to create the mogi models.- Start the development server and visit http://127.0.0.1:8000/
- Register http://127.0.0.1:8000/register/ and login http://127.0.0.1:8000/login/
If using outside of the docker, to get the full functionality you will need install and configure the messaging broker rabbitmq and the result backend redis for the distributed task queue system Celery.
- Celery should be installed alongside the mogi python packages but can also just be installed via via pip
or conda e.g.:bash:pip install celery or
conda install celery
- Install erlang (required for rabbitmq)
sudo apt-get install -y erlang
- Install rabbitmq
sudo apt-get install rabbitmq-server
- Add user (needs to match to settings.py file)
sudo rabbitmqctl add_user admin mypass
- Add host (needs to match to settings.py file)
sudo rabbitmqctl add_vhost myvhost
- Add tags (optional)
sudo rabbitmqctl set_user_tags myuser mytag
- Give permission to user
sudo rabbitmqctl set_permissions -p myvhost admin “.*” “.*” “.*”
- Restart rabbitmq
sudo service rabbitmq-server restart
- Install redis (easiest way is through conda)
conda install redis-py
- Start redis (if not already started)
redis-server
- Finally, start celery from the django-mogisite directory
celery -A mogi_site.celery worker -l DEBUG -E
Different backends can be used with Celery and should still be compatible with the MOGI applications. See the celery documentation for more details.
Incorporating the packages into existing projects¶
Alternatively, individual applications can be installed into existing Django projects as well, see the quick start section of the documentation for each Django application.