SlideShare a Scribd company logo
1IBM
_
Be Whisked Away with a
Raspberry PI, Java, and
OpenWhisk
Luc Desrosiers
IBM Certified IT Architect
Session CON2758
2IBM
_
About me
• 20 years in IT – Development, Integration, Cloud
• IT Architect who loves to write code
• Java enthusiast since using Servlet Express back in 1998
• Cloud, IoT and Cognitive computing are areas that I am passionate about
• Probably lost my hair to a program that would not compile…
3IBM
_
What can you expect to get from
this session?
• An understanding of serverless computing and OpenWhisk
• An early view on some usage patterns and how it can be used to
complement your application design
• A quick way to get started experimenting with OpenWhisk
And finally,
• A demonstration of an IoT solution integrated with OpenWhisk
4IBM
_
What is OpenWhisk?
OpenWhisk is a Cloud platform to execute code in response to events
• OpenWhisk is an Open Source project released by IBM
• Supports many language including Java
• Based on the serverless concept …
5IBM
_
What is serverless ?
OpenWhisk is a Cloud platform to execute code in response to events
• Serverless is about removing infrastructure from the equation
• It is about focusing on business logics, not thread pools
• Often associated to Function-as-a-Service
The transition from micro services…
Microservice
MicroserviceMicroservice
Microservice
Subscribe
REST
/HTTP
Microservice
Microservice
broker
API
Microservice
Publish
API
REST
/HTTP Publish
Service
Discovery
Microservice
1 Docker
Container
App
Servers
NodeJS
instance
App
Servers
NodeJS
instance
NodeJS
instance
VM
What if I need to
scale this?
VM
NodeJS
instance
NodeJS
instance
App
Servers
App
Servers
1 Docker
Container
VM
serverless container
to serverless…
Microservice
Microservice
Microservice
Microservice
Subscribe
REST
/HTTP
Microservice
broker
API
Action
Publish
API
REST
/HTTP Publish
Service
Discovery
Microservice
Trigger
Trigger
What if I need to
scale this?
Serverless
technology handles
the burst
Action
1 Docker
Container
1 Docker
Container
VM
VM
VM
8IBM
_
So what does it look like
?
Event
Trigger
Action
OpenWhisk Overview
Language supported:
• NodeJS
• Swift
• Java
• Python
• Docker
10IBM
_
Where does it fit ?
• Serverless is a piece of the puzzle… not a complete solution
• Triggers and Back-end Services are not necessarily serverless
• Someone has to hold the state after all…
UI
Components
Serverless
components
Event
Generator
Back-end as a Service
11IBM
_
Serverless and the 12 Factor App?
Twelve Factor App was created as a methodology for building SaaS…
II. Dependencies
Explicitly declare and isolate dependencies
III. Config
Store config in the environment
IV. Backing services
Treat backing services as attached resources
VI. Processes
Execute the app as one or more stateless
processes
https://12factor.net/
VII. Port binding
Export services via port binding
VIII. Concurrency
Scale out via the process model
IX. Disposability
Maximize robustness with fast startup and graceful
shutdown
12IBM
_
OK, what about usage patterns ?
• Serverless technologies are still new… patterns have yet to emerge
• Simplicity should be the focus of each function
• May need significant refactoring of existing code to minimize
dependencies…
However there are some architecture patterns where serveless fits
nicely…
Mobile and Web Backend as a Service
APIGateway
Sequence
Business Logic
Action
/whisk/websock
et
Backend
Service
Action
Trigger
Web
App
Benefits:
• Clear delineation of business and controller logic
• Produces discreet reusable action that can be assembled as a sequence
/whisk/push
The analytics platform
Cloudant
DB A
Data processing pipeline
IoT
Events
Change
Feed
Change
Listener
Cloudant
DB A
Quality
Control
Event
Persister
/whisk/clou
dant
Data
Enrichment
/whisk/wea
ther
Benefits:
• Database change can trigger other actions
• Functionality can be extended easily
Trigger
The DevOps pipeline
Sequence
Git
Data
Feed
GitHub
Benefits:
• Improve communication
• Clean extension to the build pipeline
Business Logic
Action
/whisk/slack
Backend
Service
Action
16IBM
_
Some considerations
• Avoid heavy-weight functions
• Harder to debug
• Harder to reuse
• Trigger do not guarantee order of processing…
• Message affinity is bad… avoid it at all costs
• Plan how your input and output are designed to maximize reuse
• Ability to re-use an action depends on the assumption it is making
about its input
• Assert aggressively!
17IBM
_
Now, how can you get started?
1. Get familiar with the OpenWhisk command line interface
2. Create a basic Java Action
3. Deploy to Bluemix or locally
OpenWhisk Command Line
wsk trigger create <trigger-name>
1. Creating a trigger
wsk package create <package-name>
2. Creating a package
wsk action create <package>/<action> <Jar File>.jar
3. Creating an action
wsk package bind /whisk.system/websocket <bind-name> -p uri
ws://<url>
4. Create a binding for an action
wsk rule create <rule-name> <trigger> <action>
5. Create a rule for triggering an action
Installing OpenWhisk CLI can be found here: https://new-console.ng.bluemix.net/openwhisk/cli
Creating a Basic Java Action
The entry point for the Action must follow this signature
Note: If the JAR file has more than one class with a main
method matching required signature, the CLI tool uses the first
one reported by jar -tf
Deploying to Bluemix
21IBM
_
What is available out of the
box?
Here are some of the provided package of actions and feed you can use to
get started:
Cloudant
Alarms
Watson
github
Push
Notifications
slack
Weather data
22IBM
_
Where does the Raspberry Pi come in?
• Serverless technology Is based on triggering action based on events
• A robot including sensors generates lots of events
• Objective was to see how serverless could be integrated
The Anatomy of an IoT tank
Cloudant
IoT-Tank
Stop Session
Start Session
Save IoT data
Change
Listener
Image Analysis
IoTBridge
Visual Recognition
Watson IoT
Foundation
IoTTankVision
OpenWhisk
Send image &
sensor data
Start &
stop session
IoT tank – Communication Layer
Pi4J – GPIO Control
IBM Watson IoT Foundation – IoT integration
Cloudant – Image persistence
JRPiCam – Pi Camera Control
Sending events:
Receiving commands:
25IBM
_
Wrap-up
• Serverless technology is a key part of a microservices architecture
• OpenWhisk reduces the operational burden
• Patterns are still emerging but the technology works great with:
• Web or Mobile application
• Analytics
• DevOps pipeline
• Getting started is easy and quick… Try it for yourself! 
26IBM
_
Thank You!
Some references…
IBM Hybrid Cloud solution guide:
Building a Hybrid Cloud with Bluemix
Bluemix blog
Getting Started with OpenWhisk:
https://github.com/openwhisk/openwhisk
https://new-console.ng.bluemix.net/openwhisk/cli
https://console.ng.bluemix.net/docs/openwhisk/index.html?pos=2
Accessing the code:
https://github.com/ldesrosi/iot-tank-client
https://github.com/ldesrosi/iot-tank-server
Luc Desrosiers | ldesrosi@uk.ibm.com | Twitter: Luc_At_IBM

More Related Content

What's hot

Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y...
Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y...Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y...
Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y...
Nico Meisenzahl
 
New Serverless World, Cloud Native Apps
New Serverless World, Cloud Native AppsNew Serverless World, Cloud Native Apps
New Serverless World, Cloud Native Apps
Melania Andrisan (Danciu)
 
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 ...
OpenWhisk
 
Modular Web Applications based on OSGi - Jochen Hiller
Modular Web Applications based on OSGi - Jochen HillerModular Web Applications based on OSGi - Jochen Hiller
Modular Web Applications based on OSGi - Jochen Hiller
mfrancis
 
Provisioning Windows instances at scale on Azure, AWS and OpenStack - Adrian ...
Provisioning Windows instances at scale on Azure, AWS and OpenStack - Adrian ...Provisioning Windows instances at scale on Azure, AWS and OpenStack - Adrian ...
Provisioning Windows instances at scale on Azure, AWS and OpenStack - Adrian ...
ITCamp
 
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp
 
Was ist ein Service Mesh und wie funktioniert es?
Was ist ein Service Mesh und wie funktioniert es?Was ist ein Service Mesh und wie funktioniert es?
Was ist ein Service Mesh und wie funktioniert es?
Cloud Native Rosenheim Meetup
 
OpenWhisk Under the Hood -- London Oct 16 2016
OpenWhisk Under the Hood -- London Oct 16 2016OpenWhisk Under the Hood -- London Oct 16 2016
OpenWhisk Under the Hood -- London Oct 16 2016
Stephen Fink
 
