[Tutor] installing where does my money go

Ben Teeuwen ben at hetnieuwestemmen.nl
Thu Apr 7 23:45:51 CEST 2011


Hi everyone, 

I'm a total newbie giving his best shot at visualising local educational institution's faculty budget (over 60 million) to stir up some healthy democratic debate, by trying to adapt the code from http://wheredoesmymoneygo.org/getting-started/. Its open source, so I'm trying out how far I'll wind up :).

I'm installing the setup below (see http://wheredoesmymoneygo.org/getting-started/).
I've got a mac os 10.6.7, python 2.7.1, pip, and the most recent postgres installation. 

I get stuck at;
"Run setup.py to install all required local packages. (Needs more details...)"

bteeuwen at Ben-3 ~/Sites/wdmmg]$./setup.py
from: can't read /var/mail/setuptools
from: can't read /var/mail/wdmmg
./setup.py: line 4: syntax error near unexpected token `newline'
./setup.py: line 4: `setup('

Then I added this to setup.py:
#!/usr/bin/python

This is where I end:
bteeuwen at Ben-3 ~/Sites/wdmmg]$./setup.py
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'paster_plugins'
  warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

Anyone any advice where to look for answers? Thx!!

Ben

______________________________________________________________________________

sInstallation and Setup
======================

Steps to set up WDMMG from scratch. May not be comprehensive, please edit.

--------------

Install Postgres (or any other sqlalchemy compatible DB) on your machine.
Create a new database called 'production', add a superuser: note down the
username and password.

  $ sudo -u postgres createuser -P nameofuser
  $ sudo -u postgres createdb --owner nameofuser nameofdb

--------------

Check out wdmmg from the Mercurial repository. 

$ hg clone http://knowledgeforge.net/okfn/wdmmg

[OUTDATED: For info: This will create a "wdmmg" directory with everything in it. Inside,
you will find:

 - "doc": self-explanatory.
 - "econdata": source code for some fo our data packages.
 - "wdmmg": source code for the data store.
 - "wdmmgrdf": version of the data store with an RDF backend (dormant).
 - "flash": source code for the dashboard.

Inside "wdmmg/wdmmg" you will find a pretty standard Pylons application. Thex
main part is a Python package called (you guessed it) "wdmmg". So the actual
code is inside "wdmmg/wdmmg".]

--------------

Run setup.py to install all required local packages. (Needs more details...)

--------------

Install 'wdmmg' using pip. NB {your-pyenv] here means
'the location of your virtualenv if you have one'::

    $ pip -E {your-pyenv} install -r pip-requirements.txt

--------------

Create a config file called development.ini (this has the config options needed
to run the site locally): 

$ paster make-config wdmmg development.ini

--------------

Edit development.ini with Solr and SQLAlchemy details for your local machine: 

solr.url = url of remote Solr script (can be found in .ini files 
on servers), or just 'stub' if you prefer

sqlalchemy.url = postgres://username:password@localhost/production

--------------

Sync the database tables and set up the application:

$ paster setup-app development.ini

--------------

For data store theme:

Get main wdmmg theme files from the mercurial repository at::

  http://bitbucket.org/okfn/wdmmg-wp-theme

And put them at::

  wdmmg/public/themes/wdmmg

--------------

Install some data (not sure if this really belongs here?)

$ chmod a+x install_data.sh
$ ./install_data.sh

--------------

Run tests, edit anything that is broken::

    $ nosetests 

--------------

Load fixtures so you have some sample data::

    $ paster fixtures setup 

[
Alternatively, if you want the full datasets, run the install_data script (slow)::

  $ chmod a+x install_data.sh
  $ ./install_data.sh

]

--------------

Finally, run the site from development.ini::

  $ paster serve --reload development.ini

--------------

Start hacking!

Trac repository: http://knowledgeforge.net/okfn/tasks/query?status=assigned&status=new&status=reopened&component=projects.wdmmg&order=priority&col=id&col=summary&col=cc&col=status&col=owner&col=type&col=priority


How to Upgrade Production Service
=================================

3 dbs/systems:
  * data.wheredoesmymoneygo.org - P1
  * data.wheredoesmymoneygo.org.2 - P2
  * data.staging.wheredoesmymoneygo.org - S1

Suppose P1 = active production, P2 = inactive production

  * Shut down write to the main system (Hack way: LimitExcept GET in Apache)
  * Dump active production db and load into inactive production db
  * Upgrade inactive system and set to use inactive production db
    * Use it and test it
  * Switch over from P1 to P2
    * In apache move wsgi script to point to the other one and reboot apache2
  * If this fails just switch back and you are operational again
      





More information about the Tutor mailing list