VOOZH about

URL: https://lwn.net/Articles/630660/

⇱ Ubuntu Core and Snappy [LWN.net]


👁 LWN.net Logo
LWN
.net
News from the source 👁 LWN
| |
Log in / Subscribe / Register

Ubuntu Core and Snappy

We're bad at marketing

We can admit it, marketing is not our strong suit. Our strength is writing the kind of articles that developers, administrators, and free-software supporters depend on to know what is going on in the Linux world. Please subscribe today to help us keep doing that, and so we don’t have to get good at marketing.

By Nathan Willis
January 28, 2015

A new Ubuntu flavor was unveiled in December. Called Snappy Ubuntu Core, the new product line is a minimalist version of Ubuntu geared—at first—toward cloud application deployment. The main features are support for transactional updates of software packages and support for a variety of application container frameworks. On those points, Snappy Core is positioned as a competitor to projects like CoreOS or Red Hat's recent Project Atomic. But a new twist was revealed in January, when Canonical made Snappy Core available as an Internet of Things (IoT) platform for a variety of low-profile hardware devices.

Snap on

Mark Shuttleworth announced Snappy Core at his blog on December 9. It includes a stripped-down set of packages chosen to be of use for servers (which is what constitutes the "core" part of the name), but incorporates a different package format, package-management system, and filesystem layout—all of which are designed to support making transactional updates to individual packages. The goal is that updating a package is guaranteed to either complete successfully, or to be rolled back to the previous state in the case of failure.

The intent is that administrators will use the system to deploy individual applications on separate Core instances. Those applications—be they web applications, databases, or some other cloud-based service—are likely to be packaged in containers for Docker or some other container-management system. So the transactional-update feature has a rather simple job to do when compared to, say, updating a traditional company web server that handles a multitude of duties.

The "Snappy" part of the product name comes from , the new package manager that replaces dpkg and Apt. Under the hood, a Snappy system is composed of three separate partitions: two read-only root partitions ("A" and "B") that can only be updated by and one read-write partition for mutable data (including both system and user data). At any one time, either the A or the B root partition is the live one. When an update for a package is released, installs the update on the non-live partition and marks that partition as live for the next boot. Once the user reboots, if a problem is discovered, the system can be rolled back by booting the other root partition.

The updates to core system packages are the same ones that will be released as files for the other Ubuntu releases, but the plan seems to be that updates will only be released for large-scale components. That is, the package will contain the entire base OS, while the package will contain the Docker framework. System administrators will not be managing separate , , , and packages as in a traditional distribution.

Despite the frequent references to Docker, Snappy Ubuntu Core is described as supporting several other containerization frameworks. There are also a few ancillary packages available for installation (such as the Docker tool Panamax), and several applications—including ownCloud, which Shuttleworth's post mentions in connection with the contentious packaging problem encountered on Ubuntu systems in 2014.

Similar and related concepts

An interesting side note is that Snappy and the .snap package format are both derived from tools initially developed for the Ubuntu Phone project. Smartphone users, too, prefer to get OS updates that either complete successfully or are immediately rolled back in favor of the last known-working release. On Ubuntu Phone, the package format is called "click," but the container format and the full-system update idea is essentially the same. The core system is installed on a read-only partition, with user applications and mutable data installed in a separate, read-write partition. But Ubuntu Phone does not use the dual-root partition scheme of Snappy Core—since phones typically have far less storage to play around with. That makes installing a Phone update a somewhat riskier proposition than installing a Snappy Core update—although the same could be said of most, if not all, mobile phone OSes.

Snappy Core is also akin to the minimal, Docker-centric server offerings from CoreOS and Red Hat. Red Hat's Project Atomic is probably the most direct comparison—for its part, CoreOS has always been a minimalist distribution focused on deploying cloud applications. But Atomic, like Snappy Core, is also derived from an existing "full-fledged" Linux distribution. There are, however, a few key differences.

Some of those differences proceed directly from the original distribution. Atomic is based on RHEL, so it uses SELinux to sandbox installed applications. Snappy Core sandboxes applications with AppArmor. Atomic is also decidedly Docker-specific, and includes Kubernetes as its container-management tool. In contrast, Ubuntu has announced its intention to support other container frameworks and management tools for Snappy Core (exactly which container systems have not been announced, although several management tools have been mentioned, including Kubernetes and Ubuntu's own LXD).

It will also, no doubt, be a matter of much discussion which system best adheres to the "minimalist" label. Base Atomic images weigh in at 8.5GB, while each of Snappy Core's root filesystems occupies 2GB.

Atomic also takes a fundamentally different package-management approach to achieve its transactional update feature. Atomic's packages are made from RPMs, but they are built using an OSTree instance. OSTree creates versioned instances of entire filesystem trees. The new version can be installed directly over the old one and, if problems are discovered, the whole filesystem can be simply rolled back to the previous version.

Snapping all the things

The Snappy Core announcement might have remained solely of interest to cloud customers, but on January 20, Canonical announced that Snappy Core would also be available for a number of popular IoT hardware devices as well.

As always, the precise definition of IoT varies from one story to the next but, in this case, it seems to apply to inexpensive single-board computers (SBCs) and other "smart devices" that are used to construct either low-power or physical computing projects—including such diverse options as home-automation boxes, unmanned vehicles, and robots. The Snappy Core IoT page lists a number of supported devices, including the BeagleBone Black, UDOO, PCDuino, Parallela, and ODroid, as well as several application frameworks—such as the Robot Operating System (ROS), the OpenSensors messaging engine, and the openHAB home-automation server.

As of today, though, Snappy Core images have only been released for ARMv7-A devices like the BeagleBone Black. Only a few example applications have been published, such as the Camlistore database system and a Go webserver on which Camlistore runs.

In addition to the distinct slate of packages targeting IoT devices, the IoT flavor of Snappy Core also features a web-based administrative tool called WebDM. It can be used to search for and install (or update) packages and applications.

IoT devices and cloud servers are, to be sure, quite different in almost every respect, so offering the same OS system on both may seem incongruous. But the two classes of computing do share at least two common factors: each tends to be deployed for only a handful of specific applications (perhaps even just one), and administrators expect the base operating system to be reliable without a constant stream of package updates. So taking the same approach to updating and application management could ultimately keep both user segments happy.