Neues aus dem Docker-Universum
Neues aus dem Docker-UniversumNeues aus dem Docker-Universum
Neues aus dem Docker-Universum
Nicholas Dille
 
Azure Meetup Hamburg: Production-Ready Terraform Deployments on Azure
Azure Meetup Hamburg: Production-Ready Terraform Deployments on AzureAzure Meetup Hamburg: Production-Ready Terraform Deployments on Azure
Azure Meetup Hamburg: Production-Ready Terraform Deployments on Azure
Nico Meisenzahl
 
Microservices and containers networking: Contiv, an industry leading open sou...
Microservices and containers networking: Contiv, an industry leading open sou...Microservices and containers networking: Contiv, an industry leading open sou...
Microservices and containers networking: Contiv, an industry leading open sou...
Codemotion
 
Practical Approaches to Cloud Native Security
Practical Approaches to Cloud Native SecurityPractical Approaches to Cloud Native Security
Practical Approaches to Cloud Native Security
Karthik Gaekwad
 
Network Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspectiveNetwork Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspective
Walid Shaari
 
Azure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello
Azure tales: a real world CQRS and ES Deep Dive - Andrea SaltarelloAzure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello
Azure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello
ITCamp
 
Kube Apps in action
Kube Apps in actionKube Apps in action
Kube Apps in action
Karthik Gaekwad
 
Infrastructure as Code with Ansible
Infrastructure as Code with AnsibleInfrastructure as Code with Ansible
Infrastructure as Code with Ansible
Daniel Bezerra
 
Heroku cloud platform
Heroku cloud platformHeroku cloud platform
Heroku cloud platform
Hasan Khatib
 
EMC World 2016 12 Factor Apps FTW
EMC World 2016 12 Factor Apps FTWEMC World 2016 12 Factor Apps FTW
EMC World 2016 12 Factor Apps FTW
Tommy Trogden
 
Out of the Blue: Getting started with IBM Bluemix development
Out of the Blue: Getting started with IBM Bluemix developmentOut of the Blue: Getting started with IBM Bluemix development
Out of the Blue: Getting started with IBM Bluemix development
Oliver Busse
 
OpenWhisk Introduction
OpenWhisk IntroductionOpenWhisk Introduction
OpenWhisk Introduction
Ioana Baldini
 

What's hot (20)

Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y...
Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y...Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y...
Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y...
 
New Serverless World, Cloud Native Apps
New Serverless World, Cloud Native AppsNew Serverless World, Cloud Native Apps
New Serverless World, Cloud Native Apps
 
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 ...
 
Modular Web Applications based on OSGi - Jochen Hiller
Modular Web Applications based on OSGi - Jochen HillerModular Web Applications based on OSGi - Jochen Hiller
Modular Web Applications based on OSGi - Jochen Hiller
 
Provisioning Windows instances at scale on Azure, AWS and OpenStack - Adrian ...
Provisioning Windows instances at scale on Azure, AWS and OpenStack - Adrian ...Provisioning Windows instances at scale on Azure, AWS and OpenStack - Adrian ...
Provisioning Windows instances at scale on Azure, AWS and OpenStack - Adrian ...
 
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
 
