SlideShare a Scribd company logo
Going ‘Serverless’ with OpenWhisk
Alex Glikson
Cloud Platforms, IBM Research
glikson@il.ibm.com
Haifa Cloud Meetup
February 7, 2017
https://www.meetup.com/Haifa-Cloud/events/236843362/
Outline
1. Overview of Serverless
2. OpenWhisk – open source ‘Serverless’ platform
3. Challenges of Serverless
1
Serverless in a Nutshell
• ‘Next-gen’ PaaS (developers just write the business logic)
• for ETL-style services decomposable into event sources
(e.g., stateful/persistent services) triggering stateless handlers
• scaled, metered [and charged] by individual handler invocation
The motivation behind the ‘serverless’ term is that the application provider doesn’t need
to care about managing the underlying servers
(pioneered by Amazon, who didn’t have fully managed PaaS offering before Lambda)
2
analyze
reading
OpenWhisk
create
order
alert
customer
alarm
changes changes
service order appliance
events
IBM
Watson
IoT
Example: bit.ly/open-fridge
@ Daniel Krook
Serverless Market
• Amazon Lambda
– Pioneer of serverless, launched in Nov 2014
– Rapid growth, dedicated mini-con at Re:Invent 2016
• Similar offerings by other commercial cloud providers
– Google Functions, Azure Functions, IBM OpenWhisk
• Multiple niche players, rapidly growing ecosystem
– iron.io, pubnub.com, etc
• OpenWhisk – the open source serverless platform
– Developed by IBM, now under incubation in Apache (w/Adobe)
– Also offered on IBM Bluemix as a fully managed service
4
Serverless: Why Now? The Perfect Storm
5
Serverless
PaaS Evolution
Developers enjoy the ‘low touch’
experience, but scaling is a challenge
Event-Driven Use-Cases
More application can be architected
as a collection of events and handlers
Containers Maturity
Technologies for fine-grained
sandboxing become mainstream
API Economy
Proliferation of RESTful, composable
(micro)services, often charged by API call
Image: http://bobkaylor.typepad.com/bob_kaylor/2012/01/the-meaning-of-jesus-part-2-the-perfect-storm.html
OpenWhisk:
Open Source Serverless Platform
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
API Gateway
OpenWhisk Tenets:
• Fully open (source, dev, community, ecosystem)
• Extensible (feeds, actions, packages)
• Polyglot (JS, Python, Swift, Java, *any*/docker)
• Composable (e.g., sequences)
• Per-event/request scaling, metering
http://openwhisk.org/
OpenWhisk Internal Architecture
7
Controller
…Invoker InvokerInvoker
OpenWhisk Catalog
• Cron
• Utils (e.g., jq)
• CouchDB/Cloudant
• Object Storage
• MQTT
• Kafka
• Node-RED
* Some of the above are work in progress
8
 Github
 Slack
 IBM Watson
 Weather
 WebHooks
 Mobile Push
 etc
OpenWhisk and API Gateway
• 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” }
1
Browser
Mobile App
Web App
APIGateway
2
OpenWhisk
3 Invoke associated
OpenWhisk action
„getCustomers“
Swift DockerJS Python Java
Incoming HTTP request, e.g. HTTP GET
api-gw.mybluemix.net/…/getCustomers
- API Gateway takes care of…
- security (authenticate, authorize, threat protect, validate)
- control (rate limiting, response caching)
- mediation
- parameter mapping
- schema validation
- etc
Example: Monitoring Github comments
• Goals:
1. Watch for new comments in a given github.com repository
2. Save github.com events in a DB in Bluemix
3. Provide REST API to access data in the DB (e.g., aggregate stats)
10
glikson/meetup/issues/1
cloudant/
create-document
cloudant/
list-documents
issue_comment
meetup
prepGh2Db
writeToDb
API Gateway
/meetup/v1/count
totalRows
Example: monitoring Github comments
11
glikson/meetup/issues/1
cloudant/
create-document
cloudant/
list-documents
issue_comment
meetup
prepGh2Db
writeToDb
API Gateway
/meetup/v1/count
totalRows
Example: monitoring Github comments
12
glikson/meetup/issues/1
cloudant/
create-document
cloudant/
list-documents
issue_comment
meetup
prepGh2Db
writeToDb
API Gateway
/meetup/v1/count
totalRows
Getting started with OpenWhisk in Bluemix
Click here and run your first action in 30 secs:
https://console.ng.bluemix.net/openwhisk/
Associate an action
with event triggers:
Challenges of Serverless
• Opinionated programming model
– Aligned with 12-factor approach to cloud-native applications
• Per-handler resource allocation limits
• Per-invocation latency & overhead
• Lack of high-performance persistent state
• Ability to reuse and share handler functions (‘marketplace’)
• Lifecycle management of composite serverless applications
• Monitoring, error handling, testing, debugging
14
QUESTIONS?
Alex Glikson
Cloud Platforms, IBM Research
glikson@il.ibm.com
OpenWhisk Debugger
(https://github.com/openwhisk/openwhisk-debugger )
• Allows to…
– debug actions locally
– inspect parameter values
– edit code & push changes
• Supports debugging…
– NodeJS, Python and Swift actions
OpenWhisk on OpenStack
https://developer.ibm.com/openwhisk/2016/08/08/multicloud-openwhisk-build-a-distributed-openwhisk-deployment-on-openstack/
17
The Essence of Serverless
• What is Serverless?
–‘Serverless’ is a cloud-native design pattern, accompanied with a
programming model and a runtime architecture
–Aimed at radically simplified, faster and more efficient
development and operation of (certain) applications
• The Pattern
–Application is architected a set of ‘business logic’ functions, local
or remote, triggered by discrete events or requests
–The underlying runtime is (infinitely) elastic, with scaling (and
chargeback) granularity of single function invocation (100ms)
–Each local function is invoked in a sandbox, which is short-lived
and ephemeral (interacting with stateful services)
18
What is serverless good for?
19
Example: Serverless at Thomson Reuters
20
https://www.portal.reinvent.awsevents.com/connect/sessionDetail.ww?SESSION_ID=8674
Example: Serverless at Bustle
21
https://aws.amazon.com/solutions/case-studies/bustle/
Example: Serverless at Expedia
22
https://www.portal.reinvent.awsevents.com/connect/sessionDetail.ww?SESSION_ID=8671
Example: Serverless at Expedia
23
https://www.portal.reinvent.awsevents.com/connect/sessionDetail.ww?SESSION_ID=8671
OpenWhisk CLI: Create and test action
Create the Action that analyzes IoT readings, then stores in the database
wsk action create analyze-service-event analyze-service-event.js 
--param cloudant_user $CLOUDANT_USER 
--param cloudant_pass $CLOUDANT_PASS
Invoke the Action manually with sample message data to test
wsk action invoke --blocking --result analyze-service-event
--param service '{ 
"appliance_serial": "xxxxyyyyzzzz", 
"part_number": "ddddeeeeffff", 
"reading": 13, 
"timestamp": 1466188262}'
OpenWhisk CLI: Link trigger to action
Create the Trigger that subscribes to an MQTT topic pattern
wsk trigger create openfridge-feed-trigger 
--feed mqtt/mqtt-feed-action
--param topic 'iot-2/type/+/id/+/evt/+/fmt/json'
--param url 'ssl://example.messaging.internetofthings.ibmcloud.com:8883’
Link the Trigger to the Action using a Rule
wsk rule create --enable openfridge-feed-rule 
openfridge-feed-trigger analyze-service-event
Serverless check processing with OpenWhisk
https://github.com/krook/openchecks
Serverless can handle many cloud native app 12 Factors
I Codebase Handled by developer (Manage versioning of functions on their own)
II Dependencies Handled by developer, facilitated by serverless platform (Runtimes and packages)
III Config Handled by platform (Environment variables or injected event parameters)
IV Backing services Handled by platform (Connection information injected as event parameters)
V Build, release, run Handled by platform (Deployed resources are immutable and internally versioned)
VI Processes Handled by platform (Single stateless containers often used)
VII Port binding Handled by platform (Actions or functions are automatically discovered)
VIII Concurrency Handled by platform (Process model is hidden and scales in response to demand)
IX Disposability Handled by platform (Lifecycle is hidden from the user, fast startup and elastic scale is prioritized)
X Dev/prod parity Handled by developer (The developer is the deployer. Scope of what differs is narrower)
XI Logs Handled by platform (Developer writes to console.log, platform handles log streaming)
XII Admin processes Handled by developer (No distinction between one off processes and long running)

More Related Content

PDF
The Serverless Paradigm, OpenWhisk and FIWARE
PDF
OpenWhisk Deep Dive: the action container model
PDF
OpenWhisk Under the Hood -- London Oct 16 2016
PPT
OpenWhisk Introduction
PDF
OpenWhisk - A platform for cloud native, serverless, event driven apps
PDF
Serverless apps with OpenWhisk
PPTX
Cloud Native Architectures with an Open Source, Event Driven, Serverless Plat...
PDF
OpenWhisk - Serverless Architecture
The Serverless Paradigm, OpenWhisk and FIWARE
OpenWhisk Deep Dive: the action container model
OpenWhisk Under the Hood -- London Oct 16 2016
OpenWhisk Introduction
OpenWhisk - A platform for cloud native, serverless, event driven apps
Serverless apps with OpenWhisk
Cloud Native Architectures with an Open Source, Event Driven, Serverless Plat...
OpenWhisk - Serverless Architecture

What's hot (20)

PPTX
OpenWhisk: Event-driven Design
PPT
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...
PDF
Build a cloud native app with OpenWhisk
PPTX
IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Fut...
PPT
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
PDF
How to build a Distributed Serverless Polyglot Microservices IoT Platform us...
PDF
Serverless in production (O'Reilly Software Architecture)
PDF
ADDO 2020: "The past, present, and future of cloud native API gateways"
PDF
Building serverless applications with Apache OpenWhisk and IBM Cloud Functions
PPTX
2015 03-11_todd-fritz_devnexus_2015
PDF
Serverless architectures built on an open source platform
PPTX
All Things Open : Crash Course in Open Source Cloud Computing
PDF
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
PDF
Serverless APIs with Apache OpenWhisk
PDF
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
PDF
Building serverless applications with Apache OpenWhisk
PDF
GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"
PPTX
OpenWhisk on IBM Bluemix for the Industrial Internet
PDF
IBM Bluemix OpenWhisk: Serverless Conference 2017, Austin, USA: Keynote
PDF
Containers vs serverless - Navigating application deployment options
OpenWhisk: Event-driven Design
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...
Build a cloud native app with OpenWhisk
IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Fut...
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
How to build a Distributed Serverless Polyglot Microservices IoT Platform us...
Serverless in production (O'Reilly Software Architecture)
ADDO 2020: "The past, present, and future of cloud native API gateways"
Building serverless applications with Apache OpenWhisk and IBM Cloud Functions
2015 03-11_todd-fritz_devnexus_2015
Serverless architectures built on an open source platform
All Things Open : Crash Course in Open Source Cloud Computing
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
Serverless APIs with Apache OpenWhisk
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
Building serverless applications with Apache OpenWhisk
GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"
OpenWhisk on IBM Bluemix for the Industrial Internet
IBM Bluemix OpenWhisk: Serverless Conference 2017, Austin, USA: Keynote
Containers vs serverless - Navigating application deployment options
Ad

Viewers also liked (10)

PDF
Service discovery like a pro (presented at reversimX)
PPTX
Corrientes económicas
PDF
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
PPT
IBM Bluemix Openwhisk
PDF
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
PDF
Making Sense of DevOps Tools: Open Source to Enterprise Solutions
PDF
State of serverless
PDF
IBM Bluemix Dedicated – GitHub Enterprise
PDF
Deploying to and Configuring WebSphere Application Server with UrbanCode Deploy
ODP
Google's Dremel
Service discovery like a pro (presented at reversimX)
Corrientes económicas
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
IBM Bluemix Openwhisk
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
Making Sense of DevOps Tools: Open Source to Enterprise Solutions
State of serverless
IBM Bluemix Dedicated – GitHub Enterprise
Deploying to and Configuring WebSphere Application Server with UrbanCode Deploy
Google's Dremel
Ad

Similar to Going Serverless with OpenWhisk (20)

PDF
The 'Serverless' Paradigm, OpenWhisk and FIWARE
PPTX
Serverless Apps with Open Whisk
PDF
Your Java Journey into the Serverless World
PDF
Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming...
PPTX
OpenWhisk JavaOne
PDF
Openwhisk - Colorado Meetups
PDF
Serverless Architectures in Banking: OpenWhisk on IBM Bluemix at Santander
PPTX
Your journey into the serverless world
PDF
IBM Bluemix OpenWhisk: IBM InterConnect 2017, Las Vegas, USA: Technical Strategy
PDF
Serverless forwardjs
PDF
NodeJS Serverless backends for your frontends
PDF
Introducing Cloud Native, Event Driven, Serverless, Micrsoservices Framework ...
PPTX
IBM Bluemix Paris Meetup #22-20170315 Meetup @VillagebyCA - Serverless & Open...
PDF
Apache OpenWhisk Serverless Computing
PDF
Apache OpenWhisk
ODP
Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...
ODP
Building serverless application on the Apache Openwhisk platform
PDF
Who needs containers in a serverless world
PDF
Serverless Java on Kubernetes
PDF
Developing Serverless Applications with Apache OpenWhisk
The 'Serverless' Paradigm, OpenWhisk and FIWARE
Serverless Apps with Open Whisk
Your Java Journey into the Serverless World
Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming...
OpenWhisk JavaOne
Openwhisk - Colorado Meetups
Serverless Architectures in Banking: OpenWhisk on IBM Bluemix at Santander
Your journey into the serverless world
IBM Bluemix OpenWhisk: IBM InterConnect 2017, Las Vegas, USA: Technical Strategy
Serverless forwardjs
NodeJS Serverless backends for your frontends
Introducing Cloud Native, Event Driven, Serverless, Micrsoservices Framework ...
IBM Bluemix Paris Meetup #22-20170315 Meetup @VillagebyCA - Serverless & Open...
Apache OpenWhisk Serverless Computing
Apache OpenWhisk
Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...
Building serverless application on the Apache Openwhisk platform
Who needs containers in a serverless world
Serverless Java on Kubernetes
Developing Serverless Applications with Apache OpenWhisk

More from Alex Glikson (8)

PDF
DevOpsDaysTLV24 - Spot Workload Optimization ML.pdf
PPTX
AWS Re:Invented
PPTX
Serverless Compute Platforms on Kubernetes
PPTX
From chroot to Docker to Kubernetes
PDF
Cloud-Native Application and Kubernetes
PDF
Mixing bare-metal and virtualized workloads on OpenStack - 2014
PPTX
Serverless, IoT and OpenWhisk
PDF
Container-Based Platforms and Kubernetes
DevOpsDaysTLV24 - Spot Workload Optimization ML.pdf
AWS Re:Invented
Serverless Compute Platforms on Kubernetes
From chroot to Docker to Kubernetes
Cloud-Native Application and Kubernetes
Mixing bare-metal and virtualized workloads on OpenStack - 2014
Serverless, IoT and OpenWhisk
Container-Based Platforms and Kubernetes

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
Approach and Philosophy of On baking technology
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Electronic commerce courselecture one. Pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation theory and applications.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Modernizing your data center with Dell and AMD
Approach and Philosophy of On baking technology
MYSQL Presentation for SQL database connectivity
Electronic commerce courselecture one. Pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
“AI and Expert System Decision Support & Business Intelligence Systems”
Machine learning based COVID-19 study performance prediction
Encapsulation_ Review paper, used for researhc scholars
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
NewMind AI Weekly Chronicles - August'25 Week I
Understanding_Digital_Forensics_Presentation.pptx
Unlocking AI with Model Context Protocol (MCP)
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation theory and applications.pdf

Going Serverless with OpenWhisk

  • 1. Going ‘Serverless’ with OpenWhisk Alex Glikson Cloud Platforms, IBM Research glikson@il.ibm.com Haifa Cloud Meetup February 7, 2017 https://www.meetup.com/Haifa-Cloud/events/236843362/
  • 2. Outline 1. Overview of Serverless 2. OpenWhisk – open source ‘Serverless’ platform 3. Challenges of Serverless 1
  • 3. Serverless in a Nutshell • ‘Next-gen’ PaaS (developers just write the business logic) • for ETL-style services decomposable into event sources (e.g., stateful/persistent services) triggering stateless handlers • scaled, metered [and charged] by individual handler invocation The motivation behind the ‘serverless’ term is that the application provider doesn’t need to care about managing the underlying servers (pioneered by Amazon, who didn’t have fully managed PaaS offering before Lambda) 2
  • 4. analyze reading OpenWhisk create order alert customer alarm changes changes service order appliance events IBM Watson IoT Example: bit.ly/open-fridge @ Daniel Krook
  • 5. Serverless Market • Amazon Lambda – Pioneer of serverless, launched in Nov 2014 – Rapid growth, dedicated mini-con at Re:Invent 2016 • Similar offerings by other commercial cloud providers – Google Functions, Azure Functions, IBM OpenWhisk • Multiple niche players, rapidly growing ecosystem – iron.io, pubnub.com, etc • OpenWhisk – the open source serverless platform – Developed by IBM, now under incubation in Apache (w/Adobe) – Also offered on IBM Bluemix as a fully managed service 4
  • 6. Serverless: Why Now? The Perfect Storm 5 Serverless PaaS Evolution Developers enjoy the ‘low touch’ experience, but scaling is a challenge Event-Driven Use-Cases More application can be architected as a collection of events and handlers Containers Maturity Technologies for fine-grained sandboxing become mainstream API Economy Proliferation of RESTful, composable (micro)services, often charged by API call Image: http://bobkaylor.typepad.com/bob_kaylor/2012/01/the-meaning-of-jesus-part-2-the-perfect-storm.html
  • 7. OpenWhisk: Open Source Serverless Platform 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 API Gateway OpenWhisk Tenets: • Fully open (source, dev, community, ecosystem) • Extensible (feeds, actions, packages) • Polyglot (JS, Python, Swift, Java, *any*/docker) • Composable (e.g., sequences) • Per-event/request scaling, metering http://openwhisk.org/
  • 9. OpenWhisk Catalog • Cron • Utils (e.g., jq) • CouchDB/Cloudant • Object Storage • MQTT • Kafka • Node-RED * Some of the above are work in progress 8  Github  Slack  IBM Watson  Weather  WebHooks  Mobile Push  etc
  • 10. OpenWhisk and API Gateway • 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” } 1 Browser Mobile App Web App APIGateway 2 OpenWhisk 3 Invoke associated OpenWhisk action „getCustomers“ Swift DockerJS Python Java Incoming HTTP request, e.g. HTTP GET api-gw.mybluemix.net/…/getCustomers - API Gateway takes care of… - security (authenticate, authorize, threat protect, validate) - control (rate limiting, response caching) - mediation - parameter mapping - schema validation - etc
  • 11. Example: Monitoring Github comments • Goals: 1. Watch for new comments in a given github.com repository 2. Save github.com events in a DB in Bluemix 3. Provide REST API to access data in the DB (e.g., aggregate stats) 10 glikson/meetup/issues/1 cloudant/ create-document cloudant/ list-documents issue_comment meetup prepGh2Db writeToDb API Gateway /meetup/v1/count totalRows
  • 12. Example: monitoring Github comments 11 glikson/meetup/issues/1 cloudant/ create-document cloudant/ list-documents issue_comment meetup prepGh2Db writeToDb API Gateway /meetup/v1/count totalRows
  • 13. Example: monitoring Github comments 12 glikson/meetup/issues/1 cloudant/ create-document cloudant/ list-documents issue_comment meetup prepGh2Db writeToDb API Gateway /meetup/v1/count totalRows
  • 14. Getting started with OpenWhisk in Bluemix Click here and run your first action in 30 secs: https://console.ng.bluemix.net/openwhisk/ Associate an action with event triggers:
  • 15. Challenges of Serverless • Opinionated programming model – Aligned with 12-factor approach to cloud-native applications • Per-handler resource allocation limits • Per-invocation latency & overhead • Lack of high-performance persistent state • Ability to reuse and share handler functions (‘marketplace’) • Lifecycle management of composite serverless applications • Monitoring, error handling, testing, debugging 14
  • 16. QUESTIONS? Alex Glikson Cloud Platforms, IBM Research glikson@il.ibm.com
  • 17. OpenWhisk Debugger (https://github.com/openwhisk/openwhisk-debugger ) • Allows to… – debug actions locally – inspect parameter values – edit code & push changes • Supports debugging… – NodeJS, Python and Swift actions
  • 19. The Essence of Serverless • What is Serverless? –‘Serverless’ is a cloud-native design pattern, accompanied with a programming model and a runtime architecture –Aimed at radically simplified, faster and more efficient development and operation of (certain) applications • The Pattern –Application is architected a set of ‘business logic’ functions, local or remote, triggered by discrete events or requests –The underlying runtime is (infinitely) elastic, with scaling (and chargeback) granularity of single function invocation (100ms) –Each local function is invoked in a sandbox, which is short-lived and ephemeral (interacting with stateful services) 18
  • 20. What is serverless good for? 19
  • 21. Example: Serverless at Thomson Reuters 20 https://www.portal.reinvent.awsevents.com/connect/sessionDetail.ww?SESSION_ID=8674
  • 22. Example: Serverless at Bustle 21 https://aws.amazon.com/solutions/case-studies/bustle/
  • 23. Example: Serverless at Expedia 22 https://www.portal.reinvent.awsevents.com/connect/sessionDetail.ww?SESSION_ID=8671
  • 24. Example: Serverless at Expedia 23 https://www.portal.reinvent.awsevents.com/connect/sessionDetail.ww?SESSION_ID=8671
  • 25. OpenWhisk CLI: Create and test action Create the Action that analyzes IoT readings, then stores in the database wsk action create analyze-service-event analyze-service-event.js --param cloudant_user $CLOUDANT_USER --param cloudant_pass $CLOUDANT_PASS Invoke the Action manually with sample message data to test wsk action invoke --blocking --result analyze-service-event --param service '{ "appliance_serial": "xxxxyyyyzzzz", "part_number": "ddddeeeeffff", "reading": 13, "timestamp": 1466188262}'
  • 26. OpenWhisk CLI: Link trigger to action Create the Trigger that subscribes to an MQTT topic pattern wsk trigger create openfridge-feed-trigger --feed mqtt/mqtt-feed-action --param topic 'iot-2/type/+/id/+/evt/+/fmt/json' --param url 'ssl://example.messaging.internetofthings.ibmcloud.com:8883’ Link the Trigger to the Action using a Rule wsk rule create --enable openfridge-feed-rule openfridge-feed-trigger analyze-service-event
  • 27. Serverless check processing with OpenWhisk https://github.com/krook/openchecks
  • 28. Serverless can handle many cloud native app 12 Factors I Codebase Handled by developer (Manage versioning of functions on their own) II Dependencies Handled by developer, facilitated by serverless platform (Runtimes and packages) III Config Handled by platform (Environment variables or injected event parameters) IV Backing services Handled by platform (Connection information injected as event parameters) V Build, release, run Handled by platform (Deployed resources are immutable and internally versioned) VI Processes Handled by platform (Single stateless containers often used) VII Port binding Handled by platform (Actions or functions are automatically discovered) VIII Concurrency Handled by platform (Process model is hidden and scales in response to demand) IX Disposability Handled by platform (Lifecycle is hidden from the user, fast startup and elastic scale is prioritized) X Dev/prod parity Handled by developer (The developer is the deployer. Scope of what differs is narrower) XI Logs Handled by platform (Developer writes to console.log, platform handles log streaming) XII Admin processes Handled by developer (No distinction between one off processes and long running)