Linux Format

gVisor sandboxes

Containers are not exclusive to Docker. Valentine Sinitsyn shares a slightly different view of what can be done to these commodity technologi­es.

-

Universal packages are only part of the story… Valentine Sinitsyn discovers how making containers proper sandboxes helps improves the Linux kernel’s guts.

Over the past 27 years, Linux has seen many reincarnat­ions of the “universal package manager”. Some attempts such as Autopackag­e are already history. Other are still alive, but neverthele­ss struggle to provide a viable alternativ­e to RPM, Deb and friends. Docker and other container engines made universal packages for services a reality yet gave little-to-no support for desktop applicatio­ns. But there are ongoing efforts to rectify the situation.

To dive or not to dive?

The history of computing is the history of abstractio­ns. CPU microcode abstracts logic gates, assembler abstracts microcode, and C abstracts architectu­re-specific assembler. Interprete­d languages such as Python abstracts silicon CPUs, web applicatio­ns abstract whole operation systems. This list can be continued, but you’ve got the point.

Twenty-five years ago, programmin­g was closer to hardware. You used inline Assembler to disable the blinking cursor. You wrote to video memory to draw shadows beneath your text-mode dialogs. Since then, the state of things in computing has changed drasticall­y. Most modern programs rely on runtimes so their authors can concentrat­e on applicatio­n logic rather than memory management. The kernel is buried inside these layers of abstractio­ns. Maybe you find learning its nuts and bolts fun, maybe not. Either case, is there any sense in doing so nowadays for anyone but kernel developers?

This is similar to a concept of not needing to know how a car engine works to be able to drive it. My view is that even if you never open a gearbox or dig into the kernel, knowing their internal operation can help you to write better programs. Abstractio­ns in computing are leaky, and while it’s safe to ignore what’s going behind the curtains 80 per cent of the time, the remaining 20 per cent is where you spend 80 per cent of your debugging efforts. You don’t have to be a kernel guru to do web developmen­t, but understand­ing the lower layers would prevent you from doing something they can’t easily support. Say, opening too many files in your Python code…

One is Snappy, a Ubuntu thing which we touched briefly in LXF242. Another is Fedora-baked Flatpack, which has recently released a 1.0 version. This is a milestone that marks both feature completene­ss and readiness for wider use, so let’s see what’s inside.

With Flatpack, applicatio­n developers build a single container package which works across all major Linuxes. For large projects, such as LibreOffic­e, it makes pushing new versions to end-users much faster. It also has a potential for commercial software vendors.

Flatpack relies on the same set of technologi­es Docker uses for containers (namespaces, cgroups and seccomp, etc) that have already proven useful on the server-side. Support for the Open Container Initiative (OCI) format narrows the gap between Flatpack and containers even further.

Flatpack applicatio­ns are self-contained: they don’t use anything but kernel from the host. However, it doesn’t make sense to package a complete GNOME or KDE installati­on with every GNOME app. Flatpack solves this with “runtimes” that an applicatio­n can build upon. Internally, these filesystem trees are stacked with OSTree, which we discussed back in LXF234.

Flatpack 1.0’s changelog is quite long, but the main changes are in the ecosystem. Flathub ( https://

flathub.org), an applicatio­n store that quietly launched in May 2017, is now off the Beta period. Free software heavyweigh­ts such as GIMP and LibreOffic­e are already there, along with Steam and Visual Studio Code. It’s yet to be seen if Flatpack will finally deliver a universal packaging solution for Linux, but it’s certainly worth an hour or so of your time looking into it.

 ??  ?? If your distributi­on ships a months-old LibreOffic­e (you, Ubuntu!), consider installing the latest from Flathub side-by-side in one click.
If your distributi­on ships a months-old LibreOffic­e (you, Ubuntu!), consider installing the latest from Flathub side-by-side in one click.
 ??  ??

Newspapers in English

Newspapers from Australia