Verbatim:Deployment: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(pip requirements, some config stuff)
Line 5: Line 5:
** Python >= 2.4
** Python >= 2.4
** [http://pip.openplans.org/ pip]
** [http://pip.openplans.org/ pip]
** ([http://translate.sourceforge.net/wiki/pootle/installation_1.3beta list of dependencies])
** python-sqlite2
*** Some of these probably exist as RPMs, but they can also just be installed into the virtualenv
** python-ldap
*** python-lxml
** MySQL-python
*** python-sqlite2
*** python-ldap
** At least gettext version 0.15.  This seems to upgrade cleanly in Redhat with no dependency issues ([https://bugzilla.mozilla.org/show_bug.cgi?id=438706 bug 438706])
** At least gettext version 0.15.  This seems to upgrade cleanly in Redhat with no dependency issues ([https://bugzilla.mozilla.org/show_bug.cgi?id=438706 bug 438706])
** At least SVN 1.5 (we make use of --with-revprop)
** At least SVN 1.5 (we make use of <code>--with-revprop</code>)
 
([http://translate.sourceforge.net/wiki/pootle/installation_1.3beta list of Pootle's dependencies])


== Setup ==
== Setup ==
Line 20: Line 20:
* Create and activate a virtualenv
* Create and activate a virtualenv
** <code>cd pootle_dir</code>
** <code>cd pootle_dir</code>
** <code>virtualenv --no-site-packages pootle_env</code>
** <code>virtualenv pootle_env</code>
** <code>. pootle_env/bin/activate</code>
** <code>. pootle_env/bin/activate</code>
* Install all required packages using <code>pip</code>
* Install all required packages using <code>pip</code>
** <code>wget .../requirements.txt</code> (from github)
** <code>wget .../requirements.txt</code> (from github)
** <code>pip -E pootle_env ...</code>
** <code>pip -E pootle_env install -r requirements.txt</code>
* Download and extract Pootle itself (from the [http://translate.sourceforge.net/snapshots/Pootle-1.3.0-beta4/ 1.3.0-beta4 snapshot directory]) into pootle_env
* Download and extract Pootle itself (from the [http://translate.sourceforge.net/snapshots/Pootle-1.3.0-beta4/ 1.3.0-beta4 snapshot directory]) so that it lives under pootle_dir/Pootle


Set up Apache and mod_python to properly run Pootle
Set up Apache and mod_python to properly run Pootle
* <code>cd pootle_env/bin</code>
* <code>wget .../modpython_wrapper.py</code> (from github); chmod +x it
* <code>wget .../modpython_wrapper.py</code> (from github); chmod +x it
* set up Apache config similarly to what's shown on github; important parts:
**


== Configuration ==
== Configuration ==
* [http://micropipes.com/blog/2008/09/19/committing-to-svn-securely-from-a-web-application/ more details on these steps] but a summary:
* set up SVN user ([http://micropipes.com/blog/2008/09/19/committing-to-svn-securely-from-a-web-application/ more details on these steps] but here's a summary):
# Create a Verbatim SSH account on the SVN server using an SSH key with no passphrase
# Create a Verbatim SSH account on the SVN server using an SSH key with no passphrase
# Copy the key to a .ssh directory in the home directory of the verbatim user on the verbatim server
# Copy the key to a .ssh directory in the home directory of the verbatim user on the verbatim server
# Add commit hooks to the SVN server for translate:author
# Add commit hooks to the SVN server for translate:author
# checkout https://translate.svn.sourceforge.net/svnroot/translate/src/branches/mozootle
* check out inital projects into <code>Pootle/po/(project-slug)</code>, for example:
# Copy pootle.prefs to a configuration directory and configure it
# <code>cd pootle_dir/Pootle/po</code>
# The command to run the server is ''./PootleServer --prefsfile=/path/to/pootle.prefs --port=80''
# <code>svn co svn+ssh://svn.mozilla.org/addons/trunk/site/app/locale amo</code>
** note: the pootle tree must be owned by whatever user is running the pootle server
* set up Pootle itself
# create a MySQL db and user
# set up a memcached instance for Pootle
# edit <code>Pootle/localconfig.py</code>, there:
# change <code>DATABASE_*</code>
# switch <code>AUTHENTICATION_BACKENDS</code> to use LDAP, and adjust the credentials/settings there
# switch <code>CACHE_BACKEND</code> with the memcached option


== Post-deployment Checklist ==
== Post-deployment Checklist ==
* once it all works, switch <code>DEBUG</code> in <code>localconfig.py</code> to'' False''
''todo: verification things are working, cron jobs, nagios checks, etc.''
''todo: verification things are working, cron jobs, nagios checks, etc.''

Revision as of 16:21, 4 November 2009

Verbatim » Deployment

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)

(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 1.3.0-beta4 snapshot directory) 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 what's shown on github; important parts:

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

Post-deployment Checklist

  • once it all works, switch DEBUG in localconfig.py to False

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