Axel Hecht Mozilla in Your Language

June 5, 2009

got l10n builds

Filed under: L10n,Mozilla — Tags: , , — Axel Hecht @ 3:22 am

’nuff said? Not even remotely.

We’ve had l10n builds as long as I’m working on l10n, actually, I got involved around the time when we started to do them upstream. They always were considerably better than each localizer doing their build at home on whatever (virus-infected) hardware they found, with help from other community members for the platforms they didn’t have. But at the light of day, it was more

That? Yeah, I know. That’s crap.

And I know you can hear my voice in your head right now :-).

Those days are gone. We’re running Firefox and Fennec builds on the releng infrastructure now for a few days that are actually sound builds made to service our l10n community. Some highlights:

  • Builds are finished some 10 minutes after a localizer landing, on all three platforms.
  • There’s no deadlock between different locales, thanks to all l10n builds running on a pool of slaves.
  • Builds are “l10n-merged”, against the actual build that’s repackaged. Independent of missing strings or files, you have a build that can be tested.
  • No more race conditions between nightly and trunk source status.

The impact of this shouldn’t be under-estimated. We are, for the first time in years, producing builds that allow a localizer to actually immediately test. Localizers can work incrementally, translate one feature, check-in, test. No worries if something landed in en-US in the meantime, or whatnot. With the new builds, I have seen various localizers coming from hundreds of missing strings to a tested build on two or three platforms in a matter of a few hours. Back in the days, that was the waiting time for the first build. The new locales all pull all-nighters to get their final bits in. They want to, and now they actually can.

I want to thank coop and armenzg for their great help in making this happen, aki for porting it over to fennec. Of course thanks go to joduinn and sethb, too, for bearing with the ongoing meetings we have, trying to battle the crap down. To dynamis for the initial work on l10n-merge. Also thanks to bsmedberg and Chase for the initial works on both automation and build process, and ted for the various reviews on making our build system catch up.

Finally, we’re not going to stop here. Armen is working on creating the necessary files to get l10n builds on a nightly update channel. Yep, you heard right, that’s where we are right now. I know that KaiRo is working on getting the goodness over to the comm-central apps. And yours truly is hacking on the dashboard together with gandalf, more on that in a different post.

June 2, 2009

Searching l10n

Filed under: L10n,Mozilla — Tags: , , — Axel Hecht @ 7:20 am

I’m contemplating adding search in l10n to the dashboard, and I figured I’d put my thoughts out for lazyweb super-review.

Things we might want to search for:

  • Localized strings
    • in a particular locale
    • in all locales
    • going into a particular app
  • entity names
    • in all of the above

As with the rest of the dashboard, I’d favour a pythonic solution. I’ve run across Whoosh, which seems to offer me what I’d need. In particular I can mark up searches in just keys or just values of our localized strings with the Schemas it offers.

All sounds pretty neat and contained, I’m just wondering if there’s something cool and shiny elsewhere that I’m missing, or if someone came back with “ugh, sucks” from trying Whoosh.

Ad-hoc design for the curious:

For each changeset, we’d parse the old and the new version of the file, getting a list of keys and values, and I’d create two searchable TEXT entries for all changed keys, and added entries. We’d tag that “document” with path, locale, apps, revision, branch. That way, you could search even for strings that aren’t currently in the tip, and get a versioned link to where it showed up first, and last, possibly. Given that we have a lot of data and history, I wouldn’t be surprised if that corpus would get large pretty quickly. I’d expect to not only index l10n but en-US, too. Thoughts?

June 1, 2009

L10n ecosystem in a fishbowl

Filed under: L10n,Mozilla — Tags: , , , — Axel Hecht @ 7:02 am