Was ist ein Service Mesh und wie funktioniert es?
Was ist ein Service Mesh und wie funktioniert es?Was ist ein Service Mesh und wie funktioniert es?
Was ist ein Service Mesh und wie funktioniert es?
 
OpenWhisk Under the Hood -- London Oct 16 2016
OpenWhisk Under the Hood -- London Oct 16 2016OpenWhisk Under the Hood -- London Oct 16 2016
OpenWhisk Under the Hood -- London Oct 16 2016
 
Neues aus dem Docker-Universum
Neues aus dem Docker-UniversumNeues aus dem Docker-Universum
Neues aus dem Docker-Universum
 
Azure Meetup Hamburg: Production-Ready Terraform Deployments on Azure
Azure Meetup Hamburg: Production-Ready Terraform Deployments on AzureAzure Meetup Hamburg: Production-Ready Terraform Deployments on Azure
Azure Meetup Hamburg: Production-Ready Terraform Deployments on Azure
 
Microservices and containers networking: Contiv, an industry leading open sou...
Microservices and containers networking: Contiv, an industry leading open sou...Microservices and containers networking: Contiv, an industry leading open sou...
Microservices and containers networking: Contiv, an industry leading open sou...
 
Practical Approaches to Cloud Native Security
Practical Approaches to Cloud Native SecurityPractical Approaches to Cloud Native Security
Practical Approaches to Cloud Native Security
 
Network Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspectiveNetwork Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspective
 
Azure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello
Azure tales: a real world CQRS and ES Deep Dive - Andrea SaltarelloAzure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello
Azure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello
 
Kube Apps in action
Kube Apps in actionKube Apps in action
Kube Apps in action
 
Infrastructure as Code with Ansible
Infrastructure as Code with AnsibleInfrastructure as Code with Ansible
Infrastructure as Code with Ansible
 
Heroku cloud platform
Heroku cloud platformHeroku cloud platform
Heroku cloud platform
 
EMC World 2016 12 Factor Apps FTW
EMC World 2016 12 Factor Apps FTWEMC World 2016 12 Factor Apps FTW
EMC World 2016 12 Factor Apps FTW
 
Out of the Blue: Getting started with IBM Bluemix development
Out of the Blue: Getting started with IBM Bluemix developmentOut of the Blue: Getting started with IBM Bluemix development
Out of the Blue: Getting started with IBM Bluemix development
 
OpenWhisk Introduction
OpenWhisk IntroductionOpenWhisk Introduction
OpenWhisk Introduction
 

Similar to OpenWhisk JavaOne

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 ...
OpenWhisk
 
IBM Bluemix and Docker Guest Lecture at Cork Institute of Technology
IBM Bluemix and Docker Guest Lecture at Cork Institute of TechnologyIBM Bluemix and Docker Guest Lecture at Cork Institute of Technology
IBM Bluemix and Docker Guest Lecture at Cork Institute of Technology
Sanjay Nayak
 
Docker12 factor
Docker12 factorDocker12 factor
Docker12 factor
John Zaccone
 
Going Serverless with OpenWhisk
Going Serverless with OpenWhiskGoing Serverless with OpenWhisk
Going Serverless with OpenWhisk
Alex Glikson
 
Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...
Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...
Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...
Jack-Junjie Cai
 
JCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptxJCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptx
Grace Jansen
 
The twelve factor app
The twelve factor appThe twelve factor app
The twelve factor app
Ravi Okade
 
Migrating Java EE applications to IBM Bluemix Platform-as-a-Service
Migrating Java EE applications to IBM Bluemix Platform-as-a-ServiceMigrating Java EE applications to IBM Bluemix Platform-as-a-Service
Migrating Java EE applications to IBM Bluemix Platform-as-a-Service
David Currie
 
Apache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless ComputingApache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless Computing
Upkar Lidder
 
The Serverless Paradigm, OpenWhisk and FIWARE
The Serverless Paradigm, OpenWhisk and FIWAREThe Serverless Paradigm, OpenWhisk and FIWARE
The Serverless Paradigm, OpenWhisk and FIWARE
Alex Glikson
 
