snap your app! - gould.cx: a very gould place your... · 2020-07-01 · the pull phase takes care...

43
Snap your App! Ted Gould [email protected] @tedjgould Ubucon November 19 th , 2015

Upload: others

Post on 09-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Snap your App!

Ted [email protected] @tedjgouldUbuconNovember 19th, 2015

Page 2: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft
Page 3: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Ubuntu

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

Page 4: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Ubuntu Phone

● Click Applications● System Image Updates

Page 5: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Why Click?

Millions

Thousands

Page 6: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Leaves are Simpler

Single Dependency

Page 7: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

ClickApp

Ubuntu TouchUbuntu Touch

ClickApp

ClickApp

ClickApp

Page 8: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Reviewers Don't Scale

Page 9: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Why Image Based Updates?

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

rollback● Simple testable states

Page 10: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

— Us, acting cooler thanwe actually are

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

Page 11: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Snappy Ubuntu Core

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

Page 12: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Deb-basedSystem

Snap-basedSystem

Page 13: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

App

AppApp

Framework

Snappy Ubuntu CoreSnappy Ubuntu Core

Hardware Abstraction

App

Gad

ge

t

Page 14: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Hardware Abstraction

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

Page 15: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

“Gadget” Snap

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

Page 16: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Framework Snaps

● Provide shared services● Mediate resources● IPC to Apps

Mir System Compositor

Page 17: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Why snap? (not click)

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

Page 18: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Cloud

InternetOf Things

CorpIT

Consumer Devices

Page 19: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Trend: Internet of Things

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

Page 20: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Trend: Consumer Devices

● More complex interactions

● Bullet-proof experience

● Complex security situations

Page 21: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Trend: Corporate/Education IT

● Verifiable Images● Upgrades don't cause

downtime● Confined apps and

app permissions

Page 22: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Trend: Cloud and Containers

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

Page 23: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Snappy Store

Page 24: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Store Story: Erle Robotics

Page 25: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Store Store: Networking

Page 26: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Try it today!

http://ubuntu.com/snappy

Page 27: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

What is a snap?

● A self-contained bundle

● Includes dependencies

● Works with frameworks

You are here

Page 28: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

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

Snap Directories

Page 29: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Source Code

snapcraft yaml

Binaries

package yaml

Snappy Store

Snapcraft

Binaries

package yaml

digital signature

Snapcraft Cloud Parts

Common Repositories

……

Page 30: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Block Inception

Page 31: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

snapcraft.yaml

name: photoviewer

version: 0.2

vendor: Ted Gould <[email protected]>

frameworks: [mir]

summary: Photoviewer from Flickr tags

binaries:

photoviewer:

exec: qmlscene main.qml --

caps:

- mir_client

- network-client

parts:

qml:

plugin: qml

photoviewer:

plugin: copy

files:

main.qml: main.qml

PhotoViewerCore: PhotoViewerCore

Page 32: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

snapcraft.yaml

name: photoviewer

version: 0.2

vendor: Ted Gould <[email protected]>

frameworks: [mir]

summary: Photoviewer from Flickr tags

binaries:

photoviewer:

exec: qmlscene main.qml --

caps:

- mir_client

- network-client

parts:

qml:

plugin: qml

photoviewer:

plugin: copy

files:

main.qml: main.qml

PhotoViewerCore: PhotoViewerCore

PackageInformation

Page 33: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

snapcraft.yaml

name: photoviewer

version: 0.2

vendor: Ted Gould <[email protected]>

frameworks: [mir]

summary: Photoviewer from Flickr tags

binaries:

photoviewer:

exec: qmlscene main.qml --

caps:

- mir_client

- network-client

parts:

qml:

plugin: qml

photoviewer:

plugin: copy

files:

main.qml: main.qml

PhotoViewerCore: PhotoViewerCore

SystemIntegration

Page 34: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

snapcraft.yaml

name: photoviewer

version: 0.2

vendor: Ted Gould <[email protected]>

frameworks: [mir]

summary: Photoviewer from Flickr tags

binaries:

photoviewer:

exec: qmlscene main.qml --

caps:

- mir_client

- network-client

parts:

qml:

plugin: qml

photoviewer:

plugin: copy

files:

main.qml: main.qml

PhotoViewerCore: PhotoViewerCore

BuildInstructions

Page 35: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

This lifecycle diagram depicts the whole snapcraft process, that is composed by several steps with reflection in the snapcraft utility pertinent commands.

pull build stage strip snap

Snapcraft lifecycle

Page 36: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

The pull phase takes care of the downloading / cloning of the remote files needed for this part.

Snapcraft will create a parts/ directory with sub-directories for each part that contains the downloaded content.

i.e: parts/part-nam e/src

This step will download content, e.g. checkout a git repository or download a binary component like the Java SDK.

ubuntu-core

pull

src

Snapcraft lifecycle

Page 37: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

The build phase builds the parts of the downloaded code.

The next step is that each part is built in its parts/part-name/build directory and installs

itself into parts/part-name/install.-co

pull build

src srcbuild

Snapcraft lifecycle

Page 38: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

The stage phase copies the installed files into a user-visible stage/folder. All parts share the same file layout.

the parts are combined into a single directory tree that is called the "staging area". It can be found under the ./stage directory.

pull build stage

src srcbuild

Snapcraft lifecycle

Page 39: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

The strip phase copies the files in stage, minus any filtered/excluded files into the user-visible snap/folder. It also creates any additional package metadata.

The snap step moves the data into a ./snap directory. It contains only the content that will be put into the final snap package (unlike the staging area which may include some development files).

This ./snap directory is useful for inspecting what is going into your snap and to make any final post-processing on snapcraft's output. The metadata info about the project will also now be placed in ./snap/meta.

pull build stage strip

src srcbuild snap

Snapcraft lifecycle

Page 40: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

The snap phase wraps the needed files into a .snap file with the snap packaging format.

The final step builds a snap package out of the snap directory.

This .snap file can be uploaded to the Ubuntu store and published directly to snappy Ubuntu Core users.

Snapcraft lifecycle

pull build stage strip snap

src srcbuild snap

Page 41: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Upload to Store

Page 42: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Further Reading

● http://developer.ubuntu.com — Information on all things developing for Ubuntu, from phone API docs to Snappy config file formats.

● http://myapps.developer.ubuntu.com — Store to upload apps to

● http://ubuntu.com/snappy — Information on Snappy, suitable for non-developers

● http://askubuntu.com/ — Stack Exchange to ask and eventually answer questions about Ubuntu, including Snappy and Snapcraft

Page 43: Snap your App! - gould.cx: A Very Gould place your... · 2020-07-01 · The pull phase takes care of the downloading / cloning of the remote files needed for this part. Snapcraft

Questions Please

Ted [email protected] @tedjgould