ibm bluemix openwhisk: serverless conference 2016, london, uk: the future of cloud programming

44
ServerlessConf London 2016 IBM Bluemix OpenWhisk The Future of Cloud Programming: Event-driven and Serverless Programming with OpenWhisk Dr. Andreas Nauerz, Technical Product Manager @AndreasNauerz Michael Behrendt, Distinguished Engineer @michael_beh

Upload: openwhisk

Post on 08-Jan-2017

431 views

Category:

Software


1 download

TRANSCRIPT

Page 1: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

ServerlessConf London 2016

IBM Bluemix OpenWhiskThe Future of Cloud Programming:Event-driven and Serverless Programming with OpenWhiskDr. Andreas Nauerz, Technical Product Manager @AndreasNauerzMichael Behrendt, Distinguished Engineer @michael_beh

Page 2: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Please Note:

2

• IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion.

• Information regarding potential future products is intended to outline our general product direction and it should not be relied on in making a purchasing decision.

• The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future products may not be incorporated into any contract.

• The development, release, and timing of any future features or functionality described for our products remains at our sole discretion.

• Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user’s job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.

Page 3: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Agenda

• OpenWhisk in a nutshell & comparison to traditional models• How OpenWhisk works, how it has been build & usage scenarios• Programming model• Live demo• What‘s new?• Summary & Questions

3

Page 4: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk* in a nutshell

„Event-action platform to execute code in response to events“Delivered as open source & managed service on IBM Bluemix

* whisk (v): to move nimbly and quickly (source: merriam-webster.com)

Page 5: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk* in a nutshell

„Event-action platform to execute code in response to events“Available as beta and for free

* whisk (v): to move nimbly and quickly (source: merriam-webster.com)

https://console.ng.bluemix.net/openwhisk/

Page 6: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk: Comparison to traditional models

Swift

Application

Container VMCF

2

Polling

1b

Request

1a

• Traditional model– Continous polling due to missing event programming

model– Charges even when idling due to poor utilization– Worry about scaling

• When to scale? (mem-, cpu-, response time-driven)• How fast to scale?

– Worry about resiliency• At least 2 processes for HA (driving cost)• Deployment in multiple regions (driving cost)• Keep them running & healthy

Process & idle

Page 7: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk: Comparison to traditional models

• OpenWhisk– Introduces event programming model– Charges only for what is used due to optimal utilization– Scales inherently

• One process per request– No cost overhead for resiliency

• No long running process for HA

Trigger

1

Running action

Running action

Running action

3

Deploy action within millisecs,run it, free up resources

OpenWhisk Engine

2 Pool of actions

Swift DockerJS Python Java*

* work in progress

Page 8: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk in a nutshell

Serverless deployment & operations model

Optimal utilization & granular pricing

Scales on a per-request basis

Page 9: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk in a nutshell

Flexible programming model

Support for different invocation modelsBlocking, non-blocking, periodic

Polyglot supportSupport for multiple runtimes: JS/NodeJS, Swift, Python, Java*, DockerCommunity efforts: Go, Haskell, Scala, …

Supports higher-level programming constructsParameter bindingChaining/sequencingDebugging*

* work in progress

Page 10: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk in a nutshell

Open engine & open event emitter/consumer ecosystem

Open interface for event emitters

Implemented in Scala & implemented based upon open technologiesDocker, Kafka, Consul, …

Community efforts to integrate with open toolsServerless Framwork*, VS Code, NodeRED, Jupyter Notebooks , …

Apache Incubator proposal is out!Submitted jointly with partners!

* work in progress

Page 11: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk: Another way to build apps…Build your apps, your way.

Use a combination of the most prominent open-source compute technologies to power your apps. Then, let Bluemix handle the rest.

Ease of getting started Full stack Control

OpenWhisk

Event-driven apps, deployed in a serverless

environment.

Instant Runtimes

App-centric runtime environments based on

Cloud Foundry.

IBM Containers

Portable and consistent delivery of your app

without having to manage an OS.

Virtual Machines

Get the most flexibility and control over your environment with VMs.

Page 12: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk: How does it work?

* work in progress

} 1

Event Providers

Cloudant

Push Notifcations

Kafka*

Data event occurs, e.g.-Commit on a Git Repository-CRUD operation on Cloudant-….

OpenWhisk

Trigger execution of associated OpenWhisk action

2

Swift DockerJS Python Java*

Page 13: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk: How does it work?

Incoming HTTP request, e.g. HTTP GET openwhisk.ng.bluemix.net/api/v1/<namespace>/actions/getCustomers

1Browser

Mobile App

Web App

OpenWhisk

2 Invoke associated OpenWhisk action

„getCustomers“

Swift DockerJS Python Java*

Variety of languages

* work in progress

Page 14: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk: How does it work?

Coming soon...

