-
Notifications
You must be signed in to change notification settings - Fork 4
Deploying DataGateway
Below I will describe how I set up datagateway-table and datagateway-api on the scigateway-preprod.esc.rl.ac.uk
machine.
yum install httpd
yum install epel-release
yum install python36 python36-pip
yum install httpd-devel
pip3 install mod-wsgi
mod_wsgi-express install-module > /etc/httpd/conf.modules.d/02-wsgi.conf
iptables -A INPUT -p tcp -m tcp --dport 5000 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 5001 -j ACCEPT
iptables-save > /etc/sysconfig/iptables
systemctl start httpd
On scigateway-preprod.esc.rl.ac.uk
, the code for datagateway and datagateway-api is cloned and built by the ICAT glassfish
user.
git clone https://github.com/ral-facilities/datagateway.git
cd datagateway
npm install
cd packages/datagateway-table
npm run build
This will build datagateway-table in production mode. This will minimise the JavaScript and perform other performance improvements, as well as building it in such a way that the parent app can load it.
cp build/* /var/www/datagateway-table/
/etc/httpd/conf.d/datagateway-table.conf
Listen 5001
<VirtualHost *:5001>
DocumentRoot "/var/www/datagateway-table"
ServerName http://scigateway-preprod.esc.rl.ac.uk
<Directory /var/www/datagateway-table>
RewriteEngine off
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
systemctl restart httpd
This sets up Apache on port 5001, and tells it to serve the contents of /var/www/datagateway-table
Currently, datagateway-table expects the settings file to be in the web root, but SciGateway settings file is stored there. For now, copying in the contents of datagateway-table's settings file into SciGateway's is sufficient to get it working. Ensure that api url points to scigateway-preprod.esc.rl.ac.uk:5001
In order for datagateway-table to be able to load data, it needs to be able to contact the api server.
git clone https://github.com/ral-facilities/datagateway-api.git
/etc/httpd/conf.d/datagateway-api.conf
Listen 5000
<VirtualHost *:5000>
ServerName http://scigateway-preprod.esc.rl.ac.uk
WSGIPassAuthorization On
WSGIDaemonProcess datagateway-api user=glassfish group=glassfish threads=1 python-path=/home/glassfish/scigateway/datagateway-api
WSGIScriptAlias /datagateway-api /var/www/datagateway-api/datagateway-api.wsgi process-group=datagateway-api application-group=%{GLOBAL}
<Directory /var/www/datagateway-api>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
This sets up Apache to run mod_wsgi on port 5000. It expects a wsgi file in /var/www/datagateway-api/datagateway-api.wsgi
and runs the server as the unprivileged glassfish
user.
/var/www/datagateway-api/datagateway-api.wsgi
#! /usr/bin/python3.6
import logging
import sys
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0, '/home/glassfish/scigateway/datagateway-api/src/')
from main import app as application
systemctl restart httpd
This tells mod_wsgi the actual location of our app and how to run it.
-
Architecture
-
Dev environment
-
Developing a plugin
-
Deployment
- Deploying SciGateway
- SciGateway Settings
- Deploying plugins
-
Releasing
-
Plugins
-
Continuous Integration
-
UX
-
Feedback