<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ben Hearsum (Posts about buildbot)</title><link>https://hearsum.ca/</link><description></description><atom:link href="https://hearsum.ca/categories/buildbot.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2025 &lt;a href="mailto:ben@hearsum.ca"&gt;Ben Hearsum&lt;/a&gt; </copyright><lastBuildDate>Thu, 30 Jan 2025 16:13:56 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Buildbot &amp;lt;-&amp;gt; Taskcluster Bridge Now in Production</title><link>https://hearsum.ca/posts/buildbot-taskcluster-bridge-now-in-production/</link><dc:creator>Ben Hearsum</dc:creator><description>&lt;p&gt;A few weeks ago I gave &lt;a href="http://hearsum.ca/blog/buildbot-taskcluster-bridge-an-overview.html"&gt;a brief overview of the Buildbot &amp;lt;-&amp;gt;Taskcluster Bridge&lt;/a&gt; that we've been developing, and Selena &lt;a href="http://www.chesnok.com/daily/2015/06/03/taskcluster-migration-about-the-buildbot-bridge/"&gt;provided some additional details&lt;/a&gt; about it yesterday. Today I'm happy to announce that it is ready to take on production work. As &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1118394"&gt;more&lt;/a&gt; &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1119546"&gt;and&lt;/a&gt; &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1135206"&gt;more&lt;/a&gt; &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1149142"&gt;jobs&lt;/a&gt; from our CI infrastructure move to Taskcluster, the Bridge will coordinate between them and jobs that must remain in Buildbot for the time being.&lt;/p&gt;

&lt;h2&gt;What's next?&lt;/h2&gt;
&lt;p&gt;The Bridge itself is feature complete until our &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1156305"&gt;requirements change&lt;/a&gt; (though there's a couple of &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1164819"&gt;minor&lt;/a&gt; &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1168099"&gt;bugs&lt;/a&gt; that would be nice to fix), but most of the Buildbot Schedulers still need to be replaced with Task Graphs. Some of this work will be done at the same time as porting specific build or test jobs to run natively in Taskcluster, but it doesn't have to be. I made a proof of concept on &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1157242"&gt;how to integrate selected Buildbot builds into the existing "taskcluster-graph" command&lt;/a&gt; and &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1157310"&gt;disable the Buildbot schedulers that it replaces&lt;/a&gt;. With a bit more work this could be extended to schedule all of the Buildbot builds for a branch, which would make porting specific jobs simpler. If you'd like to help out with this, let me know!&lt;/p&gt;</description><category>buildbot</category><category>planet-mozilla</category><category>taskcluster</category><guid>https://hearsum.ca/posts/buildbot-taskcluster-bridge-now-in-production/</guid><pubDate>Thu, 04 Jun 2015 15:11:34 GMT</pubDate></item><item><title>Buildbot &lt;-&gt; Taskcluster Bridge - An Overview</title><link>https://hearsum.ca/posts/buildbot-taskcluster-bridge-an-overview/</link><dc:creator>Ben Hearsum</dc:creator><description>&lt;p&gt;Mozilla has been using &lt;a href="http://buildbot.net"&gt;Buildbot&lt;/a&gt; as its continuous integration system for Firefox and Fennec for many years now. It enabled us to switch from a machine-per-build model to a pool-of-slaves model, and greatly aided us in getting to our current scale. But it's not perfect - and we've known for a few years that we'll need to do an overhaul. Lucky for us, the FirefoxOS Automation team has built up a fantastic piece of infrastructure known as &lt;a href="http://docs.taskcluster.net/"&gt;Taskcluster&lt;/a&gt; that we're eager to start moving to.&lt;/p&gt;

&lt;p&gt;It's not going to be a small task though - it will take a lot more work than taking our existing build scripts and running them in Taskcluster. One reason for this is that many of our jobs trigger other jobs, and Buildbot manages those relationships. This means that if we have a build job that triggers a test job, we can't move one without moving the other. We don't want to be forced into moving entire job chains at once, so we need something to help us transition more slowly. Our solution to this is to make it possible to schedule jobs in Taskcluster while still implementing them in Buildbot. Once the scheduling is in Taskcluster it's possible to move individual jobs to Taskcluster one at a time. The software that makes this possible is the Buildbot Bridge.&lt;/p&gt;

&lt;p&gt;The Bridge is responsible for synchronizing job state between Taskcluster and Buildbot. Jobs that are requested through Taskcluster will be created in Buildbot by the Bridge. When those jobs complete, the Bridge will update Taskcluster with their status. Let's look at a simple example to see see how the state changes in both systems over the course of a job being submitted and run:&lt;/p&gt;
&lt;table style="border: solid 1px black; border-collapse: collapse;"&gt;
&lt;tr style="border: solid 1px black;"&gt;
&lt;th style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Event&lt;/th&gt;
&lt;th style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Taskcluster state&lt;/th&gt;
&lt;th style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Buildbot state&lt;/th&gt;
&lt;/tr&gt;
&lt;tr style="border: solid 1px black;"&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Task is created&lt;/td&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Task is pending&lt;/td&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;--&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="border: solid 1px black;"&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Bridge receives "task-pending" event, creates BuildRequest&lt;/td&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Task is pending&lt;/td&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Build is pending&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="border: solid 1px black;"&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Build starts in Buildbot&lt;/td&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Task is pending&lt;/td&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Build is running&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="border: solid 1px black;"&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Bridge receives "build started" event, claims the Task&lt;/td&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Task is running&lt;/td&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Build is running&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="border: solid 1px black;"&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Build completes successfully&lt;/td&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Task is running&lt;/td&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Build is completed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style="border: solid 1px black;"&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Bridge receives "build finished" event, reports success to Taskcluster&lt;/td&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Task is resolved&lt;/td&gt;
&lt;td style="border: solid 1px black; padding: 2px 5px 2px 5px"&gt;Build is completed&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br&gt;
&lt;p&gt;The details of how this work are a bit more complicated - if you'd like to learn more about that I recommend watching &lt;a href="https://vreplay.mozilla.com/replay/showRecordDetails.html?recId=1879"&gt;the presentation I did about the Bridge architecture&lt;/a&gt;, or just have a read through &lt;a href="http://hearsum.ca/slides/buildbot-bridge-overview/#/"&gt;my slides&lt;/a&gt;&lt;/p&gt;</description><category>buildbot</category><category>planet-mozilla</category><category>taskcluster</category><guid>https://hearsum.ca/posts/buildbot-taskcluster-bridge-an-overview/</guid><pubDate>Fri, 08 May 2015 16:37:02 GMT</pubDate></item><item><title>Status update on smaller pools of build machines</title><link>https://hearsum.ca/posts/status-update-on-smaller-pools-of-build-machines/</link><dc:creator>Ben Hearsum</dc:creator><description>&lt;p&gt;Last week &lt;a href="http://glandium.org/blog/?p=3170"&gt;glandium&lt;/a&gt; and I &lt;a href="http://hearsum.ca/blog/experiments-with-smaller-pools-of-build-machines/"&gt;wrote a bit about how shrinking the size of our build pools&lt;/a&gt; would help get results out faster. This week, a few of us are starting work on implementing that. Last week I called these smaller tools "hot tubs", but we've since settled on the name "jacuzzis".



We had a few discussions about this in the past few days and quickly realized that we don't have a way of knowing upfront exactly how many machines or to allocate to each jacuzzi. This number will vary based on the frequency of the builders in the jacuzzi (periodic, nightly, or on-change) as well as the number of pushes to the builders' branches. Because of this we are firmly committed to making these allocations dynamically adjustable. It's possible that it may take us many attempts to get the allocations right - so we need to make it as painless as possible. This will also enable us to shift allocations if there's a sudden change in load (eg, mozilla-inbound is closed for a day, but b2g-inbound gets twice the number of pushes as usual).



There's two major pieces that need to be worked on: writing a jacuzzi allocator service, and making Buildbot respect it.



The allocator service will be a simple JSON API with the following interface. Below, $buildername is a specific type of job (eg "Linux x86-64 mozilla-inbound build"), $machinename is something like "bld-linux64-ec2-023" and $pool is something like "bld-linux64":

&lt;/p&gt;&lt;ul&gt;

&lt;li&gt;GET /builders/$buildername - Returns a list of machines that are allowed to perform this type of build.&lt;/li&gt;

&lt;li&gt;GET /machines/$machinename - Returns a list of builders that this machine is allowed to build for.&lt;/li&gt;

&lt;li&gt;GET /allocated/$poolname - Returns a list of all machines in the given pool that are allocated to any builder.&lt;/li&gt;

&lt;/ul&gt;



Making Buildbot respect the allocator is going to be a little tricky. It requires an explicit list of machines that can perform jobs from each builder. If we implement jacuzzis by adjusting this list, we won't be able to adjust these dynamically. However, we can adjust some runtime code to override that list after talking to the allocator. We also need to make sure that we can fall back in cases where the allocator is unaware of a builder or unavailable.



To do this, we're adding code to the Buildbot masters that will query the jacuzzi server for allocated machines before it starts a pending job. If the jacuzzi server returns a 404 (indicating that it's unaware of the builder), we'll get the full list of allocated machines from the /allocated/$poolname endpoint. We can subtract this from the full list of machines in the pool and try to start the job on one of the remaining ones. If the allocator service is unavailable for a long period of time we'll just choose a machine from the full list.



This implementation has the nice side effect of allowing for a gradual roll out -- we can simply leave most builders undefined on the jacuzzi server until we're comfortable enough to roll it out more widely.



In order to get things going as quickly as possible I've implemented the jacuzzi allocator as static files for now, supporting only two builders on the Cedar tree. &lt;a href="https://mozillians.org/en-US/u/catlee/"&gt;Catlee&lt;/a&gt; is working on writing the Buildbot code described above, and &lt;a href="https://mozillians.org/en-US/u/rail/"&gt;Rail&lt;/a&gt; is adjusting a few smaller tools to support this. &lt;a href="https://mozillians.org/en-US/u/jhopkins/"&gt;John Hopkins&lt;/a&gt;, &lt;a href="https://mozillians.org/en-US/u/taras"&gt;&lt;/a&gt;Taras, and &lt;a href="https://mozillians.org/en-US/u/glandium/"&gt;Glandium&lt;/a&gt; were all involved in brainstorming and planning yesterday, too.



We're hoping to get something working on &lt;a href="https://tbpl.mozilla.org/?tree=Cedar"&gt;the Cedar branch&lt;/a&gt; in production ASAP, possibly as early as tomorrow. While we fiddle with different allocations there we can also work on implementing the real jacuzzi allocator.



Stay tuned for more updates!</description><category>buildbot</category><category>planet-mozilla</category><category>releng</category><guid>https://hearsum.ca/posts/status-update-on-smaller-pools-of-build-machines/</guid><pubDate>Tue, 11 Feb 2014 23:04:46 GMT</pubDate></item><item><title>Buildbot Scheduler and Builder graphing</title><link>https://hearsum.ca/posts/buildbot-scheduler-and-builder-graphing/</link><dc:creator>Ben Hearsum</dc:creator><description>&lt;p&gt;One of the the most important systems I work is the release automation for Firefox and Thunderbird. The process behind the automation long predates me, but I've been deeply involved in &lt;a href="http://hearsum.ca/blog/release-automation-part-1-bootstrap/"&gt;automating&lt;/a&gt;, &lt;a href="http://hearsum.ca/blog/release-automation-part-2-mercurial-based-v1/"&gt;refining&lt;/a&gt;, and &lt;a href="http://hearsum.ca/blog/release-automation-part-3-improvements-optimizations-2009-to-early-2011/"&gt;optimizing&lt;/a&gt; it. It shouldn't come as any surprise that one of the biggest challenges of working on such a complex system is understanding how the smaller pieces fit together to make the whole system. For the release automation we have an advantage though: the smaller pieces are generally Buildbot Builders, and the things that fit them together are generally Buildbot Schedulers. Awhile ago I was improving parallelism for l10n repacks and found it extremely difficult to reason about whether or not my changes would actually create the desired Builders and string them together correctly. I threw together some (terrible) code that spat out a digraph of the release automation's Builders and Schedulers. By comparing the before and after graphs I was able to iterate on some parts of my code without spending hours and hours testing.



This week I finally got around to tidying up and packaging this code as a more general purpose tool. It's not nearly complete and has many rough edges, but as a very basic tool to help you understand non-trivial Buildbot installations, I think it's wonderful. It's &lt;a href="https://pypi.python.org/pypi/buildbot-scheduler-graph/1.0"&gt;pip installable&lt;/a&gt; ("buildbot-scheduler-graph") and &lt;a href="https://github.com/bhearsum/buildbot-scheduler-graph"&gt;available on Github&lt;/a&gt;. Once you've got it, try it out with "buildbot-scheduler-graph /path/to/your/master.cfg /path/to/output-dir". Here's what &lt;a href="https://people.mozilla.com/~bhearsum/mozilla-scheduler-graphs/"&gt;Mozilla's scheduler graphs looks like&lt;/a&gt;. What do yours look like?&lt;/p&gt;</description><category>buildbot</category><category>planet-mozilla</category><guid>https://hearsum.ca/posts/buildbot-scheduler-and-builder-graphing/</guid><pubDate>Wed, 22 May 2013 05:59:49 GMT</pubDate></item><item><title>Which build infrastructure problems do you see the most?</title><link>https://hearsum.ca/posts/which-build-infrastructure-problems-do-you-see-the-most/</link><dc:creator>Ben Hearsum</dc:creator><description>&lt;p&gt;I'm hoping to tackle &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=505512"&gt;bug 505512 (Make infrastructure related problems turn the tree a color other than red)&lt;/a&gt; in the next few weeks. Most of the ground work for it is laid, which means that most of what I'll be doing is parsing logs for infrastructure errors.



So, what errors do you see most from our build infrastructure? Are there other things that you would classify as infrastructure issues? Please add any suggestions you have to this Etherpad: &lt;a href="http://etherpad.mozilla.com:9000/build-infra-errors"&gt;http://etherpad.mozilla.com:9000/build-infra-errors&lt;/a&gt;&lt;/p&gt;</description><category>buildbot</category><category>tinderbox</category><guid>https://hearsum.ca/posts/which-build-infrastructure-problems-do-you-see-the-most/</guid><pubDate>Fri, 13 Aug 2010 18:31:03 GMT</pubDate></item></channel></rss>