-
Notifications
You must be signed in to change notification settings - Fork 4
Installation for local development
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.
-
Python 2.7 (the service has not been tried with Python 3 yet)
- On Windows this is from: https://www.python.org/downloads/windows/
- Debian based machines can install the packages with the following:
sudo apt-get install mysql-server libmysqlclient-dev
- To install Python using the Anaconda distribution: https://www.anaconda.com/download/
-
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>
- After downloading this install it with
- 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
-
In order to use the test settings to access localhost services for the project the
test_settings.py
files must be moved tosettings.py
-
Migrate the
test_settings.py
tosettings.py
usingpython setup.py test_settings
- Note: This will overwrite all your
settings.py
files
- Note: This will overwrite all your
-
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 usingpython setup.py externals -s list,of,services
. Seepython setup.py help
for more details.
- You can optionally choose to only install a selection of services using the
-
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
- To start services running use
python setup.py start
. This will start a new local service for activemq.
-
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 runpython 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