Archive for February, 2007

Developer Control Panel to be Locked

Tuesday, February 27th, 2007

The addons.mozilla.org developer control panel will be locked at 3PM PST (11PM GMT) on February 28th as a part of our plan to migrate data safely and accurately to our new site.

While locked, we will be focusing on reviewing remaining add-ons in the review queue in order to get everyone’s add-ons up to date then we will migrate all data to our new database.

If you have any last-minute changes or updates to make, please make them before this time. Thank you for your cooperation.

Remora update and plan

Thursday, February 22nd, 2007

As morgamic wrote on Friday, the Remora team have all had a long 9 days trying to get the new version of AMO out the door and make all its improvements available to our users. As we discovered to our chagrin, our performance testing on the stage environment did not really map well into real-world results, and the result was unacceptable load on the app cluster — unacceptable to the extent that pretty much everything that was sharing that database was killed by it, in fact.

With the assistance of IT (and especially of oremj, who wrote and operated a load replay tool to help us make sure we were testing the right mix of requests), we’ve been able to gather more data on where we were too slow, and since Friday we’ve been able to make some rather significant improvements to our impact on the database. Specifically, if I may be permitted a nerdy digression: on Friday, a single application server was able to generate a load of 7.0 on a single database server, but in our tests today, that same application was only able to generate a load of 0.04 (sic). We have more performance options still in our quiver if we need them, but because they are all non-trivial in terms of risk of regression we are hoping that we’ll have reached an acceptable level with this most recent work and will be able to hold off on additional optimizations until after the initial release.

Over the course of the week, and even the last few days, we’ve seen that the performance improvements we made did indeed cause us to have regressions, and while our test suite was able to catch some of them, it did not catch all of them. We want to get more user (including add-on developer) testing to help us prove out the system, and also to collect more of the great feedback that’s already been so helpful in improving the site. Also, we have learned all too well that running tests on our stage setup is not a surefire predictor of performance on the production cluster.

And if that weren’t enough, we now have a snapshot of the existing AMO database that’s more than a week old, and is missing many changes since that time. We don’t want to casually throw away the work of our community or reviewers, so we are faced with the need to re-migrate the database — and incorporate changes that people have made on preview.amo to update their add-ons for the new capabilities of Remora as well.

So what’s next?

Measure twice, cut once

First, we have a maintenance window with IT right now in which we will not be deploying Remora, but running full-scale load testing against the preview installation. This should give us a pretty reliable picture of how Remora will perform “in the wild”, and will give us additional data on where our remaining hot spots are. If these results show that we’re still substantially worse than the current AMO in terms of impact on the cluster, we’ll have to circle back and pick another appropriate performance arrow to shoot. We are optimistic, though, that our 17,400% improvement will put us in a pretty good position here.

Retrace our steps

Once we’re confident that we’re in scoring range in terms of performance, we’re going to lock down the current AMO system such that new add-ons and updates can’t be submitted, and we’ll direct developers to the new site for submission of new add-ons and updates. This will introduce perhaps a few weeks of lag into the update process, but it turns out (alas) that the current system’s review-scaling problems are such that updates sometimes have to wait for at least that long today, so it’s not as shocking a situation as it might be if we were coming from a more efficient system. For high-priority updates (security updates, or updates to our most popular add-ons), we’ll be instructing people to file bugs, and we’ll handle the updates by hand on the current site. It’ll be a bit painful, but we don’t want to find ourselves in this re-migration situation again before we release, which would be even more painful.

Tell us what you really think

We’ll also be driving more users from the current site and other parts of the community to the new site, to get their feedback and to get developers to work on updating their categorization and summaries, for example. This should help us catch a lot of simple polish bugs, as well as improving our general confidence in the app significantly.

Make a list, check it twice

Based on their feedback and our own additional testing over the next week and a half (again, assuming that the performance groundhog sees his shadow tonight), we’ll construct a release-blocker list, and from that an end-game release schedule.

What’s this all about, anyway?

And then we’ll have Remora live as addons.mozilla.org. This will give us some powerful tools for bringing more of the Mozilla community into the add-ons world, including:

  • deep support for localization, including translation of add-on descriptions, version notes, and user reviews
  • a more inclusive and transparent review and nomination model for making sure that the add-ons that we put in front of 80M users are up to the challenge, and that users get what they expect with clear descriptions and meaningful ratings
  • a discussion system for users and developers to communicate with each other, helping to provide a better channel for feedback and support
  • a more robust code base for even more improvements in the future

Fool me once, shame on…don’t be fooled again

Or: “didn’t you tell a bunch of reporters that you were releasing on February 12th?”

It’s embarrassing and frustrating to miss deadlines (as I know from very extensive experience!), and painful to not be able to put your hard work out into the world where it can help people. The entire Remora team has been working almost literally around the clock for the last few weeks, and very hard for half a year before that, and we would like nothing in the world more than to deliver it to the world.

Well, one thing in the world that we’d like more: to be confident when we release it that it’s up to the daunting task of representing add-ons to many, many millions of Firefox users, and that it’ll be a release that we’re appropriately proud of. We’d rather be late than damage the world’s impression of Mozilla or add-ons, and we’d be doing a disservice to the exact users we’re working to help if we were to push it out before we were confident it was ready.

It’s been a tremendous learning experience building an application with such a huge exposure to the world, and a rewarding one, though not one that we would necessarily want to do every quarter. We’re ready to correct our course and move confidently towards the finish line, or perhaps towards another metaphor of completion entirely.

Thanks to everyone for their patience and support, and especially:

  • to the IT team for their support and creativity in helping us find a path to better performance,
  • to our community of testers (I’m looking at you, Wladimir) for not only helping us identify problems but also suggesting solutions to them,
  • to our localizers, for their patience with our early disorganization and frequent string changes.
  • For the (somewhat exhausted but still pretty upbeat) Remora team,

    Mike Shaver

AMO Deployment This Week

Sunday, February 18th, 2007

Last week we had challenges in deploying the new addons.mozilla.org. We’ve done our best to keep everyone up to date through this blog. We know we are all anxious to get things going, so we wanted to make sure everyone is kept up to date with what’s going on.

Scalability of our new site has been a unique challenge for us. We are trying to tackle localization for a large number of locales for both static and dynamic data, which is something not many sites do — and especially not many sites with our volume of traffic.

We have faced unique challenges in trying to reproduce the staggering load that addons.mozilla.org gets. Load testing could only get so close to the environment we have in production. So at some point, we have to announce an outage window and give things a shot with real traffic.

During our maintenance windows this week, we have gathered important data on what we may be able to do to mimic that load, and we should be able to better test changes before we put them in production. Once we get through the launch we’ll do a full postmortem to help us improve for next time.

Our latest setback has been a database bottleneck for retrieving localized add-on data from our translations table. We are working through this and testing has shown improvements so far.

That said, there are still more adjustments we can make to improve site performance. We will continue to work on tuning our site, and our final deployment will definitely not happen until we are sure the site will be reliable for our users.

The delays, while frustrating (especially to us!), were made in the best interests of our community. We want them to have a snappy and reliable site. We want a snappy and reliable site so we can get our own add-ons, too. :)

If anybody has questions or suggestions, feel free to contact any of us — probably easiest to find us in IRC in #amo.

Thanks to everyone who has helped us and supported our efforts — we’re almost home so hang in there.

AMO v3 (Remora) Delay

Wednesday, February 14th, 2007

If you’re reading this, you’ve probably noticed that AMOv3 still hasn’t taken over addons.mozilla.org. We’ve hit some unforeseen problems that have been plaguing us since our attempt to launch on Monday.

Without getting into the details, we’re having some issues with the way our infrastructure is caching (or not caching) the new AMO v3 pages. Rather than risk a slow, (and thus, frustrating) user experience at launch, we’ve decided to iron out the problems with the servers before deployment.

That means the new site still isn’t live, and won’t be until we can get things fixed. I assure you that we’re all working hard on bringing the community the best possible experience.

Thanks for your patience.

AMO v3 (Remora) launch delayed 24 hours

Monday, February 12th, 2007

As I’m sure many of you are aware, today (Feb 12th) was the scheduled release day for Remora, which will bring localization, a more inclusive review system, and discussion capabilities to the addons.mozilla.org site. We had a maintenance window scheduled for today from 7-11pm Pacific, and during that period we discovered a number of issues related to differences between our test environment and the production one, as well as some late-breaking bugs found by our testers.

While we were able to resolve all but one of those issues to our satisfaction — and that of our test suite — we ended up making sufficient changes to the system that we wanted to take another day to test it in the production environment before we put it in front of Firefox’s tens of millions of users.

It’s a heart-breaking decision for the Remora team, but we think it’s the right thing for our users, and we’d rather have 24 hours of disappointment than put the users’ experience at risk.

On the bright side, this will give us an extended window to take updates from our intrepid localizers, as those changes are sufficiently low risk that we’re comfortable taking them during tomorrow’s test-and-test-some-more window.

Thanks to everyone for their patience and support; we’re so close now that we can taste it.

AMO 3.0 Beta - Public Preview

Tuesday, February 6th, 2007

We are excited to announce the Remora Beta update to the preview site today. This update encompasses all of the updates since the Alpha release, as well as the new Developer Control Panel.

Improvements you’ll find in the Remora Developer pages:

  • No more waiting for mirrors to sync to download your add-on - we aren’t storing the files on mirrors anymore
  • Upload multiple files at the same time (for different platforms)
  • Localize all aspects of your add-on, versions, and previews (note that the Developer interface itself is not yet localized)
  • An actual Dictionary add-on type
  • Support for End User License Agreements (that users have to accept) and Privacy Policies
  • Better support for preview images and thumbnails (transparent PNGs are now allowed)
  • Ability to allow viewing of your add-on’s source code from the web
  • Sandbox review system

The following features will likely not be available at the launch of Remora, but should be supported within a few weeks:

  • Upload an add-on file from a remote site (will allow larger file sizes)
  • Use limited HTML in descriptions and notes
  • Specification of a source code license
  • Many more enhancements and new features

We are still very interested in your feedback on this beta version - both public and developer sides. If you find a bug or just want to make a general comment, please post it here or on the wiki feedback page, and we will follow-up. We are working hard to implement your suggestions and launch Remora very soon.

We look forward to hearing what you think!

Teaching CakePHP to be Multilingual (part 2)

Tuesday, February 6th, 2007

This is part two of a three part series. (Part 1)

For the static content, we decided to use PHP’s built-in gettext functions. Let’s double check the requirements from part 1:

  • Speed: Strings are pulled from a binary file and aggressively cached by apache.
  • Robustness: Gettext has been a standard for years and is used in a wide variety of systems reliably.
  • Friendliness: Due to its age and widespread use, the .po file that is distributed to localizers is widely recognized and has several applications to assist in the translation.
  • Anything else? There are command line programs for creating and merging gettext files already.

Fantastic, it fits the bill and hopefully will be straight forward to implement. One of the first questions that arose was whether we should use actual phrases or placeholder strings in the template files. This would be the difference between, for example, “Welcome to Remora” and “header_welcome” in the template files. Using the actual strings would make translation simpler, but if we wanted to do a minor change to a phrase in english (like adding a comma) we’d have to regenerate the .po files, remerge, and reverify them. If we used placeholder strings, we’d lose the built in gettext fallback of returning the input string when a match can’t be found in the .po file and they wouldn’t be as straight forward for localizers to translate.

After polling some people with expertise in localization, a, surprisingly unanimous, decision to use placeholder strings was agreed on. We’d just have to make sure our translations existed so we didn’t need to depend on gettext’s built in fallback.

A tutorial exists that does a great job covering setup and basic use of gettext already, so I’ll skip the fundamentals that are explained there (but be sure to read it before you continue here!). One aspect worth mentioning in addition to the ONLamp tutorial is supporting plural forms. In English, this usually means adding an ’s’ - for example, nacho vs. nachos. In other languages (Polish is the classic example), the plural forms get much more complex, often depending on knowing the number of nachos instead of just knowing you have more than one.

Gettext supports multiple plural forms by adding a “Plural-Forms” header in the .po file. This can be a fairly complicated string of ternary operators, that, when evaluated, come up with a resulting number. This result is used as an index into an array in the .po file. That’s a confusing couple of sentences, so let’s have an example. If we were just dealing with English, we could write something like this to handle plural forms:

<?php
  if ($number == 1) {
    echo "You have 1 message.";
  } else {
    echo "You have {$number} messages.";
  }
?>

If we were to convert that directly to gettext, we’d be left with two strings to translate, and the only difference being the plural. Lucky for us, gettext supports plurals - unfortunately, it requires an inconvenient change to your code wherever you need to support it. To make the above code gettext/plural friendly, we’ll actually use the ngettext function. Using this function, we can pass the $number variable to gettext so it can determine which array index to return.

<?php
    // It looks like we have some redundancy here, but that's the way it works -
    // Since we're using placeholder strings, the first and second parameters are the same.
    // $number shows up twice because we're passing it to ngettext() and sprintf()
    echo sprintf(ngettext('header_message_num', 'header_message_num', $number), $number);
?>

The parts of the English .po file that are relevant to this example would look like:

Plural-Forms: nplurals=2; plural=n != 1;

msgid "header_message_num"
msgid_plural "header_message_num"
msgstr[0] "You have 1 message"
msgstr[1] "You have %d messages"

The msgid and the msgid_plural correspond to the first and second parameters to ngettext (in our case, they’re equal). The $number variable we passed to gettext is run through the algorithm given in the Plural-Forms header, and results in either a zero or a one - the index to the msgstr array. The gettext manual has a section on plural forms that gives more complex examples, including the algorithms for other languages.

Overall, gettext works as advertised and fulfills our requirements for static localization, save a couple headaches. Firstly, it employs very aggressive caching, and sometimes it can get a little carried away. In fact, we’ve been unsuccessful in finding a way to disable or flush the gettext cache without restarting apache. This is an inconvenience but not a deal killer for us. Hopefully once finished our translations won’t change a lot, but it’s still annoying enough to wonder why there isn’t a more convenient solution.

The second headache is with gettext’s feature set - it doesn’t support declinations. Since, as far as I know, this is a foreign concept in English, let’s look at an example in Spanish. Let’s say we have the following sentence we want to represent in gettext (I’ll skip the placeholder strings for the sake of simplicity):

<?php
sprintf(_('Come el %s.'), $fruit);
?>

If you’re familiar with Spanish, you’ll notice that’s a masculine sentence, which would be appropriate if $fruit was “plátano”. However, what if $fruit were “pera”? The sentence would come out as “Come el pera.” when it should say “Come la pera.” As it currently stands, gettext doesn’t support a way to deal with the genders of words. For Remora, we’re going to have to depend on some creative wording to help us avoid situations like the above example.

Despite the shortcomings, I think gettext was the right decision. It has some hiccups that are frustrating, but it’s still the best thing out there. Look forward to another long and complicated post about dynamic localization in the future…

Addendum: After I wrote this post, I saw in the news that CakePHP 1.2 now boasts gettext() functionality in the core - good work to all involved. :)

Is that a Kubla on your shoulder?

Monday, February 5th, 2007

A little project named “Kubla” keeps coming up in mozilla.com meetings, and has sparked some discussions about policy, announcing projects, and general openness. I think what caused the debate to center around this particular project was my mentioning that Kubla had “met it’s first milestone on time.” I think people interpreted this as meaning that the project was pretty far along - in reality, the project is a few weeks old, and the first milestone was setting up a framework and making some decisions about where we are going.

So, since Kubla has achieved so much fame already, an introduction is in order: Kubla is a project to manage content on mozilla.com (a CMS). Since our rewrite of mozilla.com to support multiple languages we’ve been without an easy way for everyone to update the content. The goal for this project is to have all the content on mozilla.com easily accessible and editable by those who need to make updates. The project will focus on simplicity and usability so the barrier of entry is low enough that a casual volunteer can login and help with translations.

We’ve already had some preliminary meetings about what we want in a CMS. I think our requirements are pretty straight forward at this point (which falls nicely into my hope for simplicity). It also means that I didn’t want to build on an existing CMS, because I thought our specific needs were uncommon enough that they wouldn’t be served by a smaller CMS, and a large application would conflict with my goal for simplicity. Since quite a few people have asked me for details on this, I’ve added some additional thoughts to the bottom of the requirements page. Due to the upsurge in discussion, I’m getting some good suggestions for further products to look at before we commit to writing our own - updates will follow I’m sure.

At this point, there is no preview or usable site since most of the project still exists on paper, however, the wiki holds the core information and will be kept up to date as the project progresses. As always, the current code is available if you want to have a look.

Feel free to comment, ask questions, or volunteer. :) I’m also available via email or IRC.

AMO Preview Updates

Friday, February 2nd, 2007

The preview site was refreshed today with another set of updates:

  • Due to public outcry, the right-hand menu is now on the left
  • Condensed browse lists and search results, using javascript to expand sections
  • Added the much anticipated “sandbox” feature (a more complete description below)
  • Added RSS feeds to pages including per category feeds, search results, and more
  • Migrated the visual theme from the current AMO
  • Localized more pages and added more translations
  • Many bug fixes

The sandbox is a new system for managing which add-ons are publicly viewable. Justin Scott introduced the concept a few months ago, and the first revision is ready to look at.

If you just come to the site, all you will see are public add-ons. When you login and choose to view the sandbox in your options, you’ll see a link to the sandbox at the top of each page. After clicking on it, you’ll migrate to the other side of AMO and see add-ons that are just getting started, getting updated, or getting their final polish before being pushed to the public side.

Let us know what you think of the new changes! If you have suggestions, please use our feedback page or leave a comment here.

Expect another update next week, focusing on the developer side.