The 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWAREThe 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWARE
FIWARE
 
IBM Bluemix Talk at University College Cork (UCC)
IBM Bluemix Talk at University College Cork (UCC)IBM Bluemix Talk at University College Cork (UCC)
IBM Bluemix Talk at University College Cork (UCC)
Sanjay Nayak
 
Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?
Phil Estes
 
Java Development on Bluemix
Java Development on BluemixJava Development on Bluemix
Java Development on Bluemix
Ram Vennam
 
CNCF Introduction - Feb 2018
CNCF Introduction - Feb 2018CNCF Introduction - Feb 2018
CNCF Introduction - Feb 2018
Krishna-Kumar
 
Serverless Pune Meetup 1
Serverless Pune Meetup 1Serverless Pune Meetup 1
Serverless Pune Meetup 1
Vishal Biyani
 
TechTalk - Building Serverless Applications with IBM Bluemix
TechTalk - Building Serverless Applications with IBM BluemixTechTalk - Building Serverless Applications with IBM Bluemix
TechTalk - Building Serverless Applications with IBM Bluemix
Janakiram MSV
 
Serverless Pune meetup 3
Serverless Pune meetup 3Serverless Pune meetup 3
Serverless Pune meetup 3
Vishal Biyani
 
Bangalore OpenMSA DevDay - September 19, 2018
Bangalore OpenMSA DevDay - September 19, 2018Bangalore OpenMSA DevDay - September 19, 2018
Bangalore OpenMSA DevDay - September 19, 2018
UBiqube
 
Dev ops on aws deep dive on continuous delivery - Toronto
Dev ops on aws deep dive on continuous delivery - TorontoDev ops on aws deep dive on continuous delivery - Toronto
Dev ops on aws deep dive on continuous delivery - Toronto
Amazon Web Services
 

Similar to OpenWhisk JavaOne (20)

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 ...
 
IBM Bluemix and Docker Guest Lecture at Cork Institute of Technology
IBM Bluemix and Docker Guest Lecture at Cork Institute of TechnologyIBM Bluemix and Docker Guest Lecture at Cork Institute of Technology
IBM Bluemix and Docker Guest Lecture at Cork Institute of Technology
 
Docker12 factor
Docker12 factorDocker12 factor
Docker12 factor
 
Going Serverless with OpenWhisk
Going Serverless with OpenWhiskGoing Serverless with OpenWhisk
Going Serverless with OpenWhisk
 
Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...
Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...
Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...
 
JCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptxJCON_15FactorWorkshop.pptx
JCON_15FactorWorkshop.pptx
 
The twelve factor app
The twelve factor appThe twelve factor app
The twelve factor app
 
Migrating Java EE applications to IBM Bluemix Platform-as-a-Service
Migrating Java EE applications to IBM Bluemix Platform-as-a-ServiceMigrating Java EE applications to IBM Bluemix Platform-as-a-Service
Migrating Java EE applications to IBM Bluemix Platform-as-a-Service
 
Apache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless ComputingApache OpenWhisk Serverless Computing
Apache OpenWhisk Serverless Computing
 
The Serverless Paradigm, OpenWhisk and FIWARE
The Serverless Paradigm, OpenWhisk and FIWAREThe Serverless Paradigm, OpenWhisk and FIWARE
The Serverless Paradigm, OpenWhisk and FIWARE
 
The 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWAREThe 'Serverless' Paradigm, OpenWhisk and FIWARE
The 'Serverless' Paradigm, OpenWhisk and FIWARE
 
IBM Bluemix Talk at University College Cork (UCC)
IBM Bluemix Talk at University College Cork (UCC)IBM Bluemix Talk at University College Cork (UCC)
IBM Bluemix Talk at University College Cork (UCC)
 
Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?Containerize, PaaS, or Go Serverless!?
Containerize, PaaS, or Go Serverless!?
 
Java Development on Bluemix
Java Development on BluemixJava Development on Bluemix
Java Development on Bluemix
 
