A different approach to application containers with Limba
Over the past two years, application packaging has become a topic of much debate within the GNOME project. The packaging effort that has garnered perhaps the most attention is the sandboxed applications work done by Alexander Larsson, but it is not the only one. Matthias Klumpp, for example, has been pursuing an application-packaging strategy of his own that takes a different approach. Klumpp's project is called Limba, and a new release was recently unveiled.
Klumpp started working on Limba in November 2014, citing as his inspiration the same proposal that eventually led to Larsson's work. That proposal was Lennart Poettering's blog post about the difficulty of packaging third-party applications for Linux desktops. But Poettering proposed packaging applications into bundles that were quite isolated from the rest of the distribution, an approach Klumpp found problematic. It duplicates shared libraries and other components, makes the running system harder to profile, and, quite simply, bypasses the distribution rather than working with it.
Beaucoup bundles
Larsson and others pursued many of the ideas set out in Poettering's post, with some changes, of course, and the result is the xdg-app tool set, which we looked at in January. Limba bears some resemblance to xdg-app in the broad strokes. Both models bundle the application into a self-contained package that is isolated from the rest of the operating system using various technologies common to other containerization efforts, like SELinux, control groups, and namespaces (specifically, filesystem, process, and network namespaces).
The xdg-app sandbox design, however, relies on the host system providing a static "runtime" environment that will provide each app bundle with the libraries and system resources it requires. The GNOME work in this area has been focused on defining a "GNOME runtime" tailored to each GNOME release— the 3.16 runtime, for example, would receive critical security updates, but app bundles using it can count on it remaining unchanged even after the GNOME 3.18 release and its accompanying runtime make their debut. Other vendors (including, perhaps, Linux distributions as well as other application platforms like KDE) could produce their own runtimes that could also serve as targets for app bundles.
In contrast, Limba's approach lets each application distributor define its own runtime tailored to its app bundle. The runtime definition is dependency-based, much like existing package dependencies are specified today. Thus, the pieces within the runtime can be updated if a new version of some dependency is released.
Practically speaking, these dependencies are specified with XML according to the AppStream metadata format. When the Limba bundle is executed, the controller process is responsible for merging the contents of the bundle, the local libraries, and potentially other Limba bundles into a single OverlayFS filesystem that satisfies the bundle's dependencies. This OverlayFS filesystem is then set up in a mount namespace, inside of which the app bundle is launched.
A Limba bundle's dependencies can be specified as "version X or greater," in addition to matching a specific package version. The bundle can also include its own libraries (a feature that is also supported by xdg-app) for those packages not provided by a distribution repository.
Thus, the Limba bundle represents something of a middle-ground between the locally installed package as provided by most distributions today and the containerized bundle of xdg-app. In a March 30 blog post, Klumpp highlighted some trade-offs he sees between the two designs:
Limba does not have this issue, but instead, with its dynamic runtimes, relies on upstreams behaving nice and not breaking ABIs in security updates, so existing applications continue to be working even with newer software components.
He also points out that a Limba bundle could be made to mimic the behavior of an xdg-app bundle by specifying an exact dependency set that happens to, say, match the contents of the GNOME 3.16 xdg-app runtime.
Current status
Neither Limba nor xdg-app are yet production-ready, of course; both are still undergoing plenty of changes in development. But both are testable. Klumpp released version 0.4.0 in February, which has subsequently been followed by two minor updates. Included at present are the lipkgen tool to both generate a Limba bundle template as well as build the final package, the lipa tool to install bundles, and the runapp command to launch an installed bundle. Because Limba uses OverlayFS, the system does require a kernel built with support for that filesystem.
In the March blog post, Klumpp also provided a real-world application bundle for those interested in testing Limba. The application in question is Neverball, the same video game that Larsson released in an xdg-app bundle in February. Whether or not this series of events will lead to a rise in Neverball bundle tournaments at development events has yet to be seen; hopefully bundles with other types of application will be forthcoming.
It will be interesting to see where Limba goes next. At the moment, it does not have as much of a sandbox system in which to isolate the bundled application, but that is on the agenda and it is worth noting that xdg-app's sandbox is still under construction as well.
Considering how much overlap there is between the designs, one might be tempted to think that the success of the projects would come down to how software distributors feel about the runtime issue. If GNOME (or another project) makes a compelling argument for its all-in-one runtime, that could draw more developers toward xdg-app. But distributors might find it easier to work within the existing package-distribution model, which Limba targets.
In the longer term,
though, both projects make a case that their respective bundle format provides a
stable platform that the application developer can count on. Whether
the large-runtime approach of xdg-app or the more traditional
system-provided package environment of Limba provides better stability
is something only time will tell.
Posted Apr 9, 2015 14:14 UTC (Thu)
by Uraeus (guest, #33755)
[Link] (13 responses)
Not because upstreams are evil of course, but because upstreams consists of humans with limited time available and different priorities.
One could agree or disagree with that claim of course, but it is definitely an important issue from my viewpoint and I feel that it is one of the major advantages that Steam has brought to Linux Game development for instance, a highly predictable and dependable runtime to target.
Posted Apr 9, 2015 17:25 UTC (Thu)
by job (guest, #670)
[Link] (11 responses)
It's not like we had to fight to update bundled zlib in all softs of proprietary software on all platforms several years after it had a security issue, right?
Posted Apr 9, 2015 17:52 UTC (Thu)
by Uraeus (guest, #33755)
[Link] (3 responses)
Posted Apr 9, 2015 23:47 UTC (Thu)
by dlang (guest, #313)
[Link] (2 responses)
They will all want to bring everything in and do it themselves, until they have to suffer through updates due to a library issue.
Many sysadmins will want to keep the dependencies out of the container, until they get bit too many times by API changes.
both models have problems, which is better in the long run will probably vary from app to app.
Having a container type that still uses external dependencies will hopefully put a bit of pressure on library authors to be a bit more careful about backwards compatibility.
Posted Apr 10, 2015 6:58 UTC (Fri)
by kleptog (subscriber, #1183)
[Link]
And Python modules are a minefield. Many of the larger projects are good, but for some you have to keep a local copy of the version you want because they get randomly deleted off PyPI when the author decides to release a new version with a changed API.
For me the extra flexibility in Limba is more attractive...
BTW, am I the only one that sees a possible 1-1 mapping between Debian packages and Limba bundles?
Posted Apr 12, 2015 14:36 UTC (Sun)
by matthiask (guest, #95135)
[Link]
Of course, I hope we don't see this to happen very often. In oder to get sane dependencies, I plan to build a webservice which will manage Limba bundles. It will present information for project authors about which versions of their software are currently in use, and do additional QA on the bundles, to filter out "bad" bundles (linking data from http://upstream.rosalinux.ru/ about ABI stability is also an idea).
Regarding the sandbox solution, Limba and XdgApp will share technology as much as possible, so we have one well-tested implementation.
@kleptog: It's possible via AppStream metadata, in case you want the application to use the shared resource from your distributor's packaging - but since it is impossible for the upstream author to test with any package a distributor has compiled, this is not officially supported.
Posted Apr 10, 2015 21:38 UTC (Fri)
by Cyberax (✭ supporter ✭, #52523)
[Link] (6 responses)
Did I care about it? Nope! The most important feature for me is that it actually _worked_.
Posted Apr 11, 2015 18:08 UTC (Sat)
by robert_s (subscriber, #42402)
[Link] (5 responses)
Posted Apr 13, 2015 9:27 UTC (Mon)
by NAR (subscriber, #1313)
[Link] (4 responses)
Posted Apr 13, 2015 11:08 UTC (Mon)
by dag- (guest, #30207)
[Link] (3 responses)
Much like if your game handles network traffic, you probably don't want any vulnerabilities there (even if you have a "steel-plated front door").
Posted Apr 13, 2015 17:38 UTC (Mon)
by Cyberax (✭ supporter ✭, #52523)
[Link] (2 responses)
Posted Apr 17, 2015 18:05 UTC (Fri)
by mgedmin (subscriber, #34497)
[Link] (1 responses)
Posted Apr 17, 2015 18:17 UTC (Fri)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Posted Apr 9, 2015 22:39 UTC (Thu)
by vonbrand (subscriber, #4458)
[Link]
Somebody has to fix security (and other) bugs. Either upstream (but then APIs could slip) or backport downstream (where the required manpower will surely be lacking, specially if upstream changes the API). If there was an easy solution, distributions would have surely stumbled on it by now...
Posted Apr 19, 2015 22:00 UTC (Sun)
by toyotabedzrock (guest, #88005)
[Link]
I think this solution is better. Maybe every library needs two version numbers. And API version and a code version. This is more work but if someone takes the time to automate it better it could be workable. Perhaps unit tests could be pulled from actual code in the wild, maybe it could be based on a standardized type of comment the code author could add when the program is created? Make a plugin for popular code editors that reminds them and guides them as the code is written to put the expected input and output in a special comment for unit testing.
A different approach to application containers with Limba
A different approach to application containers with Limba
A different approach to application containers with Limba
A different approach to application containers with Limba
A different approach to application containers with Limba
A different approach to application containers with Limba
You are all right, there is no perfect solution for this problem, and there are some dependencies which will break compatibility, or make no ABI stability promise at all. In that case, you could still make an absolute dependency on that particular library version, so it won't be touched by Limba after the installation.
This will of course take a while to develop.
One thing I would like to add in future though is to add a small tool for system administrators to map the installed Limba bundles against the CVE database, to display if any installed bundle has security flaws (that's really just for sysadmins though, the average GNOME/KDE user doesn't know how to deal with that kind of information).
A different approach to application containers with Limba
A different approach to application containers with Limba
A different approach to application containers with Limba
A different approach to application containers with Limba
A different approach to application containers with Limba
A different approach to application containers with Limba
A different approach to application containers with Limba
A different approach to application containers with Limba
A different approach to application containers with Limba