Skip to content
This repository was archived by the owner on Nov 14, 2022. It is now read-only.

Installation for local development

DavidFair edited this page Jun 15, 2018 · 30 revisions

Autoreduction Installation

This a guide on how to install the Autoreduction service for local development.

You should be able to setup a local development environment using any of Linux, Windows and Mac.

If you prefer using Python virtual environments then note the name venv is in .gitignore.

External project requirements

  • Python 2.7 (the service has not been tried with Python 3 yet)
  • MySQL-server version 5.6
    • Currently we must use version 5.6 due to user creation code in test and production code
    • On Windows this is: MySqlServer version 5.6
      • During install and Type and Networking, optionally untick 'Open Windows Firewall port for network access'
  • mysql-python compatible, which for windows is mysql-python-1.2.5
    • pip install mysql-python (before accepting suggested pip install - check the version is correct)
    • Or Download and install the .whl file python-1.2.5.win-amd64-py2.7
      • After downloading this install it with <pip install name_of_wheel.whl>

Setting up for development

  • Run the following lines of code:
# Clone repository, where you haven't already done this:
git clone https://github.com/ISISScientificComputing/autoreduce.git autoreduction

# Add the project to the python site packages and install required python modules
sudo python setup.py develop

# Use pip to install testing requirements such as pylint and nosetest
pip install -r requirements.txt

The build steps below should be run in order

Migrate test settings

  • In order to use the test settings to access localhost services for the project the test_settings.py files must be moved to settings.py

  • Migrate the test_settings.py to settings.py using python setup.py test_settings

    • Note: This will overwrite all your settings.py files

Install external programs

  • Open the build/settings.py file and alter the file paths to where you want the external programs to be installed on your operating system. Ensure you change the correct settings for your operating system.

  • Install the external programs using python setup.py externals.

    • You can optionally choose to only install a selection of services using the -s argument. this is done by using python setup.py externals -s list,of,services. See python setup.py help for more details.

Database Setup

  • If you're mysql installation requires a password to log into root then you can supply this in the build/settings.py file as the DB_ROOT_PASSWORD variable.

  • To initialise, create the schema and populate the test database on localhost use python setup.py database

Start services

  • To start services running use python setup.py start. This will start a new local service for activemq.

WebApp setup

  • The settings.py will point towards the test services by default. If you wish to use the services running on the development node, update autoreduction/WebApp/autoreduce_webapp/autoreduce_webapp/settings.py.

  • Navigate to autoreduction/WebApp/autoreduce_webapp/ and run python manage.py runserver

  • Visit http://127.0.0.1:8000/ in a web browser to see the webapp locally.

  • If you make changes to the webapp, you will have to re-run python manage.py runserver for them to take affect

  • If you want to submit any jobs ActiveMQ must be running. You can start ActiveMQ with by running python setup.py start

Clone this wiki locally