Translations/GenerateTemplatesOnLocalBuildFarm

Not logged in - Log In / Register

Revision 14 as of 2010-03-10 18:26:53

Clear message

Translation Templates from Branch

This is an attempt to guide you through a manual test of the nascent mechanism to produce translation templates based on a bzr branch.

It still needs lots of work.

Patches

psql launchpad_dev -c "GRANT SELECT, DELETE ON BranchJob TO fiera"

Enabling local branch access

mkdir -p /var/tmp/bazaar.launchpad.dev/static
mkdir -p /var/tmp/ppa

There's a bug somewhere in Windmill that may break access to local branches through http. This bug is scheduled to be fixed soon.

To see if this is biting you, look in your Apache error log (/var/log/apache2/error.log) for a traceback ending with something like this (your home directory and the version numbers will vary):

  File "/home/me/canonical/lp-sourcedeps/eggs/windmill-1.3beta3_lp_r1440-py2.5.egg/windmill/dep/_mozrunner/global_settings.py", line 42, in <module>
    def findInPath(fileName, path=os.environ['PATH']):
  File "/usr/lib/python2.5/UserDict.py", line 22, in __getitem__
    raise KeyError(key)
KeyError: 'PATH'

Near the top of the traceback you'll find mention of a Launchpad branch, probably canonical/lp-branches/devel or canonical/lp-branches/trunk. From that branch, remove two imports:

from windmill.authoring import WindmillTestClient

from windmill.bin.admin_lib import (
    start_windmill, teardown as windmill_teardown)

Now restart Apache.

Getting branch updates noticed

utilities/start-dev-soyuz.sh
utilities/soyuz-sampledata-setup.py -e <your@email.address>
make run_codehosting >/dev/null 2>&1 &

Making some branch updates to be noticed

    pushd /tmp
    bzr init bf-test
    cd bf-test
    cat <<EOF >test.c
#include <gettext-po.h>
#include <stdio.h>
main(){puts(_("Hi"));}
EOF
    mkdir po
    echo test.c >po/POTFILES.in
    bzr add test.c
    bzr add po
    bzr add po/POTFILES.in
    bzr commit -m "Setting up fake intltool branch."
    bzr push lp://dev/bf-test --remember --use-existing-dir
    popd

Now you should have a TranslationTemplatesBuildJob sitting in the BranchJob table. You should see a very wide line of data coming out of:

psql launchpad_dev -c '
    select *
    from branchjob
    join job on job.id=branchjob.job
    join buildqueue on buildqueue.job=job.id
    where branchjob.job_type=6'

It will show a branch_url parameter to be passed to the slave, pointing to your branch: http://bazaar.launchpad.dev/~ppa-user/bf-test/bf-test

/!\ Some system setups apparently can't access this branch. Try this:

pushd /tmp
bzr export export-experiment http://bazaar.launchpad.dev/~ppa-user/bf-test/bf-test

If that succeeds and creates a copy of bf-test in a directory called export-experiment, then it's fine; otherwise, re-do your rocketfuel setup by running rocketfuel-setup. And remove your branch. And start over. Sorry!

Preparing the slave

Follow the instructions for setting up a local buildd slave at BuildFarm/TryOutBuildSlave. Skip the part where it tells you to run Launchpad, since you're already running it. You should end up with a shell open in a chroot for your simulated build slave. Keep it running; we're going to use that slave!

Now we tell Soyuz that your local buildd slave is in fact Bob the Builder.

Logged in as an admin (I suggest using a different browser so as not to break your ongoing session), check the Virtualized checkbox at https://launchpad.dev/builders/bob/+edit and enter an arbitrary hostname under Virtual Machine Host. Clear the "Builder State OK" checkbox to convince it not to continue building firefox for hoary, as it's been trying to do for the past few years.

Submit. Wait for a few seconds. Go back to the form and re-check "Builder State OK." Submit.

Cleanup

To undo the changes made by utilities/soyuz-sampledata-setup.py: