Verbatim:Deployment

From MozillaWiki
Jump to: navigation, search

Verbatim » Deployment

NOTE: This page contains notes about Mozilla's installation of Pootle. If you wish to install Pootle, the best would be to consult the documentation of the Pootle project.

Pre-Deployment Checklist

  • Prerequisites
    • Python >= 2.4
    • pip
    • python-sqlite2
    • python-ldap
    • MySQL-python
    • At least gettext version 0.15. This seems to upgrade cleanly in Redhat with no dependency issues (bug 438706)
    • At least SVN 1.5 (we make use of --with-revprop)
    • libxml2-devel
    • libxslt-devel
    • python-devel

(list of Pootle's dependencies)

Setup

I've added some scripts etc. to github.

As the apache user, pick a dir where you want to deploy Pootle (pootle_dir), then:

  • Create and activate a virtualenv
    • cd pootle_dir
    • virtualenv pootle_env
    • . pootle_env/bin/activate
  • Install all required packages using pip
    • wget .../requirements.txt (from github)
    • pip -E pootle_env install -r requirements.txt
  • Download and extract Pootle itself (from the SourceForge releases) so that it lives under pootle_dir/Pootle

Set up Apache and mod_python to properly run Pootle

  • cd pootle_env/bin
  • wget .../modpython_wrapper.py (from github); chmod +x it
  • set up Apache config similarly to the apache-host.conf on github; important parts:
    • PythonHandler modpython_wrapper refers to the .py file we put into pootle_dir/pootle_env above.
    • make sure to adjust pootle_dir appropriately in all places
    • the config should in the end use HTTPS and forward HTTP->HTTPS, because we use LDAP auth

Configuration

  1. Create a Verbatim SSH account on the SVN server using an SSH key with no passphrase
  2. Copy the key to a .ssh directory in the home directory of the verbatim user on the verbatim server
  3. Add commit hooks to the SVN server for translate:author
  • check out inital projects into Pootle/po/(project-slug), for example:
  1. cd pootle_dir/Pootle/po
  2. svn co svn+ssh://svn.mozilla.org/addons/trunk/site/app/locale amo
  • set up Pootle itself
  1. create a MySQL db and user
  2. set up a memcached instance for Pootle
  3. edit Pootle/localconfig.py, there:
  4. change DATABASE_*
  5. switch AUTHENTICATION_BACKENDS to use LDAP, and adjust the credentials/settings there
  6. switch CACHE_BACKEND with the memcached option
  • initialize Pootle
  1. in pootle_dir/Pootle, run the database initialization steps, including creation of a first admin user:
  2. ./manage.py syncdb
  3. ./manage.py initdb
  4. ./manage.py refresh_stats

Post-deployment Checklist

  • make sure at the very least /po and /dbs are owned and writeable by the apache user, probably pootle/settings.py too.
  • once it all works, switch DEBUG in localconfig.py to False

todo: verification things are working, cron jobs, nagios checks, etc.

You might also want to look into tips for Pootle optimisation].