Top Banner
Building Composable Serverless Apps Eric Windisch IOpipe, Inc. #iopipe
30

Building Composable Serverless Apps with IOpipe

Jan 19, 2017

Download

Technology

Eric Windisch
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Building Composable Serverless Apps with IOpipe

Building Composable Serverless AppsEric WindischIOpipe, Inc.#iopipe

Page 2: Building Composable Serverless Apps with IOpipe

Eric WindischCEO, Co-founder

Twitter: @ewindischEmail: [email protected]

Contributor:

Page 3: Building Composable Serverless Apps with IOpipe

Apache 2.0 licensedComposion / Chaining

Code sharingScatter/Gather

Run anywhere (not just AWS)NodeJS module

(Go library - experimental)CLI tool

is...

Page 4: Building Composable Serverless Apps with IOpipe

Compose:

Inline functionsStored functions

Deployed Serverless functionsHTTP endpoints

Page 5: Building Composable Serverless Apps with IOpipe

GPU

EXEC

module.exports = iopipe.define( function(event, context) { context.done(event) } )

Docker

Raspberry Pi

Local CPU

Ship, Run, Deploy anywhere

Page 6: Building Composable Serverless Apps with IOpipe

$ iopipe pull ewindisch/watson-natural-language-classifier

Page 7: Building Composable Serverless Apps with IOpipe

ewindisch/watson-natural-language-classifier

Page 8: Building Composable Serverless Apps with IOpipe

Functional functions- map // "for each"- tee // fork- reduce // array to scalar- etc...

Functions that take outside parameters and return composable functions.

Compatible with Rambda

Page 9: Building Composable Serverless Apps with IOpipe
Page 10: Building Composable Serverless Apps with IOpipe
Page 11: Building Composable Serverless Apps with IOpipe

Amazon Echo trademark of Amazon, Inc. All rights reserved.

"Alexa,If someone approaches my door with a weapon,

text me."

Page 13: Building Composable Serverless Apps with IOpipe

Lambda API

function()

URN

Page 14: Building Composable Serverless Apps with IOpipe

1. Find/discover/identify door camera2. Create workflow:

a. Take snapshot(s) using camera API (or accept as event)b. Upload snapshot(s) to Google Vision APIc. Retrieve results JSON: [

"weapon", "gun", "person", "male", etc...]

d. Condition: if not person && weapon { exit}

e. Use API to text $number3. Register event (webhook, cron job, etc).

Page 15: Building Composable Serverless Apps with IOpipe

var iopipe = require("iopipe")()var Dockaless = require("dockaless")var dals = Dockaless()

export.handler = iopipe.define( iopipe.property("url"), iopipe.fetch, dals.make_lambda("ffmpeg", [ "-i", "pipe:0", "-vf", "scale=320:240", "pipe:1" ]))

Page 16: Building Composable Serverless Apps with IOpipe
Page 17: Building Composable Serverless Apps with IOpipe
Page 18: Building Composable Serverless Apps with IOpipe
Page 19: Building Composable Serverless Apps with IOpipe
Page 20: Building Composable Serverless Apps with IOpipe

f4(f3(f2(f1(x))))==

(f4 ? f3 ? f2 ? f1)(x)==

iopipe.define(f1, f2, f3, f4)(x)

Page 21: Building Composable Serverless Apps with IOpipe
Page 22: Building Composable Serverless Apps with IOpipe

OPS

Page 23: Building Composable Serverless Apps with IOpipe
Page 24: Building Composable Serverless Apps with IOpipe
Page 25: Building Composable Serverless Apps with IOpipe

GPU

EXEC

Docker

Raspberry Pi

Local CPU

IOpipe Collector

Console

time-series

fluentd

code graph

Page 26: Building Composable Serverless Apps with IOpipe

How often is a function called?How much memory does it use?

How long does it run?Estimate deployment/usage costs

How functions can be composed.

Page 27: Building Composable Serverless Apps with IOpipe

Graphing Composition

f6(f3(f2(x)))

Page 28: Building Composable Serverless Apps with IOpipe

An app that matches spoken words to serverless functions.

#NoDev

Page 29: Building Composable Serverless Apps with IOpipe

DIY Serverless "Alexa" powered by Watson

Page 30: Building Composable Serverless Apps with IOpipe

@IOpipes

Download, hack, contribute:www.github.com/iopipe/iopipe

www.iopipe.com