Project

General

Profile

Installation of pyWPS Web Processing Service

Back to Overview

Installation of PyWPS 3.2.1 for climate4impact process developments

Environment setup with user rights:

mkdir /data/wps/
virtualenv /data/wps/pyvirtenv
. /data/wps/pyvirtenv/bin/activate
cd /data/wps/pyvirtenv/
virtualenv --system-site-package .

Python personal virtual environment must be activated each time a new shell is started:

. /data/wps/pyvirtenv/bin/activate

Some packages can be installed in the virtual environment:

. /data/wps/pyvirtenv/bin/activate
easy_install python-magic
easy_install numpy
easy_install pydap

Installation of PyWPS software

cd /data/wps
wget https://wald.intevation.org/frs/download.php/910/pywps-3.2.1.tgz  --no-check-certificate
tar -xzvf pywps-3.2.1.tgz
cd pywps-3.2.1/
python setup.py install
cp pywps/default.cfg /home/c4m/impactportal/pywps.cfg

Install processes, in this case the existing example ultimatequestionprocess

mkdir /data/wps/processes
mkdir /data/wps/wpsoutputs
cp /data/wps/pywps-3.2.1/tests/processes/ultimatequestionprocess.py /data/wps/processes/
echo "__all__ = [\"ultimatequestionprocess\"]" > /data/wps/processes/__init__.py

Install test script

mkdir /data/wps/wpstest/
cd /data/wps/wpstest/\
# install test scripts
bash testwps.sh

Configuration of pyWPS within impactportal

# In file ~/impactportal/config.xml:
  <pywpsconfig>
    <pywpsexecutable>/data/wps/pywps-3.2.1/wps.py</pywpsexecutable>
    <exportenvironment>LD_LIBRARY_PATH=/data/software/install/lib:$LD_LIBRARY_PATH</exportenvironment>
    <exportenvironment>PYTHONPATH=/data/wps/pywps-3.2.1/build/lib:/data/wps/pyvirtenv/lib/python2.7/site-packages/</exportenvironment>
    <exportenvironment>PATH=/data/wps/pyvirtenv/bin/:$PATH</exportenvironment>
    <exportenvironment>PYWPS_CFG=/home/c4m/impactportal/pywps.cfg</exportenvironment>
    <exportenvironment>PYWPS_PROCESSES=/data/wps/processes</exportenvironment>
    <exportenvironment>PYWPS_TEMPLATES=/data/wps/pywps-3.2.1/pywps/Templates</exportenvironment>
    <exportenvironment>NCARG_ROOT=/data/software/install/</exportenvironment>
    <exportenvironment>PORTAL_OUTPUT_PATH=/data/wps/wpsoutputs/</exportenvironment>
    <exportenvironment>PORTAL_OUTPUT_URL=http://localhost:8080/impactportal/WPS?OUTPUT=</exportenvironment>
    <exportenvironment>PORTAL_SCRIPTS=/data/software/install/htdocs/wpspage/</exportenvironment>
    <exportenvironment>MPLCONFIGDIR=/home/c4m/matplotlib</exportenvironment>
    <exportenvironment>USE_FONTCONFIG=False</exportenvironment>
  </pywpsconfig>

Installation of ICCLIM

Download icclim-master.zip and extract it to /data/wps/icclim-master.


export CPPFLAGS="-I/data/build/include/" 
export LDFLAGS="-L/data/build/lib/" 
export LD_LIBRARY_PATH="/data/build/lib/:$LD_LIBRARY_PATH" 
export PATH="/data/build/bin/:$PATH" 
. /data/wps/pyvirtenv/bin/activate

cd /data/wps/icclim-master
gcc -fPIC -g -c -Wall ./icclim/libC.c -o ./icclim/libC.o
gcc -shared -o ./icclim/libC.so ./icclim/libC.o
python setup.py install

Simple update script:

cd /data/wps
mv icclim-master icclim-master`date +%Y%m%d`.backup
mv master.zip icclim-master.zip`date +%Y%m%d`.backup
wget https://github.com/tatarinova/icclim/archive/master.zip
unzip master.zip
cd icclim-master
gcc -fPIC -g -c -Wall ./icclim/libC.c -o ./icclim/libC.o
gcc -shared -o ./icclim/libC.so ./icclim/libC.o
python setup.py install

Installation of OCGIS

cd /data/wps
#register and download ocgis file ocgis-1.1.0.tar.gz
easy_install ocgis-1.1.0.tar.gz