/web_reflectivity

Web Interface for Reflectivity Fitting

Primary LanguagePythonApache License 2.0Apache-2.0

TRAVISCI DOI codecov readthedocs

Web Interface for Reflectivity Fitting

This application provides a user interface to generate a REFL1D script and run it on a remote node.

Documentation is available at https://web-reflectivity.readthedocs.io/.

Introduction

This application provides a web interface to perform modeling of reflectivity data. This Django application gives users forms to set up their model and submit fitting jobs. To do so, it generates a python script to be executed either locally or on a remote compute resource. The generated script launches REFL1D, which does the actual minimization.

Job management is done using a Django remote submission package. It manages remote jobs using the Celery distributed task queue and provides real-time monitoring of remote jobs and their associated logs. Celery uses message brokers to pass messages between the Django application and compute nodes. The Redis in-memory data structure store is used as the message broker. The script executed on the compute node sets up and executes the REFL1D fit, then gathers the output data.

Test installation

The information below describes how one would deploy the application in production. For a simpler test deployment, see the instructions to run a test server. Those instructions will walk you through a basic installation process and will give you a list of dependencies you'll need.

Production configuration and installation

Production dependencies

A basic set of requirements for the application can be found in requirements.txt. This is only recommended if you are installing more than a test environment and will be deploying your own database and adjusting your configuration yourself. It will not be sufficient for testing (see the test installation section above). Depending on which database and authentication solution you choose, your dependencies may change.

You will also need to install redis-server.

Database installation

The Django application will need a database. It was developed using PostgreSQL, but can be used with any database. You can enter your database details in the web_reflectivity/web_reflectivity/settings.py file.

Authentication

The application supports both users local to the application or users authenticated through LDAP. To use LDAP, the authentication settings should be entered in web_reflectivity/web_reflectivity/settings.py. For that purpose, openssl should be installed.

Once a user is logged in, the application will submit jobs to your compute resources on the user's behalf, through celery. An ssh key should be generated and placed in the apache user's .ssh directory. It should also be copied in the celery user's .ssh directory.

Apache configuration

The application was developed using apache and mod_wsgi, although it could be served by other methods compatible with Django. An example apache configuration is available in apache/apache_django_wsgi.conf. This file can be modified with your SSL details and put in /etc/httpd/cond.d.

Redis configuration

Redis can be run with default configuration.

Celery configuration

On a production system, you will want to run celery as a service. To do this, copy the web_reflectivity/web_reflectivity/celeryd file into /etc/default/celeryd

Install the application

The application installs in /var/www/web_reflectivity.

sudo make install

Starting the application

Start Redis

sudo /sbin/service redis start

Start celery

sudo /sbin/service celeryd start

Start apache

sudo /sbin/service httpd restart

To contribute or report a problem

To report a problem, please create an issue using the "Issues" tab above. If you would like to suggest changes, please either create an issue or a pull request.

Citing this software

Please cite the following when using this software: