Axel Hecht Mozilla in Your Language

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 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.

November 5, 2008

extensions, l10n, and tools

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

Wladimir Palant has two recent posts on perl scripts he did for helping him in managing localizations for Adblock Plus and TomTom Home.

Sadly, Wladimir ignored about a year of development in the compare-locales work, and a whole other flock of utilities available as part of the translation toolkit.

This year of development is the result of testing almost 80 different locales against up to 4 different applications and thousands of localizable strings, trying to catch more and more fatal errors in each update. The development hasn’t stopped yet, too. There is more in-depth work going on in Gandalf’s Silme project, for example.

While I appreciate that more folks are paying attention to l10n and extensions, it’s unfortunate to see such work being invested in steps back in capabilities.

Another approach was recently started by Jean-Bernard “Goofy” on the babelzilla wiki and forum. I’m looking forward to add to and help with that project.

October 26, 2008

New l10n dashboard entry points

Filed under: L10n,Mozilla — Tags: , — Axel Hecht @ 9:13 am

As requested in the l10n sessions in Barcelona, I added locale entry hook. Getting all builds for, say, German, you would go to http://l10n.mozilla.org/dashboard/?locale=de. HTH.

October 21, 2008

l10n-merged linux builds on the l10n server

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

I reached another milestone on the l10n builds on the l10n server – reliable l10n depend builds.

A short recap on why they could not be reliable. Details are in Armen’s and John’s presentation in Whistler. First and foremost, l10n builds with missing strings break. They might start, or not, maybe even crash. Or just display the yellow screen of xml parsing death. Now, l10n builds are not really builds, but repackages of an en-US build. Between the time that the en-US build started, or, in hg, the revision it used, and the tip at the time when the en-US binary is finished and available, there can be further l10n-impact landings. We are using the nightly builds for the repackages throughout the whole day even, so the chance that the current en-US source doesn’t correspond to the nightly increases. So even if you know that a localization is good tip vs tip, you can’t say if it’s breaking the previous nightly or not. Huh? Look at the graphs in Armen’s and John’s presentation for more arrows going back and forth in time. ;-)

Enter bugs 452426 and 458014. 452426 added the changeset id to application.ini (thanks Ted), and 458014 refactored browser/locales/Makefile.in with additional logic to extract that info for the build system. I got that one landed yesterday, so we can now get the source stamp of mozilla-central for a firefox build.

Right, good catch, this doesn’t work for comm-central builds. I’ll leave it up to them to figure out how to reproduce the plethora of repos they have.

So far, so good. You download the nightly, unpack, ident (the rule to extract the changeset id). Now you back to your source tree and hg update to that revision, and run compare-locales against that. We’d be able to reliably say “works” or “better don’t touch”.

We promised more, and more pieces came together today.

With reliable compare-locales code, one can not only detect missing strings, but also add missing strings to files. Think about a CPP step, nothing permanent, nothing gets landed upstream. But just for the needs of this particular build, you’d have something that has all strings. Not all translated, some padded from en-US. That works. compare-locales is already able to do merges for a while now, storing the changed files into a separate location. Mostly because I consider changing the source to be evil. So what about missing files? Nothing. Good files? Nothing. How does the build pick up files from merges, l10n, and en-US then?

By rewriting make-jars.pl, enter JarMaker.py. Among overall readibility improvements and removing XPFE hacks, JarMaker.py offers to pick up l10n files from a list of top-level source dirs.  It offers another cute feature, by writing both chrome and extension manifests at once. Now, with bug 458014, we don’t have to run the libs phase for installers and langpack separately. (I never got why we do that until I rewrote make-jars.pl, actually.) The rewrite of JarMaker.py was preceeded by rewriting Preprocessor.py, so that all of the jar generation can happen in a single python process.

Starting from today, all of this came together with my installation of buildbot on the l10n server.

This gives us

  • builds on push, i.e., feedback within 5-10 minutes (real stats pending)
  • comparisons of the l10n tip against both
    • the en-US tip (for the upcoming nightly)
    • changeset of the previous (for the existing nightly, with l10n-merge)
  • html-ified output for both of those
  • updates for the dashboard

and last, but not at all least, a

  • working build, even for partial translations.

Find 60 3.1b2pre linux builds on the l10n server.

Thanks to Armen, I used a few of his new makefile targets for download and upload, he did a bunch of work for the sourcestamps-in-application.ini on cvs, too. Thanks to Ted, the poor fellow had to review all my rewrites and Makefile dependencies foo, and did some patches, too. hgpoller stuff not to forget.

TODO:

  • silme will offer even more reliable merges
  • nightly scheduler for all locales (currently I only build on l10n and en-US l10n-impact changes) (*)
  • mar’s
  • comm-central
  • more Makefile foo to pick up more missing files from en-US in doubt… (*)
  • … or at least document the core set of required files (*)

I won’t take most of those, fwiw. Possibly only the (*) ones.

Sources are in my tooling repository, and there’s an updated version of compare-locales, 0.6, on pypi. No drastic changes here, just some paths fixes, mostly for Windows.

« Newer PostsOlder Posts »

Powered by WordPress