openwhisk: where did my servers go?
TRANSCRIPT
![Page 2: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/2.jpg)
@csantanapr
What you will learn
• How cloud computing has recently evolved to enable developers to write cloud native applications better, faster, and cheaper using serverless technology.
• How OpenWhisk provides an open source platform to enable cloud native, serverless, event driven applications.
![Page 3: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/3.jpg)
@csantanapr
Sometimes Servers let us down
• HARD DRIVE FAILS• LINUX OS VULNERABILTY• MIDDLEWARE VERSION UPDATE• MORE MEMORY AND BIGGER CPU• ….
![Page 4: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/4.jpg)
@csantanapr
Scaling takes effort
Explosion in number of containers / processes:
1. Increase of infrastructure cost footprint
2. Increase of operational management cost and complexity
Region BRegion A
Break-down into microservices
Make each micro service HA
Protect against regional outages
Monolithic application
![Page 5: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/5.jpg)
@csantanapr
Utilization
Average Utilization20% - 40%of capacity
![Page 6: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/6.jpg)
@csantanapr
Cloud Evolution
Bare metal
Virtual machines
Containers
PaaSFunctions
Decreasing concern (and control) over stack implementation
Incr
easi
ng fo
cus
on b
usin
ess
logi
c
![Page 7: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/7.jpg)
@csantanapr
Function-as-a-Service
![Page 8: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/8.jpg)
@csantanapr
SCALING: 0 to N
![Page 9: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/9.jpg)
@csantanapr
Pay as you go
![Page 10: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/10.jpg)
@csantanapr
Plenty of Providers
![Page 11: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/11.jpg)
@csantanapr
Compute Limits
flickr photo by zund https://flickr.com/photos/zund/12202485675 CC (BY-NC-ND) license
![Page 12: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/12.jpg)
@csantanapr
Debug/Test/Monitor
flickr photo by Thomas Hawk https://flickr.com/photos/thomashawk/4544013443 CC (BY-NC) license
![Page 13: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/13.jpg)
@csantanapr
Deployment Complexity
![Page 14: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/14.jpg)
@csantanapr
Frameworks
![Page 15: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/15.jpg)
@csantanapr
Isn’t this Paas?
![Page 16: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/16.jpg)
@csantanapr
OpenWhisk
OpenWhisk is a cloud platform that executes code
in response to events
OpenWhisk
![Page 17: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/17.jpg)
@csantanapr
OpenWhisk Use CasesServerless Web Application
Serverless Mobile Backend
Real-time data processing
Real-time Chatbot messaging
Scheduled Jobs
![Page 18: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/18.jpg)
@csantanapr
OpenWhisk = open source
![Page 19: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/19.jpg)
@csantanapr
Running locally
$ git clone github.com/openwhisk/openwhisk
$ cd openwhisk/tools/vagrant
$ ./hello
![Page 20: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/20.jpg)
@csantanapr
IBM Bluemix OpenWhisk
![Page 21: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/21.jpg)
@csantanapr
Programming Model
A Action:
A stateless, relatively short-running function invoked as an event handler.
AJSON Object JSON Object
Input OutputStateless Function
![Page 22: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/22.jpg)
@csantanapr
Programming Model
A function main(params) { console.log(“Hello “ + params.name); return { msg: “Goodbye “ + params.name) };}
OpenWhisk supports Node.js 6
![Page 23: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/23.jpg)
@csantanapr
Programming Model
:=
A Action Sequence:
An Action that is a sequenced composition of 2 or more existing Actions.
Note: This composition technique allows the reuse of existing action implementations treating them as “building blocks” for other Actions.
![Page 24: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/24.jpg)
@csantanapr
Programming Model
24
Trigger:
Note: In a pub-sub system, a trigger could be viewed as a message topic.
The name for a class of events. Triggers represent the events (and their data) themselves without any concept of how they were generated.
OpenWhiskServerlessPlatform
![Page 25: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/25.jpg)
@csantanapr
Programming Model
R Rule:
T ATrigger(Event)
Action(Event handler)
Rule(conditional logic)
A mapping from a Trigger to an Action which may contain simple conditional logic.
Note: OpenWhisk evaluates incoming events (that belong to a Trigger) and invokes the assigned Action (event handler) associated by the Rule.
![Page 26: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/26.jpg)
@csantanapr
Execution Model
Pool of actions
Swift DockerJS
Trigger1
Running action
Running action
Running action
3
OpenWhisk Engine
2 A
T
AAA
![Page 27: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/27.jpg)
@csantanapr
Event Driven
Event Providers
Cloudant
GitHub
Weather
…
Which triggers execution of
associated OpenWhisk action
2
SlackJS Swift Docke
r …
An event occurs, for example• Commit pushed to GitHub
repository • Data changed in Cloudant
1 OpenWhisk
![Page 28: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/28.jpg)
@csantanapr
REST Microservices
Send HTTP requestHTTP GET
app.com/customers
1
Invoke OpenWhisk action get-customers
Browser
Mobile App
Web App
2
JS Swift Docker …
OpenWhisk
API Proxy
![Page 29: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/29.jpg)
@csantanapr
Under the hood
Couch DB
Consul
Router (NGINX)
Controller
Kafka
Invoker Invoker
Docker
Executor
Executor
Docker
Java Swift
Executor
Executor
NodeJS Python
1. Router receives request to API via CLI or UI
2. Controller checks entitlement and dispatches requests to Kafka
3. Invokers pull requests from CouchDB and start execution of the action
![Page 30: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/30.jpg)
@csantanapr
Under the hood: Deep look
bit.ly/ow-int
1. Entering the system: nginx
2. Really entering the system: Controller
3. Authentication and Authorization: CouchDB
4. Getting the action: CouchDB… again
5. Who’s there to invoke the action: Consul
6. Please form a line: Kafka
7. Actually invoking the code already: Invoker
8. Storing the results: Yes… CouchDB again
![Page 31: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/31.jpg)
@csantanapr
Slack Bot
bit.ly/ow-demo-2GET /register
POST /command
POST /event
Register action
Event action
Command action
2
OpenWhisk Engine
1
AAA
API Proxy
Register the bot
Respond to direct messages
Respond to slash commands
![Page 32: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/32.jpg)
@csantanapr
Smart home IoT, Banking
github.com/openwhisk/awesome-openwhisk
Project OpenFridge: Improving customer service with event driven IoT
Project OpenChecks: Mobile check deposit with optical character recognition
![Page 33: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/33.jpg)
@csantanapr
DarkVision
https://github.com/IBM-Bluemix/openwhisk-darkvisionapp
![Page 34: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/34.jpg)
@csantanapr
Skylink
https://github.com/IBM-Bluemix/skylink
![Page 35: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/35.jpg)
@csantanapr
Logistics Wizard
https://github.com/IBM-Bluemix/logistics-wizard
![Page 36: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/36.jpg)
@csantanapr
Learning is Fun
• DarkVision• Skylink• Open Checks• Open Fridge• Logistic Wizard• IOT data-in-motion• Slack invite• QR Generator• Blog Nag• Just Follow You• Slack Bot• Jekyll Publisher
![Page 37: OpenWhisk: Where Did My Servers Go?](https://reader035.vdocuments.site/reader035/viewer/2022062522/58ce9e081a28abb26e8b49c3/html5/thumbnails/37.jpg)
@csantanapr
Join Us!
github.com/openwhisk
@OpenWhisk
bluemix.net/openwhisk
slack.openwhisk.org
StackOverflow tagged =>openwhisk
Openwhisk.org