<div dir="ltr"><span id="inbox-inbox-docs-internal-guid-45089605-7420-2a16-28f3-bcefc0bc332b"><font face="verdana, sans-serif"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="background-color:transparent;font-size:14.6667px;white-space:pre-wrap">Hi All</span><br></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">I’ve been working with a few folk over the last few months to see if snaps (see [0]) might be a good alternative approach to packaging and distribution of OpenStack.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">As OpenStack projects are Python based, producing snaps has been relatively trivial with the snapcraft python plugin, which supports all of the tooling that would be used in a deployment from source (pip, constraints etc…).  Thanks goes to Sam Yaple for his work on the Python plugin to support all of the required features for snapping OpenStack!</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">The resulting snap for each project is </span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">self contained</span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">, with all required dependencies baked into the snap, rather than using system provided dependencies from the hosting operating system.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">This means that the snap is </span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">directly aligned with each OpenStack project</span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> from a software component perspective - avoiding the juggling act that distro’s have to do each cycle to ensure the entire dependency chain for OpenStack is lined up correctly.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Additionally, we </span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">can also include other non-Python dependencies</span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> in a snap - for example the nova-hypervisor snap includes dnsmasq, ipset and openvswitch tools built from source as part of the snap build process.  I’d envision extending that list to include libvirt (but that was a bit too much to bite off in the first few cycles or work).</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">From an operations perspective, snaps are </span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">transactionally applied on installation</span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">, which means that if an upgrade fails, the snap </span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">will be rolled back to the last known good version</span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Installs and upgrades are also fast</span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">, as the snap internally is a read only squashfs filesystem which is simply mounted alongside the existing installed snap, daemons are stopped, pointers switched and daemons restarted.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Snaps typically run a confined environment</span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">, sandboxed </span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">using AppArmor and Seccomp</span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> on Ubuntu. Snapd (the management daemon for snaps) provides a number of interfaces to allow users to grant snaps permissions to perform different operations on the host OS - for example network and firewall control (the full interface list is much longer  - see [3]).  </span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">We’ve leveraged (and contributed to) a number of these interfaces to support the nova-hypervisor snap.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Snap confinement means that snaps don’t (by default) have access to /etc - instead configuration is supplied in a snap specific location on the filesystem (take a look in the README of a snap for how that works at a high level).  That location essentially mirrors /etc for the snap, which should make </span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">adoption relatively easy for existing deployment tooling</span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Snaps are also by design distro agnostic</span><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> - so long as snapd has been ported and the kernel version is sufficient to support the required security features things should just work (but we’ve not tried that out just yet!).</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">We’ve snapped a few core components (see [1]) - enough to produce an all-in-one install which you can try on Ubuntu 16.04 using snap-test [2] to get a flavor of how things will look as this work develops further.</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><br></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">The source for each snap is being developed on OpenStack infra, however the final build and publication to the snap store is being done on Launchpad using git repo mirroring and automatic snap building on each change.   This includes arm64 and ppc64el architecture builds.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Updates are only pushed to the edge channel on the snapstore today - we’ll need to figure out a good channel strategy as things mature to include great CI/CD as well as concurrent support for multiple OpenStack releases.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Anyway - that’s probably enough words for now!</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">We’re all hanging out in #openstack-snaps on Freenode IRC so come find us if you have any questions!</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Cheers</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">James</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">[0] </span><a href="http://snapcraft.io" style="text-decoration:none"><span style="font-size:14.6667px;color:rgb(17,85,204);background-color:transparent;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap">http://snapcraft.io</span></a></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">[1] </span><a href="https://github.com/search?q=org%3Aopenstack+snap" style="text-decoration:none"><span style="font-size:14.6667px;color:rgb(17,85,204);background-color:transparent;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap">https://github.com/search?q=org%3Aopenstack+snap</span></a></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">[2] </span><a href="https://github.com/openstack-snaps/snap-test" style="text-decoration:none"><span style="font-size:14.6667px;color:rgb(17,85,204);background-color:transparent;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap">https://github.com/openstack-snaps/snap-test</span></a></p><span style="font-size:14.6667px;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">[3] </span><a href="http://snapcraft.io/docs/reference/interfaces" style="text-decoration:none"><span style="font-size:14.6667px;color:rgb(17,85,204);background-color:transparent;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap">http://snapcraft.io/docs/reference/interfaces</span></a></font></span><br></div>