Be Whisked Away with a Raspberry PI, Java, and OpenWhisk

Slides:



Advertisements
Similar presentations
Management Framework for Amazon EC2 Speaker: Frank Bitzer
Advertisements

UNIT-V The MVC architecture and Struts Framework.
Play with Cloud Foundry An Open PaaS Shi, Tao May 11, 2012.
© 2006 IBM Corporation Agile Planning Web UI. © 2006 IBM Corporation Agenda  Overview of APT Web UI  Current Issues  Required Infrastructure  API.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 1.
Introduction To BlueMix By: Ryan
Welcome to Azure App Services! Amie Seisay
Bluemix for Domino Developers Niklas Heidloff, heidloff.net.
Building Azure Mobile Apps
The Holmes Platform and Applications
Profound.js: The future of open source development on IBM i
Building Azure Web Apps
12/29/2017 3:36 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Going Serverless with AWS Lambda
Cloud Services vs. Web Apps
.NET Omid Darroudi.
Containers as a Service with Docker to Extend an Open Platform
MeshCentral 2.0.
4/24/ :07 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Build /26/2018 6:17 AM Building Resilient, Scalable Services with Microsoft Azure Service Fabric Érsek © 2015 Microsoft Corporation.
Smart Building Solution
Done By: Ashlee Lizarraga Ricky Usher Jacinto Roches Eli Gomez
A day in the life of an Azure serverless developer
Blue Mixology.
Tulika Chaudharie / Harikharan Krishnaraju
Data-driven serverless apps with Azure functions
Data-driven serverless apps with Azure functions
Prepared by: Assistant prof. Aslamzai
Developing Hybrid Apps on Microsoft Azure Stack
Overall Architecture and Component Model
Introducing Azure Functions
Modern Architectures in Cloud
Smart Building Solution
Platform as a Service.
Logo here Module 3 Microsoft Azure Web App. Logo here Module Overview Introduction to App Service Overview of Web Apps Hosting Web Applications in Azure.
LEO Kinesis More Kafka-like Blaine Nielsen
Overview of the Microsoft Azure serverless platform
Introduction to J2EE Architecture
Emitter: Scalable, fast and secure pub/sub in Go
Microsoft Azure Service Fabric Overview
Service Fabric Patterns & Best Practices
Jeff Hollan Azure Functions – Serverless compute in the cloud
Continuous Performance Engineering
Using docker containers
Accelerate application delivery with a Cloud-native mindset
Microsoft Connect /17/ :34 AM
Microservices on application container cloud service
Hosted Web Apps with Windows App Studio
Developing for the cloud with Visual Studio
Please note: Presenter notes are on every slide
Lecture 1: Multi-tier Architecture Overview
Near Real Time ETLs with Azure Serverless Architecture
Modern cloud PaaS for mobile apps, web sites, API's and business logic apps
1/3/2019 9:40 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS.
Technical Capabilities
Serverless Architecture in the Cloud
2/19/2019 9:06 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
The 12 Factors to build Cloud Native Applications
Johan Lindberg, inRiver
Research on edge computing system based on Linux EdgeX Foundry
Your .NET App Won’t Scale
SSDT, Docker, and (Azure) DevOps
Eldert Grootenboer Cloud Architecture Recipes For The Enterprise
Paul Larsen The Value of Hybrid Integration
Alex Karcher 5 tips for production ready Azure Functions
DIBBs Brown Dog BDFiddle
.NET Core and Kubernetes
Presentation transcript:

Be Whisked Away with a Raspberry PI, Java, and OpenWhisk Luc Desrosiers Certified IT Architect Session CON2758

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…

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

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 …

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

What if I need to scale this? The transition from micro services… Service Discovery 1 Docker Container 1 Docker Container Microservice REST /HTTP VM REST /HTTP API VM App Servers Publish App Servers Microservice Microservice VM App Servers App Servers API Microservice Microservice Publish NodeJS instance NodeJS instance broker Subscribe What if I need to scale this? NodeJS instance Microservice NodeJS instance Microservice Microservice NodeJS instance

to serverless… Serverless technology handles the burst Service Discovery 1 Docker Container 1 Docker Container Microservice REST /HTTP VM REST /HTTP API VM Publish Microservice Microservice VM API serverless container Trigger Publish Action Serverless technology handles the burst Microservice broker Trigger What if I need to scale this? Subscribe Action Microservice Microservice

So what does it look like ? Event Actions are only alive for the duration of the execution! Trigger Action Trigger + Action = Rule

OpenWhisk Overview Language supported: NodeJS Swift Java Python Docker

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… Back-end as a Service Event Generator Serverless components UI Components

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 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 https://12factor.net/

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 Sequence Business Logic Action /whisk/push Backend Service API Gateway Trigger Web App Benefits: Clear delineation of business and controller logic Produces discreet reusable action that can be assembled as a sequence

The analytics platform Data processing pipeline Cloudant DB A IoT Events Quality Control Event Persister /whisk/cloudant Trigger Change Listener Data Enrichment Cloudant DB A /whisk/weather Change Feed Benefits: Database change can trigger other actions Functionality can be extended easily

The DevOps pipeline Benefits: Improve communication Sequence GitHub Business Logic Action /whisk/slack Backend Service Git Data Feed Benefits: Improve communication Clean extension to the build pipeline

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!

Now, how can you get started? Get familiar with the OpenWhisk command line interface Create a basic Java Action Deploy to Bluemix or locally

OpenWhisk Command Line Installing OpenWhisk CLI can be found here: https://new-console.ng.bluemix.net/openwhisk/cli 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 rue for triggering an action

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

What is available out of the box? Here are some of the provided package of actions and feed you can use to get started: Weather data slack github Cloudant Watson Push Notifications Alarms

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 Visual Recognition Send image & sensor data Change Listener Image Analysis Start & stop session Start Session IoT Tank Vision IoT Bridge Stop Session Save IoT data Watson IoT Foundation OpenWhisk

IoT tank – Communication Layer Sending events: Pi4J – GPIO Control IBM Watson IoT Foundation – IoT integration Cloudant – Image persistence JRPiCam – Pi Camera Control Receiving commands:

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! 

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

The inner-workings of OpenWhisk