Diff for "BuildFarm/TryOutBuildSlave"

Not logged in - Log In / Register

Differences between revisions 1 and 12 (spanning 11 versions)
Revision 1 as of 2010-03-05 12:12:13
Size: 2921
Editor: henninge
Comment:
Revision 12 as of 2010-03-08 12:58:49
Size: 3485
Editor: jtv
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
'''This overlaps in part with [[Soyuz/HowToUseSoyuzLocally|HowToUseSoyuzLocally]] which I found out about too late.''' This overlaps with the buildd part of [[Soyuz/HowToUseSoyuzLocally|HowToUseSoyuzLocally]], but shows you how to set up the buildd in a chroot without customizing your own system setup for it.
Line 16: Line 17:
To avoid installing the launchpad-buildd package on my computer, I use pbuilder to create an manage a chroot environment. Like me, you can configure MIRRORSITE in /etc/pbuildderrc to use a closer mirror, if you want. Then do To avoid installing the launchpad-buildd package on my computer, I use pbuilder to create an manage a chroot environment.

Ma
ke sure you have pbuilder installed:
{{{
sudo apt-get install pbuilder
}}}

If {{{archive.ubuntu.com}}} is too far away from you network-wis
e, you can configure MIRRORSITE in {{{/etc/pbuildderrc}}} to use a mirror that's faster for you. Then do
Line 23: Line 31:
Now you should find yourself inside the chroot. To satisfy the NTP needs of the launcahpd-buildd, define it to be the IP of ntp.ubuntu.com or whatever NTP server you like. Now you should find yourself inside the chroot. To satisfy the NTP needs of the launchpad-buildd, define it to be the IP of ntp.ubuntu.com or whatever NTP server you like.
Line 39: Line 47:
  apt-get -f install
Line 40: Line 49:
  apt-get -f install
Line 47: Line 55:
  apt-get update
Line 56: Line 65:
Get the builder chroot from https://edge.launchpad.net/api/devel/ubuntu/lucid/i386/chroot_url. We need a running librarian now. Get the builder chroot from https://edge.launchpad.net/api/devel/ubuntu/lucid/i386/chroot_url.
{{{
wget
-O - -q https://edge.launchpad.net/api/devel/ubuntu/lucid/i386/chroot_url | xargs wget
}}}
Line 58: Line 70:
This should give you a file {{{chroot-ubuntu-lucid-i386.tar.bz2}}}. This is the chroot tarball for Lucid on i386.

We need a running librarian now.
Line 59: Line 74:
  make run (make start_librarian didn't work)   make run # (make start_librarian didn't work)
Line 62: Line 77:
  scripts/ftpmaster-tools/manage-chroot.py -s lucid -a i386 chroot-ubuntu-lucid.tar.bz2 add
Line 63: Line 79:
Copy that URL for the next step. Copy that URL you got from `upload2librarian` for the next step.
Line 67: Line 83:
With the libranrian still running, fire up a python shell.
With the libranrian still running, fire up a python shell and:
Line 70: Line 85:
  python
  >>> import xmlrpclib
  >>>
proxy = xmlrpclib.ServerProxy('http://localhost:8221/rpc')
  >>> proxy.ensurepresent('f1f10b8402ed686aaf0307676c76f07b45af2a09', 'http://launchpad.dev:58080/93/chroot-ubuntu-lucid-i386.tar.bz2', '', '')
  >>> proxy.build('1-1', 'translation-templates', 'f1f10b8402ed686aaf0307676c76f07b45af2a09', {}, {'branch_url': '/home/buildd/gimp-2.4.5'})
  >>> proxy.status()
  >>> proxy.clean() # Clean up if it failed