Building the infrastructure for our l10n builds is hard, mostly because it’s consisting of a ton of things that you don’t have control over. We’re building 3 and a half applications, Firefox, Thunderbird, Fennec, and Sunbird for calendar. Firefox is built on three versions, one of which is still coming from CVS. Thunderbird is one version on CVS, one on hg. We’re touching some 170 hg repos, and a single check-in can do anything between no build, one build, or up to almost 200 builds. Rinse, repeat, yeah, 200 builds for a single landing. Worse than that, you don’t have any control over who’s landing what when where. Bottom line, you really can’t test a change in the l10n build automation reliably in our production setup.

You can create a fake ecosystem, though, and I’ll explain a bit how that works. Of course it doesn’t end up being trivial, but it’s contained. It’s not trying to cover the CVS branches, those would require a setup of bonsai, which I chicken away from. Take this post with a grain of salt, I assume there are some errors here as most of it is typed from memory.

As with any recipe, here are the list of ingredients:

  • A set of hg repositories, both for a fake application and some fake l10n repos.
  • An hg server serving those repositories (make that port 8001).
  • Some buildbot infrastructure working on top of these repositories that you’re trying to test.
  • Possibly an instance of the l10n dashboard presenting both the build and the l10n data.

The initial chunk is creating the repositories. I created a helper script create-stage that does that, which is part of buildbotcustom/bin/l10n-stage. It’s main purpose is to get the templates, hooks etc that are part of our server-side setup on hg.mozilla.org, create some upstream repos for en-US and l10n, and push some initial content from a set of working clones. You call it like

python l10n-stage -l stagedir

The -l keeps the l10n repositories from pushing their initial content, which yields a scenario that is closer to what we have upstream, i.e., a flock of en-US pushes before the l10n repos start. This command creates a bunch of main repositories in the repos subdir of stagedir, and a bunch of working clones in workdir. It also creates a webdir.conf, that you’ll use to run the local hg http server. Let’s run that now, in stagedir:

hg serve -p 8001 --webdir-conf=webdir.conf -t repos/hg_templates

Now you have a local setup of a application repository called mozilla, and 4 localizations in l10n, ab, de, ja-JP-mac, x-testing. They’re all equipped with the same hooks that we run on hg.m.o, in particular, they support pushlog.

Now on to the buildbot infrastructure. There’s a sibling script to create-stage, create-buildbot, which should create a master setup that is rather close to what we run on releng. It supports various degrees of parallelism for multiple slaves on three platforms, does only dummy builds, though. IIRC. I want to go into more detail on how to set up the new dashboard master, though.

The dashboard master is merely running compare-locales on the actual source repositories. It does come with our bonsai replacement pushes, though. That’s basically a pushlog spanning repositories, including file and branch indexing. Here’s the basic software components you’ll need:

  • django 1.0.x (1.1pre might work, too)
  • buildbot 0.7.10p1, older versions won’t work

and from hg.m.o, you’ll need compare-locales, locale-inspector, l10n-master, buildbotcustom and django-site.

Firstly, you set up the db. sqlite and mysql should both work, mysql is actively tested. Edit the various settings.py files to reference your db, with an absolute path if sqlite, and create the schema. The main entry point to the django site is l10n_site, go in there to run python manage.py syncdb. Another edit you want to do is to point REPOSITORY_BASE to a dir where you can stage another set of clones of your repos. I suggest to not share the hg master repo dir here.

Next, create a buildbot master and a slave. You do that by running the buildbot create-master command on your local clone of l10n-master. You’ll need to adapt l10nbuilds.ini to the test set up,

[test]
app = browser
type = hg
locales = all
mozilla = mozilla
l10n = l10n
repo = http://localhost:8001/
l10n.ini = browser/locales/l10n.ini
builders = compare

I should put that into the repo somewhere, I guess.

Setting up the slave is trivial, you need to make sure it’s on the same machine, though. It will run on the django clones directly.

Before starting master and slave, make sure that all the deps are in your PYTHONPATH.

Last but not least, you need to get all the pushes from your repo setup into your django setup. First, you need to tell the db which repositories it’s supposed to get from where. I created sample data for the test app, which you can load by

python manage.py loaddata localhost

The repositories I use for the production environment are in hg_mozilla_org, fwiw. You fill the database with the actual push data by running a twisted daemon. Inside django-site, run

twistd get-pushes -n -t 1 -s l10n_site.settings

That will ping one repo per second, not update, with data from l10n_site.settings. Now you have everything set up, and you can start to edit en-US and l10n files in your workingdir, and push, and see how that changes your builds and dashboard.

The buildbot waterfall will be on port 8364, and with python manage.py runserver, the dashboard will show up on port 8000. None of this is setup to be on a production server at this point, but it’s good for testing.

Update: Forgot to mention that you need to bootstrap the repo lists.

May 29, 2009

The folks we know

Filed under: L10n,Mozilla — Tags: , — Axel Hecht @ 2:13 pm

Seth has blogged his response to Walt Mossberg’s interview with Mitchell and John, on top of the already great answer the two provided in the interview on

Why wouldn’t it just be better for the consumer to go with the company that’s hired experts to do its translations?

and here’s my take.

The essential point to me is that we do get experts. We get experts in localizing Firefox. And we get experts we know. The people that spend their free time and passion to create Firefox in their language don’t do it because they can lip sync Shakespeare into Portuguese, but because they share the values and mission that make Firefox Firefox. They care about the experience that people have with the web in their language.

The reason why our localizations rock is that our localizers know us, and we know them, and that we actually speak the same language.

March 24, 2009

Right to left, explained

Filed under: L10n — Tags: — Axel Hecht @ 11:27 am

If you ever felt like you technically understand right-to-left (RTL), but lack a feeling for it, this joke might help.

March 23, 2009

New hook for l10n feedback

Filed under: L10n,Mozilla — Tags: , — Axel Hecht @ 3:51 am

We have a new hook for folks to get feedback on how to expose patches to localizers. We created a bugzilla account community@localization.bugs, which interested localizers are going to follow. I for one do at least.

So when you have a bug and need input on how to localize it, you can now CC :l10n (part of that accounts real name) instead of just me, and get feedback from a variety of different localizers.

If you’re a localizer that’s willing to help out our developers on creating good patches for l10n, please start watching community@localization.bugs by editing your mail preferences on bugzilla.

February 27, 2009

Fennec added to l10n dashboard

Filed under: L10n,Mozilla — Tags: , , — Axel Hecht @ 10:45 am

I just added Fennec localization stati to the l10n dashboard. It’s only pretending to do arm linux tgz’s right now, and it’s not uploading them anywhere. I expect that will happen soon on the main build machines.

There were a few funky edges to make fennec build similar to what we have in Firefox now. Most notably, Fennec uses a completely different directory structure, which looks really familiar once on disk. The main difference is that when Fennec developers check in to a file in mobile/locales/en-US/chrome, that file is actually in locales/en-US/chrome in the repository. When a localizer catches up with that change, they’re really landing to ab-CD/mobile/chrome. That requires some special hooks in the code that watches for l10n changes on the build master. The biggest hurdle was surprisingly the all-locales file in the end. That just blew the logic I had. I’m now loading the all-locales file by assuming that it’s right next to l10n.ini, while I’m still using the path to all-locales in l10n.ini to control what the AllLocalesWatcher pays attention to, to update the list of all-locales in the master when that’s changing in the repo.

What I really like is that we’re adding this product to our localization story in good shape. In my little universe, the big winner is that we’re starting with l10n-merge working. Thanks to mfinkle’s timely reviews, I added logic to the build to export both the gecko and the fennec revisions of the en-US build that’s repackaged, so one can run compare-locales (with or without l10n-merge) against the sources that actually went into the build. This is really important to get the missing strings right, and to ensure that the build is working as good as it can.

So, localizers, now is the time to land. Please make sure to touch base with Stas on any questions regarding web services. Using what we have for Firefox is a good base, though. Gandalf can help with general technical issues, as can I. If you’re not part of the fun, and want to join, please file a bug.

We’re well aware that you’ll need a descent infrastructure to test with. What is most important to you guys? Leave a comment on this post?

February 24, 2009

Triggering l10n builds

Filed under: L10n,Mozilla — Tags: , — Axel Hecht @ 4:03 pm

Localized builds are easy, you take away en-US, throw in the localized files, and you’re done. Piece of cake.

Throw in 3 platforms, four different builds each, 70 locales, and you have a lot of cake.

Yesterday I wrapped up a little experiment that allows one to set up a testing environment for l10n builds, and I figured I’d share some of the outcome. The trick here is to take away the complexity of the actual build and abstract away things like getting the en-US binary, the right source repos etc, and to just focus on when l10n builds should do what. There are more details on what the actual l10n build is supposed to do on the l10n deliverables page. The files for this experiment are in my temporary fork of buildbotcustom/bin. The setup includes l10n builds, en-US regular builds, and en-US nightlies. As far as the interaction between en-US and l10n builds go, we don’t need unittest and talos boxens here. All builds on this setup are fakes, that is, they take a few seconds (mac being quick, linux a tad slower, windows being slow), en-US builds taking longer than a l10n repack. The individual builds are represented by a yellow “Build 3” box, followed by a green box for the only step of that build. It displays some relevant information, in particular, which slave it’s run on (there were two per platform, in one pool), which locale it’s building, and what kind of build it is. Nightlies and regular en-US builds are easy, just the regular column names you’re used to, but the l10n builds can use a little legend:

A build as triggered by a localizer, building Firefox for ja-JP-mac, on slave sw1 would look like this. That would be on Slave Windows 1 (starting with 0, this is the second slave). l10n build
A build as triggered by a check-in for en-US, building Firefox for ja-JP-mac, on slave sw1. The difference here is that it’s showing compareOnly, we’ll see in the flow below why that is. l10n build
A nightly l10n build would again show the locale and the slave, in addition to the fact that it’s a nightly. l10n build

All of these builds share the same builder, for all locales. Just the platforms require different builders, as they’re delegating work to different groups of slaves. That’s because in the end, it doesn’t matter who or what caused that build to be made, the interesting point is whether the build is good or not. We’re not using different builders per locale, just because that doesn’t scale. In this test setup, there are 4 locales, but in real life, we have 70-ish. There’s just not enough space in my flat for monitors to display that.

Let’s move on to see some actual builds in action. Easiest first, as that looks most familiar to what we do with our regular builds. A localizer checks in, and in return, we do a build on all three platforms.

localizer-triggered build

You see the three Firefox test builds on each platform, which are the l10n builders. There is nothing on the mozilla build and mozilla nightly columns, which are the en-US builds and nightlies, resp. There’s only one locale built, in this case, ja-JP-mac, which is the locale for which I had pushed content here. Note to the Japanese localizers, this is on my test setup, so the hg repos I pushed to were local, and in fact, didn’t resemble anything close to your repos.

On to the next scenario, slightly more tricky. Nightly builds. Nightly builds for en-US are triggered by a scheduler that runs each day at a particular time. For l10n, we want repacks of those builds. Which implies that those builds are done, so we run them later.

en-US and nightly l10n builds

You can see a nightly build for each platform in en-US, linux being quick, mac slightly slower, windows being a bore. After a while, there is a l10n build for each locale (this setup has 4, ab, de, ja-JP-mac, x-testing) for each platform, being spread over the various slaves of the pool. Remember, we had two slaves per platform here. In real life, there are many more.

Now we start to see some pitfalls. The scheduler that triggers the nightly l10n builds needs to wait for the en-US builds, so despite the fact that the linux build is done, it’s not scheduled before we expect the windows build to be done. Right, expect. There’s actually no guarantee that the windows build, or any other platform for that matter, are actually done. We just delay the l10n builds to an extent that this isn’t a problem in practice. Another pitfall are respins. If the nightly build is busted, we go in and trigger new nightly builds. The l10n scheduler doesn’t know about those, so l10n builds are not respun. That’s covered by bug 469364.