• API Gateway is build based on contributions from Adobe & IBM leveraging technologies like Nginx & IBM’s microgateway

• Allows to create, run, manage and secure APIs and microservices• Combined with OpenWhisk it provides an easy way to build

backends without the need to manage servers by mapping APIs to actions

• Both technologies together allow to quickly develop & deploy serverless APIs, microservices & SPAs

Incoming HTTP request, e.g. HTTP GET api-gw.mybluemix.net/…/getCustomers

1Browser

Mobile App

Web App

2

OpenWhisk

3 Invoke associated OpenWhisk action

“getCustomers“

Swift DockerJS Python Java*

* work in progress

Page 15: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk: How does it work?

Coming soon...

- API Gateway takes care of…- security (authenticate, authorize, threat protect, validate)

- control (rate limiting, response caching)

- mediation

- parameter mapping

- schema validation

- … and supports e.g. different verbs (Get, Post, Put, Delete, …)

Incoming HTTP request, e.g. HTTP GET api-gw.mybluemix.net/…/getCustomers

1Browser

Mobile App

Web App

2

OpenWhisk

3 Invoke associated OpenWhisk action

„getCustomers“

Swift DockerJS Python Java*

* work in progress

Page 16: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk: How does it work?

Coming soon...

• OpenWhisk CLI is extended to to allow user to define routes for actions

$ wsk action create hello hello.js$ wsk api create GET /v1/hello hello

Route URL: https://api-gw.mybluemix.net/api/ /nsuuid/v1/hello

$ curl –XGET https://api-gw.mybluemix.net/api/ /nsuuid/v1/hello{ message: ”Hello World” }

1Browser

Mobile App

Web App

2

OpenWhisk

3 Invoke associated OpenWhisk action

„getCustomers“

Swift DockerJS Python Java*

* work in progress

Incoming HTTP request, e.g. HTTP GET api-gw.mybluemix.net/…/getCustomers

Page 17: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk architecture

Trigger

Package

Feed

Package

Feed

Package

Feed

Package

Feed

REST

CLI iOS SDK

CRUD triggers, actions, and rulesInvoke actions

UI

Action

NodeJS

Action

Swift

Action

Docker

Rule

Rule

Rule

Action

NodeJS

Action

Docker

Service ecosytem

Bluemix services

3rd party services

Self-enabled services

Chain Chain Invoke

Docker (and potentially other abstractions going forward)

API Gateway*

* work in progress

Page 18: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Some usage Scenarios

• Microservices-based apps / APIs

• Mobile Backends

• Data (Stream) Processing

• IoT

• Cognitive

• Bots

Page 19: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Real-world customer scenario

Page 20: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk: Topology in OpenSource

20

Controller

…Invoker InvokerInvoker

Page 21: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Cloudant

OpenWhisk: Topology in Bluemix

21

ELK-Stack

soon

Controller

Integration Service

soon

…InvokerInvokerInvoker

Monitoring

soon

Page 22: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk: Usage of Docker

• Isolation of actions• Control over consumed resources of each container

22

A =wsk action invoke docker run

Page 23: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk: Container startup

23

Start containerdocker run

Initialize/init

Run/run

cold container

Page 24: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Start containerdocker run

Initialize/init

Run/run

OpenWhisk: Container startup

24

pre-warmed container

Page 25: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Start containerdocker run

Initialize/init

Run/run

OpenWhisk: Container startup

25

warm container

Page 26: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

OpenWhisk: Container startup optimization

• Performance is king.

26

cold container pre-warmed container warm container

faster

Page 27: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Programming model

• Services define the events they emit as triggers, and developers associate the actions to handle the events via rules

• The developer only needs to care about implementing the desired application logic - the system handles the rest

T R A

Page 28: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Programming model

Debugging actions*A

• Allows to…– debug actions locally– inspect parameter values– edit code & push changes

• Supports debugging…– NodeJS, Python and Swift actions

* work in progress

Page 29: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Programming model

Debugging actions*A

* work in progress

https://github.com/openwhisk/openwhisk-debugger

Page 30: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Programming model

Actions: Can be chained to create sequences to increase flexibility and foster reuse

A

AA := A1 + A2 + A3

AB := A2 + A1 + A3

AC := A3 + A1 + A2

Page 31: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Programming model

Rules: „An association of a trigger and an action“R

R := T A

Page 32: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Event & Action Providers

OpenSource

ThirdParty

Yours

PushNotifications

webhook

A

forecast

translatelanguageId

textToSpeech

changes

T

sendMessage

databaseCreatedocumentRead

...

Websocket send

webhook

post

myAction myFeed

A T

Page 33: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

What’s new?

• Community effort to integrate with open tools: NodeRED

• NodeRED is all about automating flows to orchestrate calls to different service APIs– Usually triggered by calls from external systems or devices– Runs within a long-running single node process, with a dedicated amount of CPU & memory being allocated

