The Internet of Things (IoT) requires an operating system that needs low power, is lightweight, secure and reliable. Ubuntu Core has been developed to serve these purposes. Instead of depending on repositories for downloading packages, it uses the concept of snaps, which does away with the need to develop apps for separate and varied builds of Ubuntu.
The modern day triumvirate of Linux, Windows and OS X seemingly rules the market for operating systems on personal computers, while Linux variants—most notably Android —and iOS seem to have cornered mobile phone operating systems. Ubuntu did launch a phone operating system, but it was later abandoned by Canonical due to a lack of interest from the market. This was later adopted by the UBPorts Foundation, and is being used in a few tablets and phones launched by Meizu and the Spanish manufacturer BQ.
Ubuntu, one of the most popular Linux distributions ever developed, comes in three variants. Most of us are already familiar with Ubuntu Desktop, which is meant for use on personal computer systems. Ubuntu Server is the version developed for bare metal servers and infrastructure, with a focus on scalability and distributed operations. However, there’s another variant of the distro titled Ubuntu Core that has been developed specifically for applications in the Internet of Things domain. The aim is to provide a unified user experience across mobile devices, tablets and AMD laptops in sync with the other two Ubuntu versions.
Broadly speaking, the Internet of Things has a certain set of requirements for an operating system — it must be lightweight, secure and reliable. This has driven developers to strip away most of the heavier elements of the operating system and introduce a new form of package called snaps. In essence, snaps are images of the software packages that preclude the necessity of installation from the app store and, instead, offer the option of obtaining them from multiple sources. In addition, the upstream can be installed without the need to wait for changes to propagate along the repositories and versions maintained by distributors.
Why snaps work
If you think installing packages on your Ubuntu machine is complex, consider the work of developers who are often required to create disparate builds for not only 14.04, 14.10, 15.04, 15.10, 16.04 and other versions of Ubuntu, but also implement separate packages for each version of other distributions such as OpenSUSE and Fedora. In theory, it is a nightmarish task to run separate builds. Fortunately, the idea of snaps has cut down the build process and has introduced containerised versions of packages that can function in a cross-platform scenario.
To better understand snaps, we start from the concepts underlying packages. The .deb software packages for each application are hosted on the Debian repository and can then be installed. When the apt-get or yum command is run, packages are downloaded from repositories based on the releases compatible with the current platform. Finally, the dependencies are pulled in and installed along with the original software package. This process of installation on the standard Ubuntu Desktop and Ubuntu Server platforms was done away with an attempt to make Ubuntu Core as light as possible. This is why developers introduced the concept of snaps. These are snapshots of applications that do not rely on a backend such as the package repository or dependencies. Instead, they are self-contained versions of software that can be installed on any platform without the need for complex procedures. Snaps ensure a more secure and complete experience, where new features are released more quickly from the upstream and the emphasis is on enabling immediate roll-backs in cases of failure.
The development of the snap versions of packages is connected with the development of the Ubuntu Touch platform for tablets and phones. The aim was to make minimal impact installs with containerised data and dependencies that are independent of other packages. The idea was then extrapolated to create, as Wikipedia puts it, a distro-agnostic snapshot of the software package that can be installed from the upstream, and contains its own data that is possible to share between snaps. Incidentally, this is one of the aspects that distinguishes snaps from the conventional Linux containers and Docker images.
Ubuntu Core serves as a platform that functions as the backend for running snapshots of the applications developed and these are run in the ecosystem using snapd. It is, as described by the Canonical website, a ‘minimalist rendition of Ubuntu that offers a strict separation between kernel and device drivers, OS and applications’ such that application developers and embedded software engineers can work in parallel. It offers support to run in the cloud and on digitally connected Internet devices. The technology powering the platform is snapd, which offers the ability to manage snapshots, OS snaps, transactional updates, application confinement and garbage collection of older snaps. There is a set of interfaces that permits the snaps to access OS features and share features across applications.
Initially started as a separate project, Ubuntu Core eventually merged with the Snappy ecosystem to form a unique platform that presented a viable set of features for use cases such as the cloud or IoT, which require an OS with a low memory footprint, high security and reliability. This set of attributes makes Ubuntu Core well suited for use in applications pertaining to the Internet of Things. It presents a transactionally updatable platform that can run securely on autonomous digital appliances.
The author has worked at Microsoft Research, CERN and startups in AI and cyber security. He is an open source enthusiast who enjoys spending time organising software development workshops for school and college students. You can contact him at https://www.linkedin.com/in/swapneelm; https://github.com/SwapneelM or http://www.ccdev.in.