CNCF Introduction - Feb 2018
CNCF Introduction - Feb 2018CNCF Introduction - Feb 2018
CNCF Introduction - Feb 2018
 
Serverless Pune Meetup 1
Serverless Pune Meetup 1Serverless Pune Meetup 1
Serverless Pune Meetup 1
 
TechTalk - Building Serverless Applications with IBM Bluemix
TechTalk - Building Serverless Applications with IBM BluemixTechTalk - Building Serverless Applications with IBM Bluemix
TechTalk - Building Serverless Applications with IBM Bluemix
 
Serverless Pune meetup 3
Serverless Pune meetup 3Serverless Pune meetup 3
Serverless Pune meetup 3
 
Bangalore OpenMSA DevDay - September 19, 2018
Bangalore OpenMSA DevDay - September 19, 2018Bangalore OpenMSA DevDay - September 19, 2018
Bangalore OpenMSA DevDay - September 19, 2018
 
Dev ops on aws deep dive on continuous delivery - Toronto
Dev ops on aws deep dive on continuous delivery - TorontoDev ops on aws deep dive on continuous delivery - Toronto
Dev ops on aws deep dive on continuous delivery - Toronto
 

Recently uploaded

FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 

OpenWhisk JavaOne

  • 1. 1IBM _ Be Whisked Away with a Raspberry PI, Java, and OpenWhisk Luc Desrosiers IBM Certified IT Architect Session CON2758
  • 2. 2IBM _ About me • 20 years in IT – Development, Integration, Cloud • IT Architect who loves to write code • Java enthusiast since using Servlet Express back in 1998 • Cloud, IoT and Cognitive computing are areas that I am passionate about • Probably lost my hair to a program that would not compile…
  • 3. 3IBM _ What can you expect to get from this session? • An understanding of serverless computing and OpenWhisk • An early view on some usage patterns and how it can be used to complement your application design • A quick way to get started experimenting with OpenWhisk And finally, • A demonstration of an IoT solution integrated with OpenWhisk
  • 4. 4IBM _ What is OpenWhisk? OpenWhisk is a Cloud platform to execute code in response to events • OpenWhisk is an Open Source project released by IBM • Supports many language including Java • Based on the serverless concept …
  • 5. 5IBM _ What is serverless ? OpenWhisk is a Cloud platform to execute code in response to events • Serverless is about removing infrastructure from the equation • It is about focusing on business logics, not thread pools • Often associated to Function-as-a-Service
  • 6. The transition from micro services… Microservice MicroserviceMicroservice Microservice Subscribe REST /HTTP Microservice Microservice broker API Microservice Publish API REST /HTTP Publish Service Discovery Microservice 1 Docker Container App Servers NodeJS instance App Servers NodeJS instance NodeJS instance VM What if I need to scale this? VM NodeJS instance NodeJS instance App Servers App Servers 1 Docker Container VM
  • 7. serverless container to serverless… Microservice Microservice Microservice Microservice Subscribe REST /HTTP Microservice broker API Action Publish API REST /HTTP Publish Service Discovery Microservice Trigger Trigger What if I need to scale this? Serverless technology handles the burst Action 1 Docker Container 1 Docker Container VM VM VM
  • 8. 8IBM _ So what does it look like ? Event Trigger Action
  • 9. OpenWhisk Overview Language supported: • NodeJS • Swift • Java • Python • Docker
  • 10. 10IBM _ Where does it fit ? • Serverless is a piece of the puzzle… not a complete solution • Triggers and Back-end Services are not necessarily serverless • Someone has to hold the state after all… UI Components Serverless components Event Generator Back-end as a Service
  • 11. 11IBM _ Serverless and the 12 Factor App? Twelve Factor App was created as a methodology for building SaaS… II. Dependencies Explicitly declare and isolate dependencies III. Config Store config in the environment IV. Backing services Treat backing services as attached resources VI. Processes Execute the app as one or more stateless processes https://12factor.net/ VII. Port binding Export services via port binding VIII. Concurrency Scale out via the process model IX. Disposability Maximize robustness with fast startup and graceful shutdown
  • 12. 12IBM _ OK, what about usage patterns ? • Serverless technologies are still new… patterns have yet to emerge • Simplicity should be the focus of each function • May need significant refactoring of existing code to minimize dependencies… However there are some architecture patterns where serveless fits nicely…
  • 13. Mobile and Web Backend as a Service APIGateway Sequence Business Logic Action /whisk/websock et Backend Service Action Trigger Web App Benefits: • Clear delineation of business and controller logic • Produces discreet reusable action that can be assembled as a sequence /whisk/push
  • 14. The analytics platform Cloudant DB A Data processing pipeline IoT Events Change Feed Change Listener Cloudant DB A Quality Control Event Persister /whisk/clou dant Data Enrichment /whisk/wea ther Benefits: • Database change can trigger other actions • Functionality can be extended easily Trigger
  • 15. The DevOps pipeline Sequence Git Data Feed GitHub Benefits: • Improve communication • Clean extension to the build pipeline Business Logic Action /whisk/slack Backend Service Action
  • 16. 16IBM _ Some considerations • Avoid heavy-weight functions • Harder to debug • Harder to reuse • Trigger do not guarantee order of processing… • Message affinity is bad… avoid it at all costs • Plan how your input and output are designed to maximize reuse • Ability to re-use an action depends on the assumption it is making about its input • Assert aggressively!
  • 17. 17IBM _ Now, how can you get started? 1. Get familiar with the OpenWhisk command line interface 2. Create a basic Java Action 3. Deploy to Bluemix or locally
  • 18. OpenWhisk Command Line wsk trigger create <trigger-name> 1. Creating a trigger wsk package create <package-name> 2. Creating a package wsk action create <package>/<action> <Jar File>.jar 3. Creating an action wsk package bind /whisk.system/websocket <bind-name> -p uri ws://<url> 4. Create a binding for an action wsk rule create <rule-name> <trigger> <action> 5. Create a rule for triggering an action Installing OpenWhisk CLI can be found here: https://new-console.ng.bluemix.net/openwhisk/cli
  • 19. Creating a Basic Java Action The entry point for the Action must follow this signature Note: If the JAR file has more than one class with a main method matching required signature, the CLI tool uses the first one reported by jar -tf
  • 21. 21IBM _ What is available out of the box? Here are some of the provided package of actions and feed you can use to get started: Cloudant Alarms Watson github Push Notifications slack Weather data
  • 22. 22IBM _ Where does the Raspberry Pi come in? • Serverless technology Is based on triggering action based on events • A robot including sensors generates lots of events • Objective was to see how serverless could be integrated
  • 23. The Anatomy of an IoT tank Cloudant IoT-Tank Stop Session Start Session Save IoT data Change Listener Image Analysis IoTBridge Visual Recognition Watson IoT Foundation IoTTankVision OpenWhisk Send image & sensor data Start & stop session
  • 24. IoT tank – Communication Layer Pi4J – GPIO Control IBM Watson IoT Foundation – IoT integration Cloudant – Image persistence JRPiCam – Pi Camera Control Sending events: Receiving commands:
  • 25. 25IBM _ Wrap-up • Serverless technology is a key part of a microservices architecture • OpenWhisk reduces the operational burden • Patterns are still emerging but the technology works great with: • Web or Mobile application • Analytics • DevOps pipeline • Getting started is easy and quick… Try it for yourself! 
  • 26. 26IBM _ Thank You! Some references… IBM Hybrid Cloud solution guide: Building a Hybrid Cloud with Bluemix Bluemix blog Getting Started with OpenWhisk: https://github.com/openwhisk/openwhisk https://new-console.ng.bluemix.net/openwhisk/cli https://console.ng.bluemix.net/docs/openwhisk/index.html?pos=2 Accessing the code: https://github.com/ldesrosi/iot-tank-client https://github.com/ldesrosi/iot-tank-server Luc Desrosiers | ldesrosi@uk.ibm.com | Twitter: Luc_At_IBM