Apache OpenWhisk on IBM Bluemix provides a powerful and flexible environment for deploying cloud-native applications driven by data, message, and API call events. Learn why serverless architectures are attractive for many emerging cloud workloads and when you should consider OpenWhisk for your next project. Then get started on Bluemix with three sample applications covering how the OpenWhisk programming model enables you both to implement REST APIs and process non-HTTP events at scale.
2. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Increasingfocusonbusinesslogic
Decreasing concern (and control) over stack implementation
Bare Metal
VM VM
VM
Virtual machines
Functions
Containers
Serverless developers focus more on code, less on infrastructure
3. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Monolithic
Application
Break-down into
microservices
Make each
microservice HA
Protect against
regional outage
Region A
Region B
Microservices can be hard to manage at scale
4. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Emerging workloads are a good fit for event-driven programming
Execute logic in response to database change
Perform analytics on sensor input messages
Provide cognitive computing via chatbots
Schedule tasks performed for a short time
Invoke autoscaled APIs and mobile backends
5. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Memory
allocated
(MB)
Time executing
(milliseconds)
Instances
executing
simultaneously
(count)
Cloud resource cost
better matches
business value gained
Not a silver bullet, but this can result in
substantial savings for many workloads
New cost models more accurately charge for usage
6. IBM Bluemix Apache OpenWhisk@Joe_Sepi
OpenWhisk is a
cloud platform that
executes code in
response to events
OpenWhisk enables these serverless, event-driven workloads
Provides serverless deployment and operations model
Runs code only on-demand on a per-request basis
Optimized utilization, fine-grained metering at any scale
Flexible, extensible, polyglot programming model
Open source and open ecosystem (Apache Incubator)
Ability to run in public, private, and hybrid models
7. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Results
Developers work with packages, triggers, actions, and rules
Package
(feed)
Packages provide integration
with external event sources
P
Trigger
(event)
T
Data sources define events
they emit as Triggers
Rule (map)R
Action
(function)
A
Developers map Actions
to Triggers via Rules
8. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Apache
Incubator
OpenWhisk is built on solid open source foundations
9. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Bluemix provides management, tooling, and monitoring
10. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Bluemix provides management, tooling, and monitoring
11. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Bluemix provides management, tooling, and monitoring
12. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Sign up for an account at bluemix.net, then download CLI
14. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Developers work with triggers, actions, rules, and packages
Data sources define events
they emit as Triggers.
Developers map Actions to
Triggers via Rules.
Packages provide integration
with external services.
T
A
P
R
15. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Triggers
A class of events that can occurT
Social events
Data changes
Device readings Location updates
User input
16. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Actions
Code that runs in response to an event
(that is, an event handler)
A
17. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Actions
Can be written in a variety of languages, such as
JavaScript, Python, Java, and Swift
A
function main(params) {
return { message: 'Hello, ' + params.name + ' from ' + params.place };
};
18. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Actions
Or any other language by packaging with DockerA
19. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Actions
Can be composed to create sequences
that increase flexibility and foster reuse
A
AA := A1 + A2 + A3
AB := A2 + A1 + A3
AC := A3 + A1 + A2
20. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Rules
An association of a trigger to an action
in a many to many mapping.
R
R := T A
21. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Packages
A shared collection of triggers and actionsP
A
A read
write
T changes A translate A forecast
A post
T topic
Open
Source A myAction
T myFeed
Yours
T commit
Third
Party
24. IBM Bluemix Apache OpenWhisk@Joe_Sepi
The OpenWhisk execution model
Pool of actions
Swift DockerJS
Trigger
1
Running
action
Running
action
Running
action
3
OpenWhisk
Engine
2 A
T
AAA
25. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Demo 1: Your first trigger, action, and rule
$ wsk action create handler handler.js
github.com/IBM/openwhisk-action-trigger-rule
$ wsk action invoke --blocking handler
$ wsk trigger create every-20-seconds
--feed /whisk.system/alarms/alarm
--param cron "*/20 * * * * *"
--param maxTriggers 30
$ wsk action invoke --blocking handler
$ wsk rule create
invoke-periodically
every-20-seconds
handler
Trigger
1
Running
action
2
T
A
1. Cron syntax alarm
2. Log the current time
27. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Demo 3: HTTP API request triggered action
github.com/IBM/openwhisk-rest-api-trigger
28. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Other sample applications
github.com/openwhisk/awesome-openwhisk
Project OpenFridge:
Improving customer service
with event driven IoT
Project OpenChecks
github.com/openwhisk/awesome-openwhisk
github.com/apache/incubator-openwhisk-external-resources
29. IBM Bluemix Apache OpenWhisk@Joe_Sepi
Managed service on
IBM Bluemix
bluemix.net/openwhisk
Delivered as
Open source via Apache
openwhisk.org
Get started on Bluemix, or explore the open source project
github.com/openwhisk
slack.openwhisk.org
twitter.com/openwhisk
medium.com/openwhisk
30. IBM Bluemix Apache OpenWhisk@Joe_Sepi
See more sample apps on GitHub
github.com/ibm
Reach out to us team
developer.ibm.com/code/work-with-us
Or, work with an IBM Code developer advocate