Skip to content

ISGNeuroTeam/otl_interpreter

Repository files navigation

otl_interpreter

Otl interpreter for platform architecture 2.0. Plugin for complex rest

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

  1. Miniconda
  2. Conda-Pack

Deploy

  1. Clone complex rest
git clone [email protected]:ISGNeuroTeam/complex_rest.git
cd ./complex_rest
git checkout develop
  1. Make plugin_dev and plugins_dir
mkdir plugins
mkdir plugin_dev
  1. Clone otl_interpreter in plugin_dev
cd ./plugin_dev
git clone [email protected]:ISGNeuroTeam/otl_interpreter.git
  1. Create python virtual environment
cd ./plugin_dev/otl_interpreter/otl_interpreter/
conda create -p ./venv
conda install -p ./venv python==3.9.7 -y
conda activate ./venv
pip install -r ../requirements.txt
  1. Create symlink to otl_interpreter in plugins directory
cd ./plugins
ln -r -s ../plugin_dev/otl_interpreter/otl_interpreter otl_interpreter
  1. Create configuration file
cd ./plugin_dev/otl_interpreter/otl_interpreter
cp otl_interpreter.conf.example otl_interpreter.conf
  1. Create complex rest development environment in complex_rest directory
make dev
  1. Launch complex_rest
./start.sh
  1. Create database for otl_interpreter. Connect to postgres. User: postgres. Password: postgres
psql -U postgres -h localhost -p 5433
create role otl_interpreter with password 'otl_interpreter';
alter role otl_interpreter with login;
create database otl_interpreter;
grant all privileges on database otl_interpreter to otl_interpreter;
  1. Make migrations and migrate them to database
source ./venv/bin/activate
python ./complex_rest/manage.py makemigrations otl_interpreter
python ./complex_rest/manage.py migrate otl_interpreter --database otl_interpreter
  1. Checkout:

Running the tests

Run tests in docker

./plugin_dev/otl_interpreter/docs/scripts/run_tests_in_docker.sh

Run tests

  1. Launch complex_rest environment
./start.sh
  1. Stop dispatcher process
source ./venv/bin/activate
supervisorctl stop dispatcher
  1. Run tests
python ./complex_rest/manage.py test ./plugin_dev/otl_interpreter/tests --settings=core.settings.test

Deployment

  • Make plugin archive:
make pack
  • Unpack archive into complex_rest plugins directory
  • Create database for otl_interpreter and make migrations
  • Make otl_interpreter config and configure it
cp ./otl_interpreter/otl_interpreter.conf.example ./otl_interpreter/otl_interpreter.conf
  • Make ot_simple_rest_job_proxy config and configure it
cp ./ot_simple_rest_job_proxy/ot_simple_rest_job_proxy.conf.example ./ot_simple_rest_job_proxy/ot_simple_rest_job_proxy.conf

Built With

  • Django - The web framework used

Contributing

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

OT.PLATFORM. License agreement.

Acknowledgments

  • Hat tip to anyone whose code was used
  • Inspiration
  • etc