2. @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.
3. @csantanapr
Sometimes Servers let us down
• HARD DRIVE FAILS
• LINUX OS VULNERABILTY
• MIDDLEWARE VERSION UPDATE
• MORE MEMORY AND BIGGER CPU
• ….
4. @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
21. @csantanapr
Programming Model
A Action:
A stateless, relatively short-running
function invoked as an event handler.
AJSON Object JSON Object
Input Output
Stateless Function
22. @csantanapr
Programming Model
A function main(params) {
console.log(“Hello “ + params.name);
return { msg: “Goodbye “ + params.name) };
}
OpenWhisk supports Node.js 6
23. @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.
24. @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.
OpenWhisk
Serverless
Platform
25. @csantanapr
Programming Model
R Rule:
T A
Trigger
(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.
26. @csantanapr
Execution Model
Pool of actions
Swift DockerJS
Trigger
1
Running
action
Running
action
Running
action
3
OpenWhisk
Engine
2 A
T
AAA
28. @csantanapr
REST Microservices
Send HTTP request
HTTP GET
app.com/customers
1
Invoke OpenWhisk
action get-customers
Browser
Mobile App
Web App
2
JS Swift Docker …
OpenWhisk
API
Proxy
29. @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
30. @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
32. @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
36. @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
In this transition to cloud native application development, the management of decomposed containerized applications has brought new operational concerns.
Google released a study in July 2013, average utilization rates for 20,000 server clusters for three months.
Find typical cluster spent most of its time running between 20-40 percent of capacity.
That’s your money that’s better used. Spent on servers which are doing nothing.
…
Like having the water tap on all the time.
Over the past ten years we’ve seen a steady improvement how fast developers can create and deploy applications to production.
Starting with the moment that service providers matched virtualized resources with self service APIs, speed has been accelerating.
Recently we’ve seen the shift from IaaS to PaaS, where developers concern themselves only with their apps and data.
And now, we’ve seen the rise of Functions as a Service programming.
Thoughout this shift the developer has narrowed his focus purely on business value, and lost site of more and more operational concerns, hence the term serverless.
Shrunk unit of deployment.
Focus on deploy small micro services, comprised of just a few functions, 100s lines of code.
Not whole application.
Platform starts new instances for each request. Don’t have instances running doing nothing.
Don’t even have to think about servers? Implement interface.
application designers can count on unlimited capacity of the platform to instantiate as many or as few functions as requested.
Extreme speed means what happens if you get another request whilst your function is running?
Start another one! Don’t have to predict traffic load.Scaling is free and automatic.
microservice deployments and for applications with highly variable capacity requirements.
Serverless is not designed for every usecase. Legacy HR payroll system. Modern application designed for the cloud.
Enforce this architectural style through compute limits….
FaaS functions are stateless
Execution Duration
Startup Latency
Memory/Allocation Allocation
RELIANT ON SERVER TOOLS. Instrument, measure
Open-source can help.
LOGGING. Ensure logs are good.
Testing, unit testing is easy, integration testing is hard.
OpenWhisk == open source.
Deploying one application to one hundred micro services concurrently.
Deploy, version, fallback. Micro services come with complexity. Distributed computing is hard.
Evaluate whether faaS event-driven architecture is a good fit for their applications and their team's development skills.
Frameworks to help manage deployments.
Serverless framework most popular. Working on Openwhisk support.
Multi-vendor
….
OpenWhisk is open-source. Announced in February, open-source the platform at the same time.
Lot of people using serverless are very concerned about “vendor-lockin”.
If you visit github.com/openwhisk access to the entire platform.
Uses standard cloud-scale open-source components like Apache Kafka, Consul, Docker.
Team continues to develop in the open. Milestones, raise tickets, browse documentation.
Submit pull-requests.
Which means you can have a full server less platform running on your laptop with three commands..
Vagrant file to set up the VM running the platform services using Docker.
Running locally in minutes.
but if you don’t feel like running it yourself, sign-up for a free account on IBM Bluemix.
Hosted OpenWhisk platform.
Currently in beta, which means they are no charges!
Dashboard and visual code editor. Tooling.
Discover dark data in videos with IBM Watson and IBM Bluemix OpenWhisk
Dark Vision processes videos to discover dark data. By analyzing video frames with IBM Watson Visual Recognition, Dark Vision builds a summary with a set of tags and famous people or building detected in the video. Use this summary to enhance video search and categorization.
Skylink is a sample application that connects drones to the cloud with near realtime image analysis leveraging IBM Cloudant, OpenWhisk, IBM Watson, and IBM Bluemix.
Skylink is a sample application that lets you connect a DJI drone aircraft to the IBM Cloud with near realtime image analysis leveraging IBM Cloudant, OpenWhisk, IBM Watson, and Alchemy Vision.
The Logistics Wizard is an end-to-end, smart supply chain management solution that showcases how to execute hybrid cloud, microservices, and predictive data analytics in the real world.
Logistics Wizard is a reimagined supply chain optimization system for the 21st century.
A number of companies use on-premises applications to run their supply chain business processes. Enterprise Resource Planning systems are often one of them and play a critical role in the daily operations.
Take some inspiration from some of the the apps that people have built using OpenWhisk, play with them learn and have fun