Changes between Version 22 and Version 23 of Software/MSI/ConfigurationNeptune


Ignore:
Timestamp:
04/06/09 13:55:10 (10 years ago)
Author:
pjkersha
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Software/MSI/ConfigurationNeptune

    v22 v23  
    6161 
    6262=== zc.buildout === 
    63 ... 
     63The discovery service has been deployed with a buildout script (as of 04/06/2009).  The configuration is in `/usr/local/ndg-discovery`.  The procedure to set up was: 
     64 
     65 1. Install zc.buildout and [collective.recipe.modwsgi http://pypi.python.org/pypi/collective.recipe.modwsgi/1.1]: 
     66    {{{ 
     67$ sudo /usr/local/bin/easy_install zc.buildout 
     68$ sudo /usr/local/bin/easy_install collective.recipe.modwsgi 
     69    }}} 
     70 1. Create the buildout.cfg `/usr/local/ndg-discovery`: 
     71    {{{ 
     72[buildout] 
     73parts = DiscoveryServiceProGlueMirror 
     74 
     75# Configuration mirroring eggs as currently deployed on proglue 
     76[DiscoveryServiceProGlueMirror] 
     77recipe = collective.recipe.modwsgi 
     78 
     79eggs = ows_server==0.0.0dev_r5354 
     80        ows_common==0.1dev_r2969 
     81        ndgUtils==0.1.2.dev_r4896 
     82        csml==2.0b_r3046 
     83        cdat_lite>=4.1.2_0.2.5 
     84#       cdat_lite==4.1.2_0.2.5 
     85        Pylons==0.9.6.1 
     86        WebHelpers==0.3.2 
     87config-file = ${buildout:directory}/service.ini 
     88find-links = http://ndg.nerc.ac.uk/dist 
     89        http://ndg.nerc.ac.uk/dist/archivedcsml 
     90    }}} 
     91 
     92    The `DiscoveryServiceProGlueMirror` part mirrors the configuration on `proglue`: 
     93     * Explicit `Pylons` and `WebHelpers` versions were set to avoid `webhelpers` '`auto_link`' `AttributeError`. 
     94     * `cdat_lite` should be set to version 4 but this wouldn't install.  Version 5 installs but there is a known error with cdms imports.  This will be fixed with an upgrade to the latest version of discovery. 
     95 1. To generate the configuration run buildout from `/usr/local/ndg-discovery`. 
     96    {{{ 
     97$ /usr/local/bin/buildout 
     98    }}} 
     99    This will create a WSGI script in `./parts/DiscoveryServiceProGlueMirror/wsgi` 
     100 1. The script as generated could be improved to enable logging by adding a line to include `fileConfig` from `paste.script.util.logging_config` e.g.: 
     101    {{{ 
     102from paste.deploy import loadapp 
     103from paste.script.util.logging_config import fileConfig 
     104 
     105configFilePath = '/usr/local/myapp/service.ini' 
     106fileConfig(configFilePath) 
     107 
     108application = loadapp('config:%s' % configFilePath) 
     109    }}} 
     110    This could be done by customising the `collective.recipe.modwsgi` recipe.  As an interim measure. a Makefile makes the changes using an ugly set of `sed` commands :)  The Makefile also includes targets to install the script into the right area for Apache to pick up: 
     111    {{{ 
     112WSGI_DIR=/srv/www/wsgi_scripts 
     113WSGI_SCRIPT_NAME=discovery.wsgi 
     114WSGI_SCRIPT_IN_FILE=./parts/DiscoveryService/wsgi 
     115TMP_FILE=${WSGI_SCRIPT_IN_FILE}.tmp 
     116 
     117install_wsgi: add_logging 
     118        @echo installing WSGI script ... 
     119        cp ${TMP_FILE} ${WSGI_DIR}/${WSGI_SCRIPT_NAME} 
     120        @echo Done. 
     121 
     122add_logging: 
     123        @echo Altering WSGI script file to include logging functionality ... 
     124        @cat ${WSGI_SCRIPT_IN_FILE} | sed s/"application = loadapp(\"config:"/"from paste.script.util.logging_config import fileConfig\n\nconfigFilePath 
     125 = \""/g |sed s/"\")"/"\"\nfileConfig(configFilePath)\n\napplication = loadapp(\"config:\"+configFilePath)"/g > ${TMP_FILE} 
     126        @echo Done. 
     127 
     128http_proxy=http://wwwcache.rl.ac.uk:8080 
     129 
     130buildout: 
     131        export http_proxy=${http_proxy}; /usr/local/bin/buildout 
     132    }}} 
     133    To build and install then, 
     134    {{{ 
     135    $ make buildout 
     136    $ make 
     137    }}} 
     138    `mod_wsgi` set up in daemon mode will automatically reload the script content without the need to reatart Apache. 
    64139 
    65140== Apache Configuration ==