Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Latest commit

 

History

History
194 lines (138 loc) · 7.52 KB

README.rst

File metadata and controls

194 lines (138 loc) · 7.52 KB

EnMaSSe Deployment

EnMaSSe (Environmental Monitoring and Sensor Storage) requires a number of source repositories which are each checked out and setup for development using buildout:

  • Ingester Platform - Handles ingestion of data streaming and storage for the EnMaSSe project.
  • Ingester API - API for integrating the EnMaSSe provisioning interface with the ingester platform
  • SimpleSOS - Library used for the SOSScraperDataSource.
  • Provisioning Interface - User interface/website for EnMaSSe

More information can be found in the Documentation.

In short the development libraries, python 2.7 and buildout need to be installed, then run the buildout configuration to complete the setup.

The deployment instructions below are targeted at redhat servers but the application was developed on windows and mac and should work fully. To install on other operating systems follow the equivalent steps to below, windows specific issues/steps have been explained further below.

Deployment Steps

  1. Install python 2.7 with the required packages as well as other required development libraries:

    yum -y groupinstall "Development tools"
    yum -y install python-virtualenv git openssl openssl-devel libxml2 libxml2-devel libxslt libxslt-devel bzip2-devel libzip-devel libzip sqlite-devel python-devel mysql-devel mysql-client
    
    cd ~
    mkdir .python
    cd .python/
    virtualenv --no-site-packages build_python
    cd ~
    mkdir bin
    echo "export PATH=\$PATH:~/bin" > /etc/profile.d/home_bin.sh
    source /etc/profile
    ln -s ~/.python/build_python/bin/pip ~/bin/python_pip
    python_pip install setuptools --upgrade zc.buildout==1.4.4 distribute
    
    ln -s ~/.python/build_python/bin/buildout ~/bin/python_buildout
    
    mkdir /usr/share/python-buildout
    cd /usr/share/python-buildout
    git clone https://github.com/collective/buildout.python.git
    cd buildout.python/
    sed -i "s@prefix = /opt/local@prefix = /usr/share/python-buildout@g" buildout.cfg
    python_buildout
    ./bin/install-links
    
  2. Checkout this git repository

  3. Create venv from python 2.7 (<python27>/bin/virtualenv --no-site-packages <location>).

  4. <venv>/bin/pip install zc.buildout distribute uwsgi

  5. cd to the checked out repository location

  6. <venv>/bin/buildout

  7. Set up the provisioning interface and ingester platform as services:
    1. Copy services/enmasse_provisioning to /etc/init.d
    2. chkconfig enmasse_provisioning on
    3. service enmasse_provisioning start
    4. Cop services/enmasse_ingester_platform to /etc/init.d
    5. chkconfig enmasse_ingester_platform on
    6. service enmasse_ingester_platform start
  8. Update the configuration files (src/jcu.dc24.provisioning/production.ini and src/jcu.dc24.ingesterplatform/dc24_ingester_platform.tac).

Note: We have had trouble with installation of lxml so binaries have been included in the lxml-binaries directory.

Linux Deployment using the deploy.sh script

  1. Create the user that the services will run as (eg. enmasse)
  2. Create the installation directory and give the user full permissions (eg. /opt/enmasse)
  3. cd <installation dir>
  4. sudo yum install git
  5. sh deploy.sh /opt/enmasse/services
  6. Update the configuration files (src/jcu.dc24.provisioning/production.ini and src/jcu.dc24.ingesterplatform/dc24_ingester_platform.tac).
Note: Your organisation may want to de-couple the configuration and service files from the deployment, if this is the case:
  • Store your configuration and service files external to the deployment directory.
  • Update the service files with the correct configuration files.
  • Pass the directory that contains your service files into sh deploy.sh rather than /opt/enmasse/services

Linux Problems

If lxml has remote connection closed problems:

Either copy the included binaries from lxml-binaries/linux into ./eggs or:
  1. download the source
  2. <venv>/bin/pip install python-libxml2 libxslt
  3. yum install libxml2-dev (or libxslt-devel)
  4. use the virtual env to run setup.py bdist
  5. copy the egg to <repository location>/eggs/

Windows Problems

Setup git so that it is runnable from the command line:

  1. Install msysgit
  2. Add to path variable as <installdir>cmd
  3. Install tortiosegit
  4. Test that git works from the command line, if its still not working try the git-bash command prompt.

Make sure the virtual env is configured with a valid c compiler:

  1. Install mingw

  2. Add <installdir>/bin and <installdir>/mingw32/bin to path

  3. Add the following to venv/lib/distutils/distutils.cfg:

    [build]
    compiler=mingw32
    
  4. Delete all -mno-cygwin within c:/python27/lib/distutils/cygwincompiler.py

If there are errors installing lxml

Either copy all files from lxml-binaries/windows into venv/Lib/site-packages or:

<venv>/Scripts/easy_install lxml==2.3

Then copy the egg to the <repository loc>/eggs

The easy_install download may fail, if it does:
  1. Use wget on a linux machine to download the found url
  2. Use scp to copy from linux machine to windows machine
  3. <venv>/Scripts/easy_install <folder egg is copied to>/lxml-2.3-py2.7-win32.egg
  4. copy the lxml... folder from <venv>/Lib/site-packages to <installdir>/eggs folder

mysql-python won't install

If there are errors installing mysql-python, install the mysql client dev libraries (libmysqlclient-dev) or equivalent.

How to run EnMaSSe from the command line

To start the provisioning interface:

Production (requires UWSGI web server such as nginx)

<install dir>/bin/uwsgi <installdir>/src/jcu.dc24.provisioning/production.ini

Development

<install dir>/bin/pserve <installdir>/src/jcu.dc24.provisioning/development.ini

To start the Ingester Platform

<install dir>/bin/twistd-script.py -n -y <install dir>/src/jcu.ed24.ingesterplatform/dc24_ingester_platform_dam_jcu.tac
  • Select the correct .tac file
  • While testing on windows the generated script was actually <install dir>/bin/twistd.py-script.py which worked as expected.

FAQ

What about the database?

When installing EnMaSSe provide a blank database and it will initialise the required tables and default data on the first run.

What local users is a fresh install setup with?

The default users include: - Username: user, password: user, permissions: none. - Username: admin, password: admin, permissions: Administrator role.

How do I add new local users?

Currently local users need to be added to the database manually.

Credits

This project is supported by the Australian National Data Service (ANDS) through the National Collaborative Research Infrastructure Strategy Program and the Education Investment Fund (EIF) Super Science Initiative, as well as through the Queensland Cyber Infrastructure Foundation (QCIF).

License

See LICENCE.txt.