import xmlrpclib
proxy = xmlrpclib.ServerProxy('http://localhost:8221/rpc')
proxy.ensurepresent('f1f10b8402ed686aaf0307676c76f07b45af2a09', 'http://launchpad.dev:58080/93/chroot-ubuntu-lucid-i386.tar.bz2', '', '')
proxy.build('1-1', 'translation-templates', 'f1f10b8402ed686aaf0307676c76f07b45af2a09', {}, {'branch_url': '/home/buildd/gimp-2.6.8'})
proxy.status()
proxy.clean() # Clean up if it failed
Line 83: Line 97:
  less /home/bulidd/.../buildlog   less /home/bulidd/filecache-default/buildlog

Try the build slave locally

This overlaps with the buildd part of HowToUseSoyuzLocally, but shows you how to set up the buildd in a chroot without customizing your own system setup for it.

Build the package

  cd lib/canonical/buildd
  debian/rules package
  dpkg-buildpackage -b

Package is lib/canonical/launchpad-buildd*all.deb

Set up pbuilder chroot

To avoid installing the launchpad-buildd package on my computer, I use pbuilder to create an manage a chroot environment.

Make sure you have pbuilder installed:

sudo apt-get install pbuilder

If archive.ubuntu.com is too far away from you network-wise, you can configure MIRRORSITE in /etc/pbuildderrc to use a mirror that's faster for you. Then do

  sudo pbuilder --create --distribution lucid
  sudo pbuilder --login --save-after-login

Now you should find yourself inside the chroot. To satisfy the NTP needs of the launchpad-buildd, define it to be the IP of ntp.ubuntu.com or whatever NTP server you like.

  echo "91.189.94.4  ntp.buildd" >> /etc/hosts
  exit

After exit, the chroot will be re-packaged by pbuilder to save the changes. You might choose to save other steps as well but usually I configure the chroot whenever I run it, like so.

  sudo pbuilder --login --inputfile lib/canonical/launchpad-buildd*all.deb

Inside the chroot again: Install and start buildd:

  apt-get -f install
  dpkg -i /tmp/buildd/launchpad-buildd*all.deb
  /etc/init.d/launchpad-buildd start

We need a package to try out the generation of translation templates. Eventually this will be pulled in via bazaar but now I do it manually. Obviously, this is specific to this type of build. Inside the chroot edit /etc/apt/sources.list to enable the deb-src line. Then pull in a source pacakge. Gimp has a couple of translation templates.

  apt-get update
  cd /home/buildd
  su buildd
  apt-get source gimp

Upload chroot to librarian

Outside the chroot, in another terminal (leave the buildd in the chroot running!) Get the builder chroot from https://edge.launchpad.net/api/devel/ubuntu/lucid/i386/chroot_url.

wget -O - -q https://edge.launchpad.net/api/devel/ubuntu/lucid/i386/chroot_url | xargs wget

This should give you a file chroot-ubuntu-lucid-i386.tar.bz2. This is the chroot tarball for Lucid on i386.

We need a running librarian now.

  make run # (make start_librarian didn't work)
  scripts/upload2librarian -f chroot-ubuntu-lucid-i386.tar.bz2
  --> http://launchpad.dev:58080/93/chroot-ubuntu-lucid-i386.tar.bz2
  scripts/ftpmaster-tools/manage-chroot.py -s lucid -a i386 chroot-ubuntu-lucid.tar.bz2 add

Copy that URL you got from upload2librarian for the next step.

Drive slave through rpc

With the libranrian still running, fire up a python shell and:

import xmlrpclib
proxy = xmlrpclib.ServerProxy('http://localhost:8221/rpc')
proxy.ensurepresent('f1f10b8402ed686aaf0307676c76f07b45af2a09', 'http://launchpad.dev:58080/93/chroot-ubuntu-lucid-i386.tar.bz2', '', '')
proxy.build('1-1', 'translation-templates', 'f1f10b8402ed686aaf0307676c76f07b45af2a09', {}, {'branch_url': '/home/buildd/gimp-2.6.8'})
proxy.status()
proxy.clean() # Clean up if it failed

Inspect buildlog

Inside the chroot:

  less /home/bulidd/filecache-default/buildlog