Upload
openwhisk
View
431
Download
1
Embed Size (px)
Citation preview
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
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.
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
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)
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/
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
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
OpenWhisk in a nutshell
Serverless deployment & operations model
Optimal utilization & granular pricing
Scales on a per-request basis
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
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
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.
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*
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
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
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
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
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
Some usage Scenarios
• Microservices-based apps / APIs
• Mobile Backends
• Data (Stream) Processing
• IoT
• Cognitive
• Bots
Real-world customer scenario
OpenWhisk: Topology in OpenSource
20
Controller
…Invoker InvokerInvoker
Cloudant
OpenWhisk: Topology in Bluemix
21
ELK-Stack
soon
Controller
Integration Service
soon
…InvokerInvokerInvoker
Monitoring
soon
OpenWhisk: Usage of Docker
• Isolation of actions• Control over consumed resources of each container
22
A =wsk action invoke docker run
≈
OpenWhisk: Container startup
23
Start containerdocker run
Initialize/init
Run/run
cold container
Start containerdocker run
Initialize/init
Run/run
OpenWhisk: Container startup
24
pre-warmed container
Start containerdocker run
Initialize/init
Run/run
OpenWhisk: Container startup
25
warm container
OpenWhisk: Container startup optimization
• Performance is king.
26
cold container pre-warmed container warm container
faster
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
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
Programming model
Debugging actions*A
* work in progress
https://github.com/openwhisk/openwhisk-debugger
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
Programming model
Rules: „An association of a trigger and an action“R
R := T A
Event & Action Providers
OpenSource
ThirdParty
Yours
PushNotifications
webhook
A
forecast
translatelanguageId
textToSpeech
changes
T
sendMessage
databaseCreatedocumentRead
...
Websocket send
webhook
post
myAction myFeed
A T
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
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)
Live demo
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
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/
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
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
Learn more
• OpenWhisk past and upcoming eventshttps://developer.ibm.com/openwhisk/events/
Questions?
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
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.
ServerlessConf London 2016
Thank You