Skip to content
This repository was archived by the owner on Nov 14, 2022. It is now read-only.
Dimitar Tasev edited this page Mar 16, 2021 · 22 revisions

Help

To display the help section for the setup.py

python setup.py help

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.

Note: This will overwrite all your settings.py files

python setup.py test_settings

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.

python setup.py externals

You can optionally choose to only install a selection of services using the -s argument.

python setup.py externals -s list,of,services

ActiveMQ Java Runtime

To run ActiveMQ you need to have a Java runtime installed. On Ubuntu this can be done via:

sudo apt install openjdk-11-jre

Start services

To start activemq do

python setup.py start

On Linux and if using virtualenv as per installation instruction then need to do sudo ~/autoreduction/venv3/bin/python setup.py start.

To start the Queue Processors please see https://github.com/ISISScientificComputing/autoreduce/tree/master/queue_processors.

AR for Development

If you want to be able to debug the code while running it, continue with the instructions in: Visual Studio Code development. Otherwise continue below.

Starting the web app

First off you need to configure the DB. If not planning to use MySQL, or if not sure whether you should be - then keep going with these instructions.

To migrate the database and create the superuser just run:

python setup.py database

Then you can run the web server with (the cd is important otherwise the webapp won't be able to find the static files):

cd WebApp/autoreduce_webapp && python manage.py runserver

and in the output it will tell you at what hostname / port you can find the app. Mind that you might have to port forward to see it locally, or go to your workstations' hostname:port. Some IDEs will port-forward for you automatically (such as VSCode) when the link is clicked.

Database fixtures and test reduce scripts

For instructions on how to install fixtures in the DB and add test reduce scripts, please follow the instructions in the PR testing quickstart page

Database Setup - not intended for local development, only for development/production environments

This is only required if you intend to use MySQL as the local database for testing. This is not required by default because SQLite3 will be used, which is available just by installing Django.

The mysql installation needs to be callable/available from the command prompt you are using, and the mysql service needs to be running (e.g. sudo /etc/init.d/mysql start or sudo service mysql start on Linux (may differ depending on distribution).

You also need to set-up the test user in the database via:

# this assumes you are in the repository root
sudo mysql < build/database/reset_autoreduction_db.sql

Afterwards you'll have to edit the WebApp/autoreduce_webapp/autoreduce_webapp/settings.py DATABASE setting to use the MySQL driver and account, as well as the utils/credentials.ini file to contain the correct user/password/host/DB name (which should be autoreduction).

Finally you can run the DB migration and configuration

python setup.py database
Clone this wiki locally