Wednesday, September 7, 2011

Pre-trunk Testing

Twisted uses BuildBot for continuous integration - for testing every revision to ensure it passes the full test suite. BuildBot automatically runs the test suite on each version of Python and each operating system supported by Twisted. As of today, that's 22 different configurations, plus another 16 configurations where Twisted is known not to work completely but where we are workings towards full support.

This works very well for identifying regressions and for finding problems with new functionality on platforms a developer may not have considered. However, because Twisted prefers to keep trunk@HEAD completely working and the test suite fully passing on all platforms, if BuildBot identifies a problem with a trunk revision, we revert it completely. Then the problems with it can be addressed and another attempt made. This also works, but it has a couple shortcomings. Someone actually has to do the revert, which is a little bit of work. Also, someone might check out trunk@HEAD before the change is reverted, giving them a non-working version of Twisted. It's nice to be able to avoid both of these things.

The solution generally applied is to test the change before applying it to trunk. BuildBot can do this too, in a couple different ways. The way we use for Twisted development is to have BuildBot run the test suite on all those supported configurations on a branch of Twisted, rather than on trunk. Since the change is checked in to a branch, instead of to trunk, it avoids the needed to revert anything and it avoids offering broken code to people.

This approach involves a tiny custom tool to convince BuildBot to run the necessary builds. Normally BuildBot just watches for trunk commits and starts builds automatically. Since in this case we want the trunk commit to happen after we see that all the builds will succeed, we use force-builds.py to have BuildBot perform the builds before it sees the trunk commit.

For a long time, force-builds.py needed a hard-coded list of supported platforms on which to trigger builds. Recently I fixed this by having it retrieve that list from the BuildBot master, which already knows which platforms are supported. Publishing this information is done with a minor hack to master.cfg:

    supportedList = list(
        builder['name']
        for builder
        in builders
        if builder['category'] == 'supported')
    path = 'public_html/supported-builders.txt'
    supportedListFile = file(path, 'w')
    supportedListFile.write('\n'.join(supportedList) + '\n')
    supportedListFile.close()

The resulting file is publicly available from the master's web server, so force-builds.py can download it on-demand and then force a build on each supported builder. When the developer sees all of these builds have succeeded, he or she can be more confident that there aren't going to be any surprises when the change is actually applied to trunk.

Wednesday, August 10, 2011

New Buildbot!

And far to the East where strife sired shadows
A baelnorn.local did rise and approach the light.
Out came illidan.local over once fair meadows,
And in defeat left his people weeping for their plight.
                                                                 -
kabuto.local's A Record
Jean-Paul and I had some hardware adventures a couple weekends ago.  As these things usually are, it was harrowing - but perhaps less so than it might have been.  By combining, in approximately equal parts, some unused components which have been ripening in the back of a closet in JP's apartment and some newly acquired materiels from the local vendor everyone (well, we, at least) loves to hate, and with only a few false starts involving incorrect memory channel configurations, Twisted now has the use of a somewhat hefty new computer, visible here in its new home, the undisclosed subterranean location that hosts all of Twisted's buildbot machines:

New Buildbot

Don't ask my why it glows blue; it is my understanding that this is simply the fashion these days.

With enough cores and gigabytes of memory so that I have trouble counting them all, this machine should serve us well hosting many a build slave.  It has already taken over the duties of several older slaves, including those of a couple Windows slaves, care of kvm (the machine itself is running Ubuntu Lucid (10.04) of course).  The very nice network it is attached to means that remotely interacting with these is now only minimally unpleasant.

The machine is also translating PyPy (in a respectable 34 minutes) once a week so we can continue to test Twisted against the latest development versions of the PyPy runtime.

Tuesday, July 5, 2011

Volunteers needed for Twisted project jobs

The Twisted project is a lot more than just writing code. Volunteers help sustain Twisted by reviewing tickets, writing documentation, answering questions on IRC, the mailing lists, and Stack Overflow, donating build servers, managing releases, packaging Twisted for distributions, sponsoring development, and more.

To everyone who contributes to the Twisted project in some way, thank you!

Twisted project jobs

A small group of dedicated Twisted developers have been doing maintenance work over the years that we'd like to start distributing across more of the community. These tasks include:
We've broken these tasks into bite-sized chunks, and you can find descriptions for them on the Project Jobs wiki page. Take a look, and please claim a task and how long you're up for doing it on the mailing list. If you have questions about any of them, don't hesitate to ask on the mailing list or IRC. You'll have lots of help getting set up.

Twisted Matrix Labs high scores

Are you competitive? Need a little extra incentive to contribute? I challenge you to get to the top of the monthly Twisted Matrix Labs high scores list:



Ticket openers, reviewers, and closers all get varying amounts of points. Note that a review banks you 1000 points, the most for a single ticket action, and we have a long review queue, so brush up on our patch review guidelines and dig in.

Tuesday, May 31, 2011

May Sprint Report

Greetings audience.  Another month has gone by, and that means another excellent Twisted sprint is behind us.  A couple weekends ago Dave, Ying, Itamar, Glyph, Asheesh, and myself gathered at the now traditional sprinting location.  Quite a few things were worked on.  Amongst the highlights were the following tickets:

#4813 - provide permissions accessor for filepath
#5053 - Add Gzip support to web client
#5088 - cfreactor cannot be imported
#5063 - When TLS transport is in writeBlockedOnRead=True mode, data is buffered in memory but producer APIs are not respected
#5095 - twisted.protocols.tls should flush all of the bio data, rather than just 2**15 bytes

Monday, May 16, 2011

Evennia: Event-Driven Online Gaming with Twisted and Django

Do you have a hankering to run your own multi-user text-based game server? If you do, and you love Twisted, Evennia is the project for you! Through the power of Twisted, Evennia has built a MUD-server platform that not only provides traditional telnet access but also lets you play via the web! As Evennia maintainer Griatch Art put it:

Whereas traditional MUD servers only speak telnet, Evennia additionally comes with its own browser-based client and allows for expanding with custom game protocols in any combination. ... All of this is straightforward to implement and maintain thanks to Twisted!

Evennia also combines Twisted with Django, providing a comprehensive real-world case study of melding these two popular systems.  As Griatch puts it, Twisted and Django "work beautifully together".

To find out more about how Twisted was the perfect fit for this massively multi-player platform and why the Evennia team chose Twisted, check out the success story.

Have your own success story using Twisted? Let us know! Just send an e-mail to success@twistedmatrix.com

Sunday, April 3, 2011

Twisted 11.0.0 released!

<lvh> PAS MAINTENANT CHEF! CHUIS EN TRAIN DE BRANCHER LE REACTEURRRRR


On behalf of Twisted Matrix Laboratories, I am honored to announce the release of Twisted 11.0.0.


Highlights include:

  • a new templating system in Twisted Web, "twisted.web.template", derived from Divmod Nevow.
  • improved behavior of subprocess spawning on FreeBSD.
  • the 'twistd mail' plugin now uses the endpoints API, providing a more consistent command line and compatibility with endpoint plugins.
  • twisted.plugin no longer emits a confusing traceback when it can't write a cache file.

and numerous other bugfixes and documentation improvements. For more information, see the NEWS file.


Download it now from:


<http://twistedmatrix.com/>


or install the 'Twisted' package from PyPI.


Many thanks to Glyph Lefkowitz and Jean-Paul Calderone for sanity-checking the pre-releases and release, and to the enthusiastic PyCon 2011 sprinters who annihilated dozens of tickets. Thanks to *everyone* who contributed tickets, patches, documentation, reviews, buildbots, feedback, and assistance to fellow users and developers leading up to this release. It is truly a group effort.


<http://twistedmatrix.com/highscores/?time=2011-03-01>


is a testament to how much work was done in March alone.

Monday, March 28, 2011

March (post PyCon) Twisted Sprint Report

We held a small but productive and successful Twisted sprint, kindly hosted once again by tenth, and attended by glyph, exarkun, jesstess and lewq.

The aim of the sprint was to do the first pre-release of Twisted 11.0 - and we managed to resolve almost all of the blocking tickets, so a partial success. :-)

One of the two main themes of the work was the twisted.web templating code, which got tidied up and properly documented - there's a new tutorial (temporarily available at http://buildbot.twistedmatrix.com/builds/sphinx-html/291-15849/projects/web/howto/twisted-templates.html), which demonstrates this neat little templating engine in action. The other theme was completing and merging the file descriptor closing branch which exarkun and lewq worked on, bringing FreeBSD just a few test-fixes away from being a fully supported platform - and importantly stopped the FreeBSD builder hanging on testing trunk, which will help catch regressions.

The following tickets got closed:

#4968 - Resource templating documentation has broken link to twisted.web.server.Resource which emphatically does not exist
#4881 - twisted.internet.process._listOpenFDs fails on FreeBSD because fdescfs isn't mounted by default
#4732 - Document @withRequest XML-RPC feature in the XML-RPC howto

And the following tickets got worked on:

#4854 - Replace the implementation of IReactorSSL with one based on twisted.protocols.tls
#3690 - SerialPort never calls connectionLost(reason)
#4969 - Add CONNECT support to HTTP client
#4951 - links in twisted.web docs are broken

That's it until next time, enjoy Twisted 11.0 when it comes out! We still have the PyCon sprint to report on, watch for that soon.