Classic dimension for core18

Background

The classic dimension is a mode for Ubuntu Core devices that makes development and general interaction with the device simpler. On a core device snap install classic will install a snap that allows to create a classic environment via classic.create and that can be used by simply typing classic. The classic environment for Ubuntu Core 16 provides a Ubuntu 16.04 environment with the classic tools like apt and dpkg. This allows installing additional software and customizing as needed. Internally it is implemented as a thin chroot to ensure all debug commands like gdb, strace etc keep working.

Classic for UC18

I’m looking into enabling the classic dimension via the classic snap in core18 right now. We have some options:

Provide delta inside the core18 snap

This is what we did for UC16. Most of the bits on the core snap and a classic environment are similar, i.e. they all use the same core binaries (like “cp” etc). So the core snap contains a small “delta” that is applied on top of the core snap to generate the classic environment.

This approach works great for core but is less appealing for core18 because UC18 is a much more minimal environment than core. Adding the delta also increases the size of core18 by ~6MB for a feature that is not that commonly used.

Download base when classic is created

When the classic snap detects it runs on a UC18 system it would download the ubuntu 18.04 base tar file from the internet and unpack it. This approach means no extra space in classic but it has some downsides: verification code must be written to ensure the downloaded bits are what we expect them to be and (re)installing classic won’t work in the offline case.

Create classic snap in “18” channel with classic env in the snap

The classic snap contains the full base environment of Ubuntu 18.04 in the classic snap “18” channel. This means the initial download of the classic snap from the 18 channel takes a bit longer but we get all the goodness of snaps, i.e. download validation, deltas, offline install via snap ack/install.

Another upside of this is that it allows to create a classic env for 16.04 and 18.04. I.e. snap install classic && clasic.create would give you a 16.04 environment and snap install --channel=18 && classic.create would give 18.04. Combined with parallel installs you can even have both.

To improve the UX we could add a message/warning when on UC18 when the user runs classic.create from the UC16 snap.

Please let me know what you think. To me the third option looks most compelling but I’m of course open for ideas and feedback.

[edit: typo fixed, thanks Lin-Buo-Ren)

1 Like

typo…

1 Like

I think one big question is if we still get actual benefit from the classic dimension at all with proper lxd packages in the store, are there arches that lxd does currently not support but core does ?

is the 1:1 rootfs design that classic gives us over just using a base container really that important for what people use classic for (effectively only for using apt/snapcraft in an exact copy of the environment or to apply hacks on top of core) ?

IMHO this should turn into a general discussion if we should actually keep classic around or if we should simply drop it and rather focus development help and support on top of lxd.

if we decide to keep it … option 3 sounds like the cleanest one.