Now on to the really fun pieces. Let’s look at what happens if a core developer checks in a patch that changes strings. Of course, that triggers the regular en-US builds. But what do we want to do for l10n? We should use this occasion to notify our l10n community that there is outstanding work, so there’s good reason to actually start something right away. Let’s look at what the builds do.

en-US and l10n builds for a l10n-impact change

You can see that the en-US builds kick off at the same time as the l10n builds. Now, what should the l10n builds do? Firstly, notify the localizer about the new strings. Good, let’s do that. But what more? Really, nothing, the next good thing would be to show off the new strings in context, but as you can see from the waterfall (there is some good in waterfalls, lastly), the en-US builds are far from done so far. That’s why the l10n builds have compareOnly set. These builds should merely run compare-locales and report the current string work on the dashboard, and be done with it.

Three kinds of builds for l10n. Why did I mention four initially? I left out the release builds. Those come with different rules and requirements. More details on aforementioned l10n deliverables page.

For the curious ones thinking about how we can use our computing resources, and why sometimes builds take a while without something happening, you can see a nice battle between different builders over the same slave pools, in particular, the slightly cut off l10n builds were waiting on the en-US builds to free their resources.

I hope that this post gives you a more visual idea of what we need to do in l10n builds land, and why.

December 19, 2008

working demo, waterfall and more

Filed under: L10n,Mozilla — Tags: , , — Axel Hecht @ 4:50 pm

Thanks to Reed, I just put up my latest pet project up on the l10n server.

It’s offering a new web interface for buildbot builds. It does so by feeding the status data that buildbot has into a database on the one end, and on the other end is a django app displaying that data.

The nice thing about this is that writing features (or fixing bugs) is “just webdev”. Compared to whatever you want to call tinderbox hacking.

There are already a few concepts demoed on the site. All urls are in flux, note the “stage” in them. But the principle should be obvious.

Firstly, you can get to a regular waterfall on waterfall. Yes, there are some time-sorting issues there. But it’s quick, which is cool. Compare it to the regular buildbot waterfall (didn’t bother checking which timerange that shows). And it offers a nice compromise (IMHO) for displaying detail or not. For finished builds, it shows one box per build. For builds in progress, it shows a box per step (it doesn’t show a box for the build for those steps, which is confusing). It has a blame column, too. Whenever you see a change number, that links to a new page, which lists all builds for that particular change. This one shows an en-US check-in with all locales turning red, for example. Another one just shows how things go green for Arabic again, as that localizer checked in.

For the l10n builds, that’s peanuts, but if you’re landing on a tree with real compiles, being able to follow all builds for your landing, and no others sounds cool.

And django comes with helpers for generating feeds, so creating a meaningful live bookmark to follow your own landing doesn’t seem like an unsolvable RFE.

There’s more. You can restrict the waterfall to only show builds for a particular slave. You can restrict the shown builds to only show builds with a particular property, say, the Macedonian builds, compared to all builds.

There’s obviously lots of room for improvement, the code is in the tinder app in my hg repo. Volunteers welcome.

December 2, 2008

1.9.1 l10n repositories open for business

Filed under: L10n,Mozilla — Tags: , — Axel Hecht @ 2:40 pm

To echo this on planet, too, the 1.9.1 l10n repositories are open for business.

Please read my introductory post in mozilla.dev.l10n before making changes to both the l10n-central and the releases/l10n-mozilla-1.9.1 repositories.

If you have questions, please ask in #l10n or in the newsgroup.

I have triggered builds on all comm-central apps and Firefox 3.1 to pick up the new setup, so the dashboard is all good again. The tree names remain unchanged, i.e., fx31x is the Tree towards Firefox 3.1, now picking up changes on the releases/l10n-mozilla-1.9.1 repositories as well as releases/mozilla-1.9.1 for en-US changes.

« Newer PostsOlder Posts »

Powered by WordPress