Learn more about the IBM Bluemix OpenWhisk, a serverless event-driven compute platform, which quickly executes application logic in response to events or direct invocations from web/mobile apps or other endpoints.
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of Cloud Programming
1. 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
2. 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.
3. 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
4. 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)
5. 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/
6. OpenWhisk: Comparison to traditional models
Swift
Application
Container VMCF
22
Polling
1b1b
Request
1a1a
• 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
7. 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
11
Running
action
Running
action
Running
action
33
Deploy action within millisecs,
run it,
free up resources
OpenWhisk
Engine
22 Pool of actions
Swift DockerJS Python
Java
*
* work in progress
8. OpenWhisk in a nutshell
Serverless deployment & operations model
Optimal utilization & granular pricing
Scales on a per-request basis
9. OpenWhisk in a nutshell
Flexible programming model
Support for different invocation models
Blocking, non-blocking, periodic
Polyglot support
Support for multiple runtimes: JS/NodeJS, Swift, Python, Java*, Docker
Community efforts: Go, Haskell, Scala, …
Supports higher-level programming constructs
Parameter binding
Chaining/sequencing
Debugging*
* work in progress
10. OpenWhisk in a nutshell
Open engine & open event emitter/consumer ecosystem
Open interface for event emitters
Implemented in Scala & implemented based upon open technologies
Docker, Kafka, Consul, …
Community efforts to integrate with open tools
Serverless Framwork*, VS Code, NodeRED, Jupyter Notebooks , …
Apache Incubator proposal is out!
Submitted jointly with partners!
* work in progress
11. 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.
12. OpenWhisk: How does it work?
* work in progress
}
11
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
22
Swift DockerJS Python Java*
13. OpenWhisk: How does it work?
Incoming HTTP request, e.g. HTTP GET
openwhisk.ng.bluemix.net/api/v1/<namespace>/actions/getCustomers
11
Browser
Mobile App
Web App
OpenWhisk
22 Invoke associated
OpenWhisk action
„getCustomers“
Swift DockerJS Python Java*
Variety of
languages
Variety of
languages
* work in progress
14. 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
11
Browser
Mobile App
Web App
22
OpenWhisk
33 Invoke associated
OpenWhisk action
“getCustomers“
Swift DockerJS Python Java*
* work in progress
15. 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
11
Browser
Mobile App
Web App
22
OpenWhisk
33 Invoke associated
OpenWhisk action
„getCustomers“
Swift DockerJS Python Java*
* work in progress
16. 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” }
11
Browser
Mobile App
Web App
22
OpenWhisk
33 Invoke associated
OpenWhisk action
„getCustomers“
Swift DockerJS Python Java*
* work in progress
Incoming HTTP request, e.g. HTTP GET
api-gw.mybluemix.net/…/getCustomers
17. OpenWhisk architecture
Trigger
Package
Feed
Package
Feed
Package
Feed
Package
Feed
REST
CLI iOS SDK
CRUD triggers, actions, and rules
Invoke 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
18. Some usage Scenarios
• Microservices-based apps / APIs
• Mobile Backends
• Data (Stream) Processing
• IoT
• Cognitive
• Bots
27. 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
TT RR AA
28. Programming model
Debugging actions*AA
• Allows to…
– debug actions locally
– inspect parameter values
– edit code & push changes
• Supports debugging…
– NodeJS, Python and Swift actions
* work in progress
30. Programming model
Actions: Can be chained to create sequences to increase flexibility and
foster reuse
AA
AA
AA := A1
A1 + A2
A2 + A3
A3
AB
AB := A2
A2 + A1
A1 + A3
A3
AC
AC := A3
A3 + A1
A1 + A2
A2
32. Event & Action Providers
Open
Source
Third
Party
Yours
Push
Notifications
webhook
AA
forecast
translate
languageId
textToSpeech
changes
TT
sendMessage
databaseCreate
documentRead
...
Websocket send
webhook
post
myAction myFeed
AA TT
33. 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
34. 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)
36. 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
37. 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/
38. Learn more
• OpenWhisk Developer Center (focuses on our open-source project)
https://developer.ibm.com/openwhisk/
• OpenWhisk Blog
https://developer.ibm.com/openwhisk/blogs/
• OpenWhisk on Github
https://github.com/openwhisk/openwhisk/
• OpenWhisk official documentation on Github
https://github.com/openwhisk/openwhisk/blob/master/docs/README.md
39. Learn more
• OpenWhisk on Twitter
https://twitter.com/openwhisk
• OpenWhisk on Slack
https://dwopen.slack.com (channel: openwhisk)
To join go here:
http://slackindwo.mybluemix.net/
• OpenWhisk additional material on Slideshare
http://www.slideshare.net/OpenWhisk
• OpenWhisk additional material on Youtube
https://www.youtube.com/channel/UCbzgShnQk8F43NKsvEYA1SA
• Other OpenWhisk material
https://github.com/openwhisk/awesome-openwhisk
40. Learn more
• OpenWhisk past and upcoming events
https://developer.ibm.com/openwhisk/events/
43. 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.