• OpenWhisk is all about executing code (custom logic) in response to events on a scalable platform, with a dedicated amount of CPU & memory being allocated per-request

• NodeRED and OpenWhisk complement each other– Use NodeRED to graphically create flows, automating a series of tasks in a kind of workflow– Use OpenWhisk to execute custom logic (requiring some kind of CPU- or memory bound operation) triggered

from within NodeRED

Page 34: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

What’s new?

• Community effort to integrate with open tools: VS Code extension

• Eases development with OpenWhisk by supporting the entire development cycle (list, create, update, invoke, actions etc.) without the need to leave the IDE

• Extension works for actions written in different languages (like JS and Swift) and on different platforms (like Windows, Mac, and Linux)

Page 35: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Live demo

Page 36: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

What’s (else is) new?

• Graduated from experimental to public beta on 09/09– programming language support for Node 6, Python, and pre-releases of Swift 3, Java*– support for uploading (Node) dependencies– new UI for editing, monitoring, and configuring integrations– simple GO-based binary CLI available - cross platform– a growing list of interesting open-source applications on github, including DarkVision

(https://github.com/IBM-Bluemix/openwhisk-darkvisionapp) and Skylink (https://github.com/IBM-Bluemix/skylink)

* work in progress

Page 37: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Join us today

• You want to try OpenWhisk on your own?– Want to try out our IBM Bluemix OpenWhisk offering for free?

• Sign-up today at: https://console.ng.bluemix.net/openwhisk/– Want to try out our open-source OpenWhisk offering?

• Visit: https://developer.ibm.com/openwhisk/

Page 38: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Learn more

• OpenWhisk Developer Center (focuses on our open-source project)https://developer.ibm.com/openwhisk/

• OpenWhisk Bloghttps://developer.ibm.com/openwhisk/blogs/

• OpenWhisk on Githubhttps://github.com/openwhisk/openwhisk/

• OpenWhisk official documentation on Githubhttps://github.com/openwhisk/openwhisk/blob/master/docs/README.md

Page 39: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Learn more

• OpenWhisk on Twitterhttps://twitter.com/openwhisk

• OpenWhisk on Slackhttps://dwopen.slack.com (channel: openwhisk)

To join go here:http://slackindwo.mybluemix.net/

• OpenWhisk additional material on Slidesharehttp://www.slideshare.net/OpenWhisk

• OpenWhisk additional material on Youtubehttps://www.youtube.com/channel/UCbzgShnQk8F43NKsvEYA1SA

• Other OpenWhisk materialhttps://github.com/openwhisk/awesome-openwhisk

Page 40: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Learn more

• OpenWhisk past and upcoming eventshttps://developer.ibm.com/openwhisk/events/

Page 41: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Questions?

Page 42: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Notices and Disclaimers

42

Copyright © 2016 by International Business Machines Corporation (IBM). No part of this document may be reproduced or transmitted in any form without written permission from IBM.

U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM.

Information in these presentations (including information relating to products that have not yet been announced by IBM) has been reviewed for accuracy as of the date of initial publication and could include unintentional technical or typographical errors. IBM shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT OR LOSS OF OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the agreements under which they are provided.

Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without notice.

Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary.

References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which IBM operates or does business.

Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not necessarily reflect the views of IBM. All materials and discussions are provided for informational purposes only, and are neither intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation.

It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal counsel as to the identification and interpretation of any relevant laws and regulatory requirements that may affect the customer’s business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or represent or warrant that its services or products will ensure that the customer is in compliance with any law

Page 43: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

Notices and Disclaimers Con’t.

43

Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products in connection with this publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

The provision of the information contained h erein is not intended to, and does not, grant any right or license under any IBM patents, copyrights, trademarks or other intellectual property right.

IBM, the IBM logo, ibm.com, Aspera®, Bluemix, Blueworks Live, CICS, Clearcase, Cognos®, DOORS®, Emptoris®, Enterprise Document Management System™, FASP®, FileNet®, Global Business Services ®, Global Technology Services ®, IBM ExperienceOne™, IBM SmartCloud®, IBM Social Business®, Information on Demand, ILOG, Maximo®, MQIntegrator®, MQSeries®, Netcool®, OMEGAMON, OpenPower, PureAnalytics™, PureApplication®, pureCluster™, PureCoverage®, PureData®, PureExperience®, PureFlex®, pureQuery®, pureScale®, PureSystems®, QRadar®, Rational®, Rhapsody®, Smarter Commerce®, SoDA, SPSS, Sterling Commerce®, StoredIQ, Tealeaf®, Tivoli®, Trusteer®, Unica®, urban{code}®, Watson, WebSphere®, Worklight®, X-Force® and System z® Z/OS, are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.

Page 44: IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming

ServerlessConf London 2016

Thank You