iGEM project by USTC Software 2019.
Assuming that you are using Debian Buster and Python 3.7.
-
Install MySQL (or MariaDB), RabbitMQ and ElasticSearch 2.4.6.
# apt install mariadb-server rabbitmq-server p7zip-full # apt install apt-transport-https ca-certificates wget dirmngr gnupg software-properties-common # setting up openjdk8, as buster no longer provides it # wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add - # add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ # apt update # apt install adoptopenjdk-8-hotspot # wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.4.6/elasticsearch-2.4.6.deb # dpkg --install elasticsearch-2.4.6.deb # mysql_secure_installation # setting mysql/mariadb # mysql (and then type `GRANT ALL ON *.* TO 'set_your_admin_user_name_here'@'localhost' IDENTIFIED BY 'set_your_admin_password_here' WITH GRANT OPTION;` and `FLUSH PRIVILEGES;` inside, to let our project access mysql database)
-
Use
gitto clone this project to your computer. -
Enter into project folder, create a Python virtual environment by:
$ python3 -m venv venv $ source venv/bin/activate (venv) $ pip install wheel # to prevent installation failure (venv) $ pip install -r requirements.txt (venv) $ sed -i '34 s/^/#/; 35 s/^/#/; 36 s/^/#/' venv/lib/python3.7/site-packages/django/db/backends/mysql/base.py && sed -i 's/.decode(errors/.encode(errors/g' venv/lib/python3.7/site-packages/django/db/backends/mysql/operations.py
-
Write project configuration. Copy
backend/backend/config.example.pytobackend/backend/config.py, and modify according to your environment. -
Create and migrate database, and load SQL data by using
mysql$ echo "CREATE DATABASE igem_backend CHARACTER SET utf8 COLLATE utf8_bin;" | sudo mysql (venv) $ python manage.py migrate $ sudo mysql (and then type `SET GLOBAL max_allowed_packet=107374182;`, to ensure the large dump imported successfully) $ sudo mysql igem_backend < data/regulation.sql $ 7z x -so data/all.7z | sudo mysql igem_backend
-
Initialize ElasticSearch by typing:
(venv) $ python manage.py rebuild_index
-
Load Celery computation tasks.
(venv) $ cd backend/cobra_wrapper/remote/ (venv) $ env PYTHONOPTIMIZE=1 celery worker -l info -A cobra_computation -Q cobra_feeds (a new shell) (venv) $ cd backend (venv) $ env PYTHONOPTIMIZE=1 celery worker -l info -A backend -Q cobra_results
-
Run this project.
(venv) $ python manage.py runserver