Building Composable Serverless Apps with IOpipe

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

Transcript of Building Composable Serverless Apps with IOpipe

Building Composable Serverless AppsEric WindischIOpipe, Inc.#iopipe

Eric WindischCEO, Co-founder

Twitter: @ewindischEmail: [email protected]

Contributor:

Apache 2.0 licensedComposion / Chaining

Code sharingScatter/Gather

Run anywhere (not just AWS)NodeJS module

(Go library - experimental)CLI tool

is...

Compose:

Inline functionsStored functions

Deployed Serverless functionsHTTP endpoints

GPU

EXEC

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

Docker

Raspberry Pi

Local CPU

Ship, Run, Deploy anywhere

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

ewindisch/watson-natural-language-classifier

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

Functions that take outside parameters and return composable functions.

Compatible with Rambda

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

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

text me."

Lambda API

function()

URN

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).

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" ]))

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

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

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

OPS

GPU

EXEC

Docker

Raspberry Pi

Local CPU

IOpipe Collector

Console

time-series

fluentd

code graph

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.

Graphing Composition

f6(f3(f2(x)))

An app that matches spoken words to serverless functions.

#NoDev

DIY Serverless "Alexa" powered by Watson

@IOpipes

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

www.iopipe.com