On May 5, 2008 between 5am and 7am PDT the Mozilla2 and Mobile Buildbots will be down for maintenance. For the curious, details of the work are in bug 429001.

If there’s any reason we can’t go ahead with this please e-mail release@mozilla.org.

Once or twice a month a bug is filed on the try server. I see all of these go by and typically say something like “this would be cool, I don’t have time to do it”. Someone mentioned to me that they were going to blog about a specific try server to try and get some traction on it and I thought, “Why didn’t I think of that?”. So, the rest of this post is just a list of try server bugs that are relatively simple try server bugs that shouldn’t be too difficult to fix.

Bug 391364 – Tryserver should have the option of building specified platforms

Requires changes to: CGI script/UI, master.cfg/Buildbot steps

Bug 411735 – Client side form validation

Requires changes to: CGI script/UI

Bug 411735 – Support building from an alternate revision/branch/tag in a mercurial based try server build

Requires changes to: CGI script/UI, master.cfg/Buildbot steps

Bug 430942 – If bug # given, automatically add comment to bugzilla when try build finishes

Requires new Buildbot Status plugin

Bug 431375 – Try server needs to be able to handle non-Firefox builds

Requires changes to: CGI script/UI, master.cfg/Buildbot steps

Bug 431400 – Try server should support downloading bugzilla attachments as well as receiving uploaded patches

Requires changes to: CGI script/UI

I am happy to give guidance to and assist anyone who wants to work on any of these bugs. The CGI/UI can be found here: http://lxr.mozilla.org/mozilla/source/webtools/buildbot-try, the buildbot master.cfg is here: http://lxr.mozilla.org/mozilla/source/tools/buildbot-configs/tryserver/, and classes supporting it are here: http://mxr.mozilla.org/mozilla/source/tools/buildbotcustom/tryserver/.

Buildbot + Mozilla

April 29th, 2008

Over the past year or so Mozilla has increasingly relied on Buildbot for our Building, Releasing, Testing, and l10n processes. For awhile, everyone that touched Buildbot did things their own way. As a result we had a ton of code (and bug) duplication. There is now a heavy push within the Release Engineering group to rectify this. We’ve slowly but surely been moving code into our “buildbotcustom”. This module contains many different things that are not appropriate to put in upstream-Buildbot, but are very appropriate and useful to those working with Mozilla. We’ve done our best to keep things as generic as possible. Some things (tryserver and unittest) were moved as-is into buildbotcustom to make it easier to generalize them in the future.

The rest of this post is aimed towards people who want to build Mozilla products with Buildbot and talks about some of the custom classes in more detail.

Change Sources

TinderboxPoller

TinderboxPoller watches a Tinderbox quickparse file (such as http://tinderbox.mozilla.org/Firefox/quickparse.txt) for new builds from a specific builder (each column on the Tinderbox waterfall is a builder). When a new build is detected it kicks off a “build” (which isn’t necessarily a compilation process) on the specified “branch” (which in this case is simply a string that matches the TinderboxPoller to a specific builder or builders. For example, we have a TinderboxPoller that watches fx-linux-tbox for new builds. Whenever it sees one it kicks off Talos runs (“builds”) on a number of different machines. To the best of my knowledge, the only thing we use this for is Talos – but there may be things I’m unaware of.

Build Steps

TinderboxShellCommand

This is a BuildStep that simply executes a regular Buildbot ShellCommand and ignores the result. Those familiar with Tinderbox client will understand the naming of it.

GetBuildID

This step attempts to pull the BuildID from the objdir of a build and set it as a BuildProperty. It does so through printconfigsetting.py and application.ini. If you are using an objdir you must pass the path to it, relative to the builddir. If you are not using one you do not need to pass anything. Once this step is run you can refer to it through WithProperties.

SetMozillaBuildProperties

This step does the job of GetBuildID and more (oh so much more). However, it depends on a slave-side command that is only in Mozilla’s Buildbot tree. To use it, you must be using Buildbot checked out from mozilla/tools/buildbot. (Technically, you could copy and paste the slave command into an upstream Buildbot, but let’s keep it simple). In addition to gathering the BuildID and setting it as a BuildProperty it does the same for the following: appVersion (from application.ini, falling back on platform.ini), the filename, size (in bytes), and sha1 hash of the package, installer, and complete mar are gathered. Please see the in-code documentation for the names of the BuildProperties. Obviously, this step should not be run until the package and/or installer and/or complete mar are created, if you care about their metadata.

As with GetBuildID it needs to know where the objdir is rooted (relative to builddir). Again, if there is no objdir you can simply ignore this parameter.

MozillaStageUpload

(I’m not sure how useful this is to non-Firefox projects as it contains some business logic that may be specific to Fx, but it performs an important function so I figure I’ll include it here.)

This is a bit of a kludgy class as it ends up generating one huge line of bash that gets executed. It was written to be a replacement for the
Tinderbox client ‘pushit()’ function. It’s job is simple: upload packages and mars to a server (for example, stage.mozilla.org). Because it was written to replicate some Tinderbox logic it’s got a lot of different options that I don’t need to go through here. The in-code documentation for it is quite complete and available here: http://mxr.mozilla.org/mozilla/source/tools/buildbotcustom/steps/transfer.py

One note: your BuildSlaves will need passwordless logins to remoteHost with the ssh host key accepted, or else this step will hang. You can test this by doing ‘ssh username@remoteHost’ on your slaves.

In the coming weeks I intend to write a few more posts about Mozilla’s Buildbot usage.

I am officially a QA Engineer but I still help out in Build from time to time. Most recently, I have been working on getting trunk releases automated with our release framework and Buildbot. Rob, Paul, and John both spent considerable time getting automation going for Fx2 and Tb2 releases. With that up and running it has saved a significant amount of human time on recent Firefox and Thunderbird point releases. I have been tasked with getting the same system up and running for trunk releases. Right now, that specifically means Fx3 betas. With tons of support from co-workers work on this is progressing nicely (thank you Nick, Rob, John, Paul, and Coop!).

For those interested, my work is being tracked in bug 379278.

For now, alphas and betas are being done by hand but by the time Firefox 3 Beta 2 is up for release I hope (and intend) to be able to have the automation do some or all of the process.