Archive for July, 2010

Elliot Murphy: Lazy test loading to deal with conflicting django settings

Tuesday, July 27th, 2010

At work I have a bunch (ok, 3) different django projects in the same big code tree. Yes, I know we should split them up, thanks for pointing that out. Anyway, we are running python unit tests using the trial testrunner from twisted, because it’s very nice and we also have some twisted servers in this same code tree.

I have a problem with Django settings. There are some conflicting settings in the settings file used by different Django servers. The solution seems easy – run tests for each Django server in a separate subprocess. The excellent subunit library should do just the trick, it even has IsolatedTestSuite and IsolatedTestCase classes that take care of forking and running in a separate process.

Except this doesn’t work. Because when python modules are imported for test discovery, they also indirectly end up importing django.settings, and when the IsolatedTestSuite forks to run tests in a separate subprocess, that subprocess inherits the already polluted python environment that has the (sometimes wrong) django.settings imported already.

I am convinced that this must be solvable, but have been banging my head against it for a while and don’t understand unittest discovery well enough to solve it. I’ve created a self-contained little example that demonstrates the problem in isolation here: https://code.edge.launchpad.net/~statik/+junk/subunit-demo/

I will gladly endure your taunts if you teach me a solution.

Martin Albisetti’s blog: Ubuntu One iphone client, source code released

Friday, July 23rd, 2010

We should have released the source for the iphone client right after we did the upload to the appstore, but a bunch of bureaucracy and crazy work deadlines postponed this until now.
We’re going to be doing some work for the Ubuntu 10.10 release on the iphone client as well as on a new Android client, both clients are going to be open source, like all our other Ubuntu One clients.
We’ve created the projects on Launchpad, pushed the initial source code for the iphone client, and will start pushing Android as soon as we get out of the exploration stage.

The projects are available at:

iphone:  https://launchpad.net/ubuntuone-ios-client
android: https://launchpad.net/ubuntuone-android-client

Stay tuned for more on our new mobile services!

Ubuntu One iphone client, source code released

Thursday, July 22nd, 2010

We should have released the source for the iphone client right after we did the upload to the appstore, but a bunch of bureaucracy and crazy work deadlines postponed this until now.
We’re going to be doing some work for the Ubuntu 10.10 release on the iphone client as well as on a new Android client, both clients are going to be open source, like all our other Ubuntu One clients.
We’ve created the projects on Launchpad, pushed the initial source code for the iphone client, and will start pushing Android as soon as we get out of the exploration stage.

The projects are available at:

iphone:  https://launchpad.net/ubuntuone-ios-client
android: https://launchpad.net/ubuntuone-android-client

Stay tuned for more on our new mobile services!

Elliot Murphy: Teambuilding and culture in a distributed workplace

Tuesday, July 6th, 2010

Matt tells me that company culture isn’t the imaginary thing you are trying to create, it’s what you actually end up with based on a million little things that happened in real life. You can’t fake it, you can’t wish it better, you have to accept the reality and look at the way things ended up despite what the policy said.

That’s not an argument against trying to change things, but it means that none of us individually can completely control the end result, we only get to contribute little pieces. As a manager who feels responsible for doing everything I can to contribute to a healthy, positive, sustainable work environment and an employee who wants to work in such a place, one of the most amazing feelings is seeing other people take up the challenge, and make little gestures which pull everyone together in feeling like a team, like we are interconnected. You know, that whole Ubuntu thing.

I want to tell you a true story. For Ubuntu One, the server development team that writes the code is a completely separate department from the operational sysadmin team that deploys the code. This sysadmin team also services Launchpad and all the other websites that Canonical operates. There are some natural tensions between stability and feature development, we have different managers, the sysadmin team is much smaller and spread around the world in terms of timezones, the Ubuntu release schedule deadlines are carved in wiki stone, and we all want to get rid of downtime on the site. All of these things are forces which would tend to drive the teams apart, rather than together. We talk about devops ideas, but that ideal doesn’t change the reality of people working together under pressure with somewhat conflicting goals. We call this particular group of sysadmins “LOSA”. We do much of our real time collaboration over IRC, and the sysadmins are usually idling in a number of IRC channels, one per product team that they support. Because we’re not always sure who will be on duty at a given time, we ended up with a convention of saying “losa ping” on the IRC channel when we needed something done: kicking off a planned code update, running an ad-hoc test query against the staging or production DB, etc.

losa ping love online services

Losa Ping

After a particularly exhausting few months where it felt like we were saying losa ping every 30 minutes, the losa team went off duty for a week to have an in person meetup, and do some of their planning and teambuilding out of reach of the daily barrage of phone and IRC interruptions. Philip had an idea for a joke, and arranged for a cake to be secretly delivered.

As you can imagine, it was a hit, and everyone felt a little closer together. But the story doesn’t end there.

Losa pong

Months have gone by and we all forgot about the cake. Last week the Ubuntu One team gathered for an in person meeting. We were just as remote, the sysadmin team wasn’t there, we were sequestered away from laptops and IRC. The last day we had our afternoon break for coffee, and were amazed to see another cake! Later Michael confessed, and everyone had this silly grin on their face that just wouldn’t go away.

Two departments spread over several countries and dozens of different cities. Different backgrounds, different daily pressures, different opinions on the right way to do things. And yet, two cakes over several months make everyone feel connected. The cake is a symptom of the culture. You can’t prescribe it, you can’t control it, but you can contribute to it and you sure can enjoy it. What a fantastic crew.

Rodrigo Moya: Ubuntu One SyncDaemon API

Tuesday, July 6th, 2010

Ubuntu One’s SyncDaemon (the process that takes care of synchronizing your files between the cloud and the desktop) has a DBus interface for applications to control and get notifications from it about what it is doing. This interface was being used in the Nautilus plugin and other desktop tools contained in ubuntuone-client itself. Even though powerful and straightforward, we haven’t seen many applications using it, since usually 3rd party applications don’t want to be dealing with the low level DBus API themselves.

But this is now history, since I introduce you to libsyncdaemon, a GObject wrapper on top of the DBus API which makes it very easy to communicate with SyncDaemon, as well as improving a lot the performance compared to accessing the DBus API directly (thanks to its use of caches, to avoid DBus calls repeating when no needed) and containing high level functions that would allow applications to, for instance, publish a file on Ubuntu One with just one call:

SyncdaemonDaemon *daemon = syncdaemon_daemon_new ();
syncdaemon_daemon_publish_file (daemon, "/home/user/myphoto.jpg");

But before you run to another place after seeing this C code, note that it includes bindings for many languages (Python, JavaScript, etc) for free, thanks to gobject-introspection. So, the same code in Python, for instance, would be:

daemon = Syncdaemon.Daemon ()
daemon.publish_file ("/home/user/myphoto.jpg")

So now, the next step is to start adding support for sharing/publishing files in Ubuntu One to many desktop applications, like, for instance (ideas stolen from Stuart Langridge):

  • Publish screenshots directly from gnome-screenshot tool
  • Sharing photos from f-spot/shotwell/etc
  • etc…

This, along with the already existing desktop APIs (desktopcouch, couchdb-glib, libubuntuone), makes integration of 3rd party applications into Ubuntu One a very easy thing.