snap your app

41
Snap your App! Ted Gould [email protected] @tedjgould Texas Linux Fest 21 Aug 2015

Upload: ted-gould

Post on 12-Apr-2017

483 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Snap Your App

Snap your App!

Ted [email protected] @tedjgouldTexas Linux Fest21 Aug 2015

Page 2: Snap Your App

The Plan

● Give instructions on getting Snappy installed

● Talk about Snappy

● Give instructions on downloading demo

● Talk about building apps for Snappy

● Build an app for Snappy

Page 3: Snap Your App

QEMU (Virtual Machine Manager)

$ sudo apt-get install qemu-kvm ubuntu-virt-mgmt python-spice-client-gtk

$ kvm-ok

Page 4: Snap Your App

Snappy Image

$ wget http://releases.ubuntu.com/15.04/ubuntu-15.04-snappy-amd64-generic.img.xz

$ unxz ubuntu-15.04-snappy-amd64-generic.img.xz

Page 5: Snap Your App

Test It!

$ kvm -m 512 -redir :8090::4200 -redir :8022::22 ubuntu-15.04-snappy-amd64-generic.img

$ ssh -p 8022 ubuntu@localhost

Page 6: Snap Your App

Play with it!

Page 7: Snap Your App
Page 8: Snap Your App

Ubuntu

● Debian based (package format and policies)● Regular Releases● Updated via Apt

Page 9: Snap Your App

Ubuntu Phone

● Click Applications● System Image Updates

Page 10: Snap Your App

Why Click?

Millions

Thousands

Page 11: Snap Your App

Leaves are Simpler

Single Dependency

Page 12: Snap Your App

ClickApp

Ubuntu TouchUbuntu Touch

ClickApp

ClickApp

ClickApp

Page 13: Snap Your App

Reviewers Don't Scale

Page 14: Snap Your App

Why Image Based Updates?

● Binary: Works or it doesn't● Provides opportunity to

rollback● Simple testable states

Page 15: Snap Your App

— Us, acting cooler thanwe actually are

“Let's Take Ubuntu Phone all the way to 11!”

Page 16: Snap Your App

Snappy Ubuntu Core

● Transactional Updates● Snap based Apps● Snap frameworks● OS snap

Page 17: Snap Your App

App

AppApp

Framework

Snappy Ubuntu CoreSnappy Ubuntu Core

Hardware Abstraction

App

Gad

ge

t

Page 18: Snap Your App

Hardware Abstraction

● Provided by board vendors● Allows for custom drivers and config

Page 19: Snap Your App

“Gadget” Snap

● Per-device configuration● Snaps to install● Permissions● Branding

Page 20: Snap Your App

Framework Snaps

● Provide shared services● Mediate resources● IPC to Apps

Mir System Compositor

Page 21: Snap Your App

Why snap? (not click)

● Click v2.0● Click only for leaf nodes● Support for OS and framework snaps● Lower level components

Page 22: Snap Your App

Cloud

InternetOf Things

CorpIT

Consumer Devices

Page 23: Snap Your App

Trend: Internet of Things

● Smaller computers● Internet connectivity● Full OS resources● Must be reliable

Page 24: Snap Your App

Trend: Consumer Devices

● More complex interactions

● Bullet-proof experience

● Complex security situations

Page 25: Snap Your App

Trend: Corporate/Education IT

● Verifiable Images● Upgrades don't cause

downtime● Limited apps and app

permissions

Page 26: Snap Your App

Trend: Cloud and Containers

● Small base OS (JeOS)● Unit of specialized code● Tested as a unit

Page 27: Snap Your App

Snappy Store

Page 28: Snap Your App

Store Story: Erle Robotics

Page 29: Snap Your App

Store Store: Networking

Page 30: Snap Your App

Try it today!

http://ubuntu.com/snappy

Page 31: Snap Your App

Progress Check-In

Page 32: Snap Your App

Import into VMM

$ sudo cp ubuntu-15.04-snappy-amd64-generic.img /var/lib/libvirt/images/

$ sudo chown libvirt-qemu.kvm /var/lib/libvirt/images/ubuntu-15.04-snappy-amd64-generic.img

Page 33: Snap Your App
Page 34: Snap Your App

$ ifconfig$ sudo snappy install docker$ sudo snappy install snapcraft-daily.ted$ snapcraft-daily.snapcraft help

Install Snapcraft

Page 35: Snap Your App

What is a snap?

● A self-contained bundle

● Includes dependencies

● Works with frameworks

You are here

Page 36: Snap Your App

Snap Definition (package.yaml)

name: photoviewerversion: 0.1vendor: Ted Gould <[email protected]>architecture: amd64frameworks: [mir]binaries: - name: photoviewer exec: qmlscene main.qml -- caps: - mir_client - network-client

Page 37: Snap Your App

https://developer.ubuntu.com/en/snappy/guides/filesystem-layout/

Snap Directories

Page 38: Snap Your App

Snapcraft

Snap

Snapcraft Your Code

Upstream Depends

Page 39: Snap Your App

Block Inception

Page 40: Snap Your App

Snapcraft.yaml

parts:

qml:

plugin: qml

photoviewer:

plugin: copy

files:

main.qml: main.qml

PhotoViewerCore: PhotoViewerCore

snappy-metadata: meta

Page 41: Snap Your App

Demo