Wednesday, December 30, 2009

A week at LATU (part II): Developing with Sugar

This is the second part of a series of articles about the week I passed earlier this month at Montevideo, working with the Ceibal Plan. See here for the introduction. This post is about the technical issues that were discussed, a subsequent one will go briefly over the management and community issues.

The first hours were dedicated to a quite complete walkthrough of all Sugar dependencies, modules and python packages. Daniel Castelo displayed interest in contributing short descriptions of each package for the API docs, will be great if he finds some time to do so.

LATU's R&D team with Martin Abente and me, photo courtesy of Martin Abente

The next subject we discussed were techniques for easily developing in a regular Linux distro and then testing on the XO. Though since the start of the project we have desired to develop Sugar on Sugar itself, there's still some work to do so you can run a stable instance isolated from the recent changes and a second one running inside it. So the idea is to develop in a machine running for example GNOME and run a Sugar instance inside Xephyr, with its own D-Bus session bus and all. Once you are happy with how it runs there, you can test easily on a XO (or any other target machine) by mounting with sshfs the dirs that contain installed Sugar code onto the dirs with old code. And voilà, an XO running the last unstable Sugar code.

Another area in which developers new to python have generally doubts is with debugging. In languages with a slow compilation process and with direct access to memory, using a debugger such as gdb is often the best first resort, specially if one masters the debugger being used. But in Python, given that between adding a logging statement and running it is such a short lapse, this is generally preferred over a full-fledged debugger. If you already know the code being debugged, you may be already suspecting of some assumption that is not correct, and often with just one more logging statement you can reach the cause. For cases when a debugger is needed pdb is a good equivalent to gdb. If you prefer a graphical debugger, winpdb works well and also allows you to attach to a running process.

Another subject discussed was localization, in order for their work be accepted by upstream, it needs to be fully localizable. We didn't got into details here because it's well explained in the Sugar Almanac, it contains a lot of practical information for activity authors and also shell hackers. Thanks to OLPC for funding the initial work on the Almanac and also to Faisal Anwar and Media Modifications for keeping contributing pro bono.

An issue that was raised several times was a way for Sugar code to execute privileged actions without relying on sudo, as Ceibal's anti-theft scheme relies currently on users not knowing the root password. They plan to remove this limitation soon, but anyway a better way is PolicyKit.

Another important subject was content distribution, they have been bundling books inside a "Library" activity that contains code copied from Browse. Though this is the approach that I like the most in recent releases of Sugar, for their machines running 0.82 I recommended to look at content bundles.

Then they showed the work they have been doing together with Paraguay Educa in adding to Sugar the possibility to connect to 3G networks, using NetworkManager for that (thanks to Dan Williams for his support). Its upstreaming is going smooth thanks to Martin Abente's hard work and the people at LATU are already thinking about extending it for ADSL connections. Kudos as well to Andrés Ambrois for providing a patch for selecting graphically your provider and data plan. This feature is a great example of contributions bringing more contributions, making more worthwhile doing the jump and start working with upstream.

Sugar has survived surprisingly long without printing support. Even if the people actually using Sugar say that they won't actually print much because of logistic issues, this has been mentioned often as the big missing feature in Sugar. In Uruguay the need is mainly for parents whose children bring their XOs home and they have a printer there. Thanks to all the Linux and GNOME infrastructure we leverage, implementing printing support will be much easier than resisting further, so LATU's Daniel Castelo is proposing a way going forward in this issue.

Another subject was sugarizing C applications. This means that the code and resources are all contained in a bundle along with some metadata, the main window would be maximized and have a couple of X properties so the Shell can recognize and track them, and that it implements collaboration with Telepathy and stores its state in the Journal, through D-Bus.

One last subject was discussing how through the extensions mechanism in Sugar they can develop new features without the release cycles causing them to do costly rebases each time.

Saturday, December 19, 2009

A week at LATU (part I)

LATU stands by Laboratorio Tecnológico del Uruguay and is in charge of the technical aspects of the Plan Ceibal, as well as the overall coordination of the project. As part of their responsibility in making the software deployed on the OLPC machines as useful as possible in their context, they are spending considerable resources in the development and support of Sugar.

Because they were until recently on the initial phase of the project, they have carried that work on their own, without participating in the community nor working together with other deployers of Sugar. Now that every child in public primary schools in Uruguay owns a XO laptop, they are starting to think about optimizing their Sugar work by pooling resources with others and coordinating with upstream's schedules. The LATU also has a big interest in that their work benefits other countries using Sugar, as part of Uruguay's participation in international cooperation. I have the hope that most of what they learn when working with Sugar Labs will help them take the most of other free software projects they use, such as GNOME (chances are the laptops that will be given to high schoolers in the next years will be running that).

The concrete issue they found when developing on their own was that every time that their upstream (OLPC) produced a new image build, in order to benefit from the improvements in that release they had to apply the customizations made locally, solve any conflicts and retest everything. If they had contributed those modifications to Sugar, OLPC images would have come with them and no further work would be needed. Reaching the point in which they can directly use the OLPC images as-is is still a bit far away, but every bit that they integrate upstream is a step in the right direction and reduces their development and support costs. Also, when their employees work within the communities that maintain their software, they work directly with the most qualified engineers in those technologies, increasing local capacity.

Through Walter's mediation, Miguel Brechner contacted me a few weeks ago proposing visiting them in Uruguay to explore ways for integrating their processes with those in Sugar Labs and other free software projects they use such as OLPC. I was lucky enough to be able to take the chance to also attend Ceibal '09, a wonderful event about which I blogged here.

Another happy circumstance is that the LATU took the initiative of inviting Paraguay Educa, the deployers of OLPC and Sugar in Paraguay, to send one of their engineers to Montevideo in order to participate on the sessions. It was a big pleasure meeting Martin Abente (tch in #sugar), who wrote about his trip (in Spanish) here and hope I can meet in person the rest of his team soon.

This is the first time since a year ago that I have been paid for working on Sugar, so I have high hopes in that we are going to find soon business models that will sustain further development of Sugar. Would be a sad situation if upstream development of Sugar had to halt because the core developers had to end their involvement in order to fulfill their real-life responsibilities. If that happened, deployers of Sugar (responsible for more than a million installations) wouldn't have a place where to pool resources and coordinate their work.

I'm going to blog two more parts about the week I spent there, one focusing on the technical aspects and the other will be about the management and community side of things.

Friday, December 18, 2009

Ceibal '09

In the days 7th and 8th of this month took place in Montevideo the First International Event on Experiences about the Ceibal Plan, with the objective of sharing the experience gained during the first years of the implementation in Uruguay of the OLPC initiative, with the name of Plan Ceibal. On the afternoon of the second day, some schools displayed the work they had done with the XOs.

Project Rayuela and LATU were kind enough to invite me to assist, which has been an unforgettable experience for me. The plan was that after the event I would stay for one week discussing with the software team at LATU how they can work most profitably with the Sugar community upstream, will talk about this in a later post.

I still can hardly believe that it has been the second time that I have been close to a child learning with Sugar, and the previous one was more than 2 years ago, when attended FISL in the company of J5 and Jim Gettys. We visited then a school where the Federal University of Rio Grande do Sul was conducting a pilot with very early prototypes of the XO and Sugar.

Visit to the school Luciana de Abreu

This time was very different because we were seeing the results of at least one year of continuous work with Sugar, something that was happening in the mainstream of that society, backed by the government, the families, several volunteer organizations, and the primary education system.

Students displaying their work with Scratch

Though I was ecstatic seeing each school presenting their work, I felt a bit sorry for the developers and non-developers that made that possible with their work but received very little feedback to date on the actual use of it. I have plans to improve that.

Learning geometry with Turtle Art

It has been a very enlightening and encouraging experience, wish all my colleagues at Sugar Labs could have this opportunity as well in the near future. The last 2 years have been pretty hard for the Sugar developers, always having to stand the never ending stream of naysayers, even from OLPC itself, and with the last year having to live off our savings. I'm very proud that we have managed to stand firm on our believe that the best GUI for learning hadn't been invented yet and that we could contribute something valuable to the mission of giving more learning opportunities to children around the world, specially those from less favoured backgrounds.

After having seen children and teachers involved together in learning with Sugar, I can finally say that we were right. Though of course, this is just starting...

The program of the event can be found here and I expect that soon will appear video recodings of the sessions and of the school presentations. Will post here when they are made public. Also will post soon about the week that followed, in which I had the luck of being a small part of a process in which an organization (and in some sense, a country) moves from being a consumer of FOSS to being a full rights member of the FOSS community.

Thanks to J5 and Gonzalo Odiard for the photographs.