SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
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)

Más contenido relacionado

La actualidad más candente

2015 03-11_todd-fritz_devnexus_2015
2015 03-11_todd-fritz_devnexus_20152015 03-11_todd-fritz_devnexus_2015
2015 03-11_todd-fritz_devnexus_2015
Todd Fritz
 

La actualidad más candente (20)

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

Destacado

Destacado (12)

Service discovery like a pro (presented at reversimX)
Service discovery like a pro (presented at reversimX)Service discovery like a pro (presented at reversimX)
Service discovery like a pro (presented at reversimX)
 
Corrientes económicas
Corrientes económicasCorrientes económicas
Corrientes económicas
 
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
 
IBM Bluemix Openwhisk
IBM Bluemix OpenwhiskIBM Bluemix Openwhisk
IBM Bluemix Openwhisk
 
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayerTaking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
 
Making Sense of DevOps Tools: Open Source to Enterprise Solutions
Making Sense of DevOps Tools: Open Source to Enterprise SolutionsMaking Sense of DevOps Tools: Open Source to Enterprise Solutions
Making Sense of DevOps Tools: Open Source to Enterprise Solutions
 
State of serverless
State of serverlessState of serverless
State of serverless
 
IBM Bluemix Dedicated – GitHub Enterprise
IBM Bluemix Dedicated – GitHub EnterpriseIBM Bluemix Dedicated – GitHub Enterprise
IBM Bluemix Dedicated – GitHub Enterprise
 
Deploying to and Configuring WebSphere Application Server with UrbanCode Deploy
Deploying to and Configuring WebSphere Application Server with UrbanCode DeployDeploying to and Configuring WebSphere Application Server with UrbanCode Deploy
Deploying to and Configuring WebSphere Application Server with UrbanCode Deploy
 
Google's Dremel
Google's DremelGoogle's Dremel
Google's Dremel
 
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
 
AWS re:Invent 2016: The State of Serverless Computing (SVR311)
AWS re:Invent 2016: The State of Serverless Computing (SVR311)AWS re:Invent 2016: The State of Serverless Computing (SVR311)
AWS re:Invent 2016: The State of Serverless Computing (SVR311)
 

Similar a Going Serverless with OpenWhisk

Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming...
Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming...Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming...
Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming...
ServerlessConf
 
Cloud Expo East 2013: Essential Open Source Software for Building the Open Cloud
Cloud Expo East 2013: Essential Open Source Software for Building the Open CloudCloud Expo East 2013: Essential Open Source Software for Building the Open Cloud
Cloud Expo East 2013: Essential Open Source Software for Building the Open Cloud
Mark Hinkle
 
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Lucas Jellema
 

Similar a Going Serverless with OpenWhisk (20)

The 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWAREThe 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWARE
 
Apache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless ComputingApache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless Computing
 
Open stack ocata summit enabling aws lambda-like functionality with openstac...
Open stack ocata summit  enabling aws lambda-like functionality with openstac...Open stack ocata summit  enabling aws lambda-like functionality with openstac...
Open stack ocata summit enabling aws lambda-like functionality with openstac...
 
Openwhisk - Colorado Meetups
Openwhisk - Colorado MeetupsOpenwhisk - Colorado Meetups
Openwhisk - Colorado Meetups
 
Staying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with KafkaStaying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with Kafka
 
Serverless forwardjs
Serverless forwardjsServerless forwardjs
Serverless forwardjs
 
Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming...
Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming...Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming...
Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming...
 
Microservices and Serverless Computing - OpenWhisk
Microservices and Serverless Computing - OpenWhiskMicroservices and Serverless Computing - OpenWhisk
Microservices and Serverless Computing - OpenWhisk
 
Red Hat and kubernetes: awesome stuff coming your way
Red Hat and kubernetes:  awesome stuff coming your wayRed Hat and kubernetes:  awesome stuff coming your way
Red Hat and kubernetes: awesome stuff coming your way
 
Oscon 2017: Build your own container-based system with the Moby project
Oscon 2017: Build your own container-based system with the Moby projectOscon 2017: Build your own container-based system with the Moby project
Oscon 2017: Build your own container-based system with the Moby project
 
Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...
Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...
Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...
 
From CoreOS to Kubernetes and Concourse CI
From CoreOS to Kubernetes and Concourse CIFrom CoreOS to Kubernetes and Concourse CI
From CoreOS to Kubernetes and Concourse CI
 
OpenWhisk JavaOne
OpenWhisk JavaOneOpenWhisk JavaOne
OpenWhisk JavaOne
 
Event Bus as Backbone for Decoupled Microservice Choreography - Lecture and W...
Event Bus as Backbone for Decoupled Microservice Choreography - Lecture and W...Event Bus as Backbone for Decoupled Microservice Choreography - Lecture and W...
Event Bus as Backbone for Decoupled Microservice Choreography - Lecture and W...
 
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
[DevDay 2017] OpenShift Enterprise - Speaker: Linh Do - DevOps Engineer at Ax...
 
Cloud Expo East 2013: Essential Open Source Software for Building the Open Cloud
Cloud Expo East 2013: Essential Open Source Software for Building the Open CloudCloud Expo East 2013: Essential Open Source Software for Building the Open Cloud
Cloud Expo East 2013: Essential Open Source Software for Building the Open Cloud
 
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
 
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptxIBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
IBM BP Session - Multiple CLoud Paks and Cloud Paks Foundational Services.pptx
 
New and smart way to develop microservice for istio with micro profile
New and smart way to develop microservice for istio with micro profileNew and smart way to develop microservice for istio with micro profile
New and smart way to develop microservice for istio with micro profile
 
Serverless Apps with Open Whisk
Serverless Apps with Open Whisk Serverless Apps with Open Whisk
Serverless Apps with Open Whisk
 

Más de Alex Glikson (7)

AWS Re:Invented
AWS Re:InventedAWS Re:Invented
AWS Re:Invented
 
Serverless Compute Platforms on Kubernetes
Serverless Compute Platforms on KubernetesServerless Compute Platforms on Kubernetes
Serverless Compute Platforms on Kubernetes
 
From chroot to Docker to Kubernetes
From chroot to Docker to KubernetesFrom chroot to Docker to Kubernetes
From chroot to Docker to Kubernetes
 
Cloud-Native Application and Kubernetes
Cloud-Native Application and KubernetesCloud-Native Application and Kubernetes
Cloud-Native Application and Kubernetes
 
Mixing bare-metal and virtualized workloads on OpenStack - 2014
Mixing bare-metal and virtualized workloads on OpenStack - 2014Mixing bare-metal and virtualized workloads on OpenStack - 2014
Mixing bare-metal and virtualized workloads on OpenStack - 2014
 
Serverless, IoT and OpenWhisk
Serverless, IoT and OpenWhiskServerless, IoT and OpenWhisk
Serverless, IoT and OpenWhisk
 
Container-Based Platforms and Kubernetes
Container-Based Platforms and KubernetesContainer-Based Platforms and Kubernetes
Container-Based Platforms and Kubernetes
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

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)