News about the framework and its uses.
While at Paris Web 2010 we were all impressed by the presentation and
demos by Paul Rouget on HTML5 (tech evangelist must be a hard
job!). Here is my take and a few URLs on the things that were presented.
- Websockets with persistent connections between the server and the
browser. That way you can avoid pulling information every 5 seconds,
the server can tell the web page a new info is available. The
immediate uses we have for this are :
- realtime feed display
- jabber web chat rooms
- in cubicweb's forge : new comment indication on a ticket
- in cubicweb in general : notification that the edited element has
been openned by another user (instead of a lock mechanism)
- real time collaborative editing (etherpad style functionality)
- File upload demo : http://demos.hacks.mozilla.org/openweb/uploadingFiles/
- File EXIF extraction, client side resize or geolocalisation
http://demos.hacks.mozilla.org/openweb/FileAPI/ . That could be very
cool for things such as resizing an image before it is sent to the
server (you know, for your mother who doesn't know how to resize
that 2 Mbytes photo before sending it to the site). Reference :
- Using File IO, you can do some heavy Drag'n'drop from your computer
to your browser directly in the browser (yes, you can get rid of that
nasty java applet). Apparently Google implemented in Chromium a
non-standard drag'n'drop the other way around : from the web app to
your desktop, which could be cool as well.
- XHR - XMLHttpRequest. Usually this type of requests is not possible
cross-domain. Now they will be (with an authorization
mechanism). That way, you will be able to post and control websites
from the page in your browser.
- Audio Data API : you can now access & modify audio files directly in
your browser (before uploading them server side). This makes me think
of the first time I realized people where implementing traditionally "heavy"
applications (photo editing, music editing, even movie edition) in web
applications. I was (and still am) very surprised and skeptic, but this kind
of evolution makes me believe that there can be a day when you don't
even need to send massive files to the server to edit them.
Admittedly, you probably need to see the thrilling presentation and
demos to be tempted to go and dip into these technologies. Reading the
documentation will probably not encourage you to go and code some cool
One of the things that the audience commented about at the end of the
presentation is that there was still a huge lack of "authoring tools"
for HTML5. For some coders that never leave vim or emacs, this is
heresy, but we have to admit that the adoption of flash and
silverlight (apparently) is very much driven by simple click'n'program
During the presentation, I used a Chrome 6 that I had lying around on
my Ubuntu, but by the end of the presentation I had installed Firefox4
using the mozilla PPA
sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa
sudo apt-get update
sudo apt-get -uVf install firefox-4.0
The PPA version keeps config files separate so you can easily switch
between your "standard" Firefox3 profile and the cutting edge Firefox4
(obviously the big downside is not having all your cool extensions).
The only thing missing from the presentation was the code... a request
I hope Paul will grant to the community (a bunch of tweets about that
followed the presentation).
The 3.10 development started during August, with two
important patches: one on the repository / entity API, another one on the boxes /
content navigation components unification (more on this later). Then it somewhat came to a halt, as more work was done on other projects and to stabilize the
3.9 branch. We finally got back on it during September, adding several other major
changes or enhancements.
Cleanup of the repository side entity API, i.e. the API you may use when
writing hooks. Beside simple namespace cleanup (a few renamings), the API has
been modified to move out attributes being edited from the read cache. So now:
- entities do not inherit from dict anymore; access to the dict protocol on an
entity will raise deprecation warnings
- the attributes cache is now a cw_attr_cache dictionary on the entity
- edited attributes are in a cw_edited attribute special object, which is only
available in hooks for a modified entity (i.e.
'[before|after]_[add|update]_entity', you should use the dict protocol on that object to get
modified attributes or to modify what is edited (in 'before' hooks only, and
this is now enforced). This deprecates the former edited_attributes attribute.
Unification of 'boxes' / 'contentnavigation' registries and base classes, into
"contextual components" stored in the 'ctxcomponents' registry. This implied the
introduction of "layout" objects which are appobjects responsible of displaying
the components according to the context they are displayed in.
This separation of content / layout and some css cleanups allows us to move former
boxes and content components into each other's place in the user interface: for
instance, go to your preferences pages and try to move the search box. You now have many
more different locations available. Though one component may not go anywhere, so
forthcoming releases should tweak this to avoid proposing dumb choices. But the hot
stuff is there!
Also, a cache has been set on the registry to avoid recomputing possible
components for each context (place in the ui).
Upgraded jQuery and jQuery UI respectively to version 1.4.2 and 1.8. Removed
jquery.autocomplete.js since jQuery UI provides its own autocomplete
plugin. A cwautocomplete plugin was added in order to keep widgets
as backward compatible as possible. If you used custom autocomplete feature,
you should take a look at this guide.
The RelationFacet base class now automatically proposes to search for
entities without the relation if this is allowed by the schema and if there
are some in current results. Example: search for tickets which are not planned in a version.
Data sources have been modeled as CubicWeb entity type CWSource. The
'sources' file is still there but will now only contains definition of the
system source, as well as default manager account login and password. This
implied changes in instance initialization commands, introduction of a new
'add-source' command to cubicweb-ctl, as well as change in the repository
startup. Also, on a multi-sources instance, we can now search using a facet on
the cw_source relation (a new mandatory metadata relation on each entities)
to filter according to the data source entities are coming from.
Although introduced during 3.9 releases, it's worth mentioning the new support
for multi-columns unicity constraint through yams's __unique_together__
entity type attribute, allowing for unicity constraint enforced by the
underlying database instead of CubicWeb hooks. This is limited and doesn't
work in every configuration, but is a must have when running several distributed
CubicWeb instance of the same application (hence database).
Also as usual, the 3.10 includes a bunch of other minor enhancements, refactorings
and bug fixes. Every introduced change should be backward compatible, except
probably some minor ui details due to the css box simplification. That's it.
So please download and install CubicWeb 3.10 and report us any problem on the
For the "Journées Du Logiciel Libre (JDLL)" in Lyon which will take place the 14th, 15th et 16th of octobre 2010, we will be presenting the semantic side of CubicWeb on Friday 15th. There will be a talk and a tutorial. Details can be found here and there.
If you're around, come and see us!
We recently discovered that the cubicweb.org site (the one you are
probably visiting right now) was suffering from a memory leak. The
munin graphs showed a memory consumption steadily increasing soon
after the instance was started, and this would only stop when all the
memory on the host was exhausted. This was clearly caused by a memory
leak somewhere, either in CubicWeb itself or in a cube used by the
Fig. 1: Munin graphs showing the memory leak in cubicweb.org
Notice the associated service downtimes, and the stabilized memory consumption on Sept 23, after the leak was fixed.
Since Python has a garbage collector, either the leak was occuring in
a C extension, or it was caused by some objects which were not garbage
collectable. A common cause for the latter, as explained in the gc
module documentation, are objects with a __del__ method which are part
of a cycle.
We used the "gc" view, which is an administrative view in CubicWeb, reachable by appending "?vid=gc" at the end of the url of
the root of your instance, if you are a member of the managers group. This view uses the gc module from the
python standard library to see which objects are not garbage
This view showed thousands of instances of
mercurial.url.httphandler. This class indeed has a __del__ method
and instances have a cycle with urllib2.OpenerDirector. Mercurial is
used by the vcsfile cube which regularly polls remote repository
over HTTP, which causes httphandler to be instantiated (and a
reference to be leaked). This problem had gone undetected in mercurial
because most of the time, processes using mercurial over http are
shortlived and the leaked memory is quickly collected by the operating
system. Discussion ensued on the IRC forum #mercurial with the
developers and a patch was submitted which fixes the leak. In order to
avoid the problem with versions of mercurial up to the current one, a
new version of vcsfile including a monkey patch for mercurial was
released and deployed on cubicweb.org!
For that last sprint day, each team made some nice achievements:
- Steph & Alain worked on the mv/cp actions implementation to makes
them working properly and supporting globs. Last but not least, with
a full set of tests.
- Alex & Charles got back what we call apycot 'full' tests, eg running
test with coverage enabled, checking that code coverage is greater
than a given threshold, but also running pylint and checking that
its global evaluation is at least 7 (configurable, of course).
- Katia & Aurélien provided a sharp implementation of recipe checking,
so that we know we don't launch a recipe badly constructed, as well
as informing the user nicely from what errors his recipe suffer.
- Julien managed to set up a recipe managing from Debian package
construction to Debian repository publication, going through lintian
on the way
- Pierre-Yves helped other teams to solve the narval related bugs
they encountered, and finished by writing a thread-safe implementation
of apycot's writer so we can run several checker simultaneously.
- Celso continued working on a proof of concept blue-theme cube,
wondering how to make CubicWeb looks nicer and be easily customisable
in future versions.
- Sylvain helped there and there and integrated patches...
So we finally didn't get up to the demo. But we now have everything to
set it up, so I've a good hope that we will have a beta version of our
brand new production chain up and running before the end of August!
Thanks to everyone for all this good work, and for this time spent all together!
Following the presentation of CubicWeb at OSCON 2010 in July, the editor of SemanticWeb.com wrote an article describing the CubicWeb framwork. Read the article and ask your questions on the mailing list!
In this fourth day of the our Summer Sprint important progress have been made.
- Stéphanie and Alain cleaned up the Apycot's bot sources from deprecated code
and rewrite part of the test suite to follow the new way to launch apycot.
They cleaned up the handling of VCS sources for tested project taking
advantages of the new mercurial cache for vcsfile implemented by Katia and
Aurélien last Tuesday. This feature keep a local clone of the remote
repository and allow much faster checkout during test runs.
- Julien made significant progress in the writing of the Debian recipe. A
recipes can now successfully build Debian packages of a project and validate
them with lintian and lgp. He later paired with Pierre-Yves and they
improved the annotation of Apycot's Narval variable to enhance Input validation in
Apycot's Narval recipes. For example, the action building a Debian package
will explicitly refuse to run on a project not yet checked-out.
- Aurelien first paired with Pierre-Yves to improve some views and the
consistency of the database schema, then he worked on a dashboard
displaying various indicators useful to the version publishing process.
- Pierre-Yves spent some time improving the ability of Narval to recover on
errors and to display meaningful logs about them.
- Alexandre and Charles finished the re-implementation of the full python
recipe.They used options at the Narval level to run test suite with the coverage
enabled and re-enabled the coverage checker to process the result, discovering some
problems in Narval's engine on the way...
- Celso finished Spanish translation of Cubicweb's core and started to work on a
new css theme
- Sylvain helped several groups along the day and reviewed patches from them.
CubicWeb/Narval Sprint is going on !
The third day of our sprint focused on the following points:
- Pierre-Yves worked to prevent duplicate test executions (eg running several time the same test with the same version configuration),
- Celso has terminated the spanish translation of CubicWeb. He's now working on various cubes translation,
- Stéphanie and Alain spent some time on the narval bot view. They also modified ProjectEnvironement's attributes in order to use similar information available on the vcsfile repository, hence simplifying the configuration (more to do on this!),
- Julien worked on the debian package recipe,
- Katia and Aurélien worked on recipe security (using CWPermission),
- Alexandre and Charles produced a first template of a full test recipe using pyunit and pycoverage,
- Finally, our captain, Sylvain, is at the helm !
We'll hopefuly be able to present a functionnal demo at the end of the week.
Narval/Cubicweb left off !
During the second day of our Summer CubicWeb/Narval Sprint, several tasks started on the first day were completed and new tasks started:
- Charles, Alexandre and Julien finished writing the "copy" and "move" Narval actions, and then started transforming existing apycot checkers into Narval actions.
- Pierre-Yves managed to improve Narval reports with more explicit and relevant content.
- Stéphanie and Alain finished the bot status view as well as the recipe graph view.
- Katia and Aurélien finished writing the new mercurial cache solution for vcsfile and started improving the security of Narval recipes (i.e. who can start which recipe).
- Celso kept on his life-long work of translating CubicWeb to Spanish.
- Sylvain wrote some Narval views, improved Narval execution logs handling and kept on reviewing patches and helping various people...
We started this first day by several presentations by Sylvain about Logilab's current development process workflow, and compared it to what it should be after the sprint. Sylvain also introduced Narval.
We then set up a dev environment on everyone's computer: a working forge with a local Narval agent that can be used for tests during the week.
Regarding more concrete tasks:
- Charles and Alexandre started writing some basic Narval actions such as move, to move a file from a place to another, and had to grasp narval's concepts on the way.
- Pierre-Yves dug into the code to understand how exceptions are propagated in the Narval engine, his goal was to get better reports.
- Stéphanie and Alain worked on a nice bot status view.
- Katia, Aurélien studied the new mercurial cache solution for vcsfile
- Julien started some piece of documentation.
- Celso, our Mexican friend, discovered some new features of recent cubicweb releases and setup his environment to later work on Spanish translation, CSS, etc.
- Sylvain came with a basically working narval implementation on top of cubicweb, and spent the day helping various people...