Daniel Leidert: Setting up a network buildd with pbuilder, ccache, inoticoming and NFS
I recently bought an N54L HP microserver, which shall act as a build-daemon (buildd) for Debian packaging. The idea of my workflow is the following:
- do the maintenance tasks locally, usually using svn-buildpackage, quilt etc.pp
- build a source package locally
- upload the source to an incoming directory on the server
- watch this incoming directory and start a build process as soon as a package is uploaded
- put the result into an accessible directory
- support different vendors (debian, ubuntu)
- support different releases (experimental, unstable, stable, oldstable)
- support different architectures (amd64, i386)
- speed up the build process
- one central file /etc/pbuilderrc.inc defining all the common/shared settings and
- small configure files defining vendor, release, architecture and mirrors
You get the main idea, right? Create own files and directories for each architecture, release and vendor. Further I only want to pull build related packages into the build environment, not into the server environment. So I enabled USE_PDEBUILD_INTERNAL. I don't want to sign anything on the buildd itself and use both cores. That's what DEBBUILDOPTS and AUTO_DEBSIGN are used for. Further I saw some warnings reported during build processes. I therefor install the packages mentioned in EXTRAPACKAGES to every build enviroment. The following are the configure files for the unstable amd64 (default) and the stable i386 build environments:
[..]
EXTRAPACKAGES="apt-utils debconf debconf-utils libfile-fcntllock-perl"
[..]
BASETGZ="/var/cache/pbuilder/base.$DISTRIBUTION.$ARCHITECTURE.tgz"
APTCACHE="/var/cache/pbuilder/aptcache/$DISTRIBUTION/$ARCHITECTURE/"
BUILDRESULT="/var/cache/pbuilder/result/$DISTRIBUTION/$ARCHITECTURE/"
[..]
case "$VENDOR" in
ubuntu)
MIRRORSITE="http://archive.ubuntu.com/ubuntu"
COMPONENTS="main restricted universe multiverse"
OTHERMIRROR="\
deb http://de.archive.ubuntu.com/ubuntu $DISTRIBUTION main restricted universe multiverse \
deb http://archive.ubuntu.com/ubuntu $DISTRIBUTION-updates main restricted universe multiverse \
deb http://security.ubuntu.com/ubuntu $DISTRIBUTION-security main restricted universe multiverse \
"
;;
*)
MIRRORSITE="http://ftp.debian.org/debian"
COMPONENTS="main contrib non-free"
OTHERMIRROR="\
deb http://ftp.de.debian.org/debian $DISTRIBUTION main contrib non-free \
"
;;
esac
[..]
DEBBUILDOPTS="-us -uc -j2"
AUTO_DEBSIGN=no
USE_PDEBUILD_INTERNAL=yes
[..]
VENDOR="debian"
DISTRIBUTION="sid"
ARCHITECTURE="amd64"
. /etc/pbuilderrc.inc
Now to not having to update all of these environments manually there is a small parallelized script /usr/local/sbin/update-pbuilder-chroots:
VENDOR="debian"
DISTRIBUTION="wheezy"
ARCHITECTURE="i386"
. /etc/pbuilderrc.inc
OTHERMIRROR+="\
deb http://security.debian.org $DISTRIBUTION/updates main contrib non-free \
"
The script will make sure, that every change to the configuration file(s) will be considered (--override-config) and is run once a week via cron. The default build environment is updated on a daily base without this restriction:
#!/bin/sh
t=$(tempfile -p .upc. -s .list) exit 1
cat > $t << EOF
/etc/pbuilderrc.amd64.sid
/etc/pbuilderrc.i386.sid
/etc/pbuilderrc.amd64.wheezy
/etc/pbuilderrc.i386.wheezy
/etc/pbuilderrc.amd64.squeeze
/etc/pbuilderrc.i386.squeeze
EOF
parallel /usr/sbin/pbuilder update --override-config --configfile :::: $t tee -a /var/log/pbuilder.log
rm -f $t
exit 0
Speeding up the build processSometimes it is necessary to recompile a package. The tool to speed up this process is ccache, which can be easily integrated into pbuilder by setting CCACHEDIR in /etc/pbuilderrc.inc. It acts like a cache for compiled files and avoids recompilation in several buildd runs.
@reboot root rm -rf /var/cache/pbuilder/build/*/ >> /dev/null 2>&1
@daily root test -x /usr/sbin/pbuilder && /usr/sbin/pbuilder update --configfile /etc/pbuilderrc.amd64.sid tee -a /var/log/pbuilder.log >> /dev/null 2>&1
@weekly root test -x /usr/local/sbin/update-pbuilder-chroots && /usr/local/sbin/update-pbuilder-chroots >> /dev/null 2>&1
It is also possible to use a TMPFS for BUILDPLACE to speed up the build process itself. In this case APTCACHEHARDLINK must be disabled. Well, yeah, I don't do this.Watch an incoming directory and start the build processNot much to say about this except that the user nobody is used to run the pbuilder command. Therefor it is necessary to mention this in /etc/sudoers to allow him to do this via sudo command:
CCACHEDIR=/var/cache/pbuilder/ccache
The first line is only necessary, if a pbuilder command is started with one of these environmental variables set. This can be useful when e.g. debugging a build failure with a future gcc version that is not yet the default or when debugging a clang build issue or when creating non-stripped binary packages for creating a backtrace (BTW: When there is a common repository of all debugging symbols created?).Now to start the build process, I created an incoming directory with mods 777 at /var/cache/pbuilder/incoming/ and use inoticoming to watch it. This is started during boot via cron. The following shows the entry for the default unstable amd64 build environment:
Defaults env_keep = "DH_OPTIONS DH_VERBOSE DEB_BUILD_OPTIONS DH_OPTIONS MAKEFLAGS CC CXX CPP F77 F90"
[..]
nobody ALL=NOPASSWD:/usr/sbin/pbuilder
Done. That's how the basic buildd works.Getting the resultsThe pbuilder BUILDRESULT directory with mods 777 is shared via NFS mount to the workstation. After successfully building the package, debsign and dput can be used as usual.Setting up the workstationI use svn-buildpackage for most of my packages. Because pbuilder won't download source tarballs on demand by default (maybe via hook?), the tarball must always be included building the source package, which then gets uploaded via dput to the buildd. This is considered in the command listed in svn-builder in ~/.svn-buildpackage.conf (note, below shows my personal layout):
@reboot root /usr/bin/inoticoming --logfile /var/log/inoticoming.log --pid-file /var/run/inoticoming.pid /var/cache/pbuilder/incoming --chdir /var/cache/pbuilder/incoming --suffix .dsc --stderr-to-log --stdout-to-log /bin/su -c '/usr/bin/sudo /usr/sbin/pbuilder build --autocleanaptcache ' nobody \;
The host buildd has been added to ~/.dput.cf:
svn-builder=debuild --post-dpkg-buildpackage-hook=\"dput -f buildd /usr/local/src/packages/$PACKAGE/%p_%v_source.changes\" --no-lintian -d -sa -us -uc -S
svn-override=origDir=/usr/local/src/packages/$PACKAGE
svn-override=buildArea=/usr/local/src/packages/$PACKAGE
[..]
Done. Now the svn-buildpackage command will create a source package including the source tarball and upload it to the buildd, where the package building starts right after the upload.ConclusionsThis is the main setup which works nicely for the default build environment so far. On the TODO list is to extend this setup so I can easily deal with all the architectures and releases (point 6..8 at the beginning).
[buildd]
fqdn = mybuildd
login = mylogin
method = scp
incoming = /var/cache/pbuilder/incoming
allow_unsigned_uploads = 1
run_lintian = 0
One of my new favorite languages is a peppy little
On Wednesday, I successfully defended my PhD dissertation in front of a ridiculously packed house at the MIT Media Lab. I am humbled by the support shown by the MIT Sloan, Media Lab, and Harvard communities. Earlier today, I finished up paperwork and submitted my archival copies. I m done.
Although I ve often heard
Well, my

Getting there from DebConf13 and the Debian 20th birthday
For those coming to Switzerland for
The wave hits
A few hours after the warning email, details appeared on slashdot and sure enough, thousands of visitors started coming to this site.
As detailed previously, the site is running on
Brazil has both
127V and 220V outlets using
My last running update was sent after I had a great April month with
two successful trail races (35km then 44km).
The next target was Mont-Blanc marathon in Chamonix valley in early July, so it's time for me to send a new update before summer.
May and June was mostly training. Huge training. Very long distances
with 375km in May and over 430 in June (breaking my former monthly
record by over 50 kilometers). Yes, that means over 14 kilometers
every day..:-)
I indeed achieved that with my "go to work partly by running" habits,
which are now deeply included in my daily schedule. Much more
convenient than bus ride (with the typical random schedules of RATP,
which French people translate by "Rentre Avec Tes Pieds" or "Come back
home by walking"....which is exactly what I'm doing).
With such training (sometimes including extra rides in the forests,
with short but steep ups and downs)....I was well prepared for THE
early summer goal : Marathon du Mont-Blanc in Chamonix (not Ultra
Trail du Mont-blanc : this one, I'm not ready for....yet)..
My first mountain trail race, and what race! Imagine 42km in the
moutain lovers heaven, namely the Chamonix Valley, with the
Mont-Blanc, Aiguille Verte, Aiguille du Midi, Aiguilles Rouges, etc.
above your head. Of course, not only in the valley but goind up and
down "slightly"....in short 2200 meters positive climb..:-)
I ran it with a female friend of mine, who I met in local races and
through runners web forums. Sabine has about the same running skills
than me and we developed a good and nice friendship, sharing our love
for running in the nature. So, during May and June, we decided to run
this race together as we were both registered for it.
A first trial in a local 35km trail race two weeks before the MMB was
very successful. We ended up in 3h40 and Sabine was ranked 5th female
runner. And, moreover, we had a tremendous pleasure by crossing the
finishing line together.
So, we did it again in Chamonix. And, hell, we did it well: I had set
the goal to 6 hours and 30 minutes and we completed the race in..... 6
hours and 34 minutes. Much much better than I and she would have
expected. And, believe me, crossing the finishing line was again a
special moment, particularly because the crowd at the end of this race
make it look like l'Alpe d'Huez on the Tour de France. And, this on a
wonderful sunny day, arriving at Planpraz, facing the Mont-Blanc. If
you've ever been to Chamonix, you know what I mean.
So, first moutain trail and, hell, not the last one! For those of you
who can read French...or just want to see some pictures of a running
bubulle,
Some days ago I got myself a new shiny Samsung 840 Pro 256GB SSD for my laptop. The old 80GB Intel was just too damn small.
Instead of just doing a
Often people create branches to fix various bugs or implement various features, and publish those to a public repository to be pulled in the official repository (e.g. pull requests in the github model).
Present Extension Redirection
Multi-buffered applications have always behaved poorly in the presence
of the Composite extension: