openwhisk introduction

39
IBM Bluemix OpenWhisk New York City Bluemix Meetup Ioana Baldini Research Staff Member, IBM Research

Upload: ioana-baldini

Post on 08-Jan-2017

165 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: OpenWhisk Introduction

IBM Bluemix OpenWhiskNew York City Bluemix Meetup

Ioana BaldiniResearch Staff Member, IBM Research

Page 2: OpenWhisk Introduction

Please Note:

2

• IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion.

• Information regarding potential future products is intended to outline our general product direction and it should not be relied on in making a purchasing decision.

• The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future products may not be incorporated into any contract.

• The development, release, and timing of any future features or functionality described for our products remains at our sole discretion.

• Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user’s job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.

Page 3: OpenWhisk Introduction

Agenda

• OpenWhisk in a nutshell• What OpenWhisk is and how it works• Usage scenarios• OpenWhisk programming model• OpenWhisk architecture• Live demo• Summary & Questions

3

Page 4: OpenWhisk Introduction

OpenWhisk in a nutshell

Cloud platform to execute code in response to events

Page 5: OpenWhisk Introduction

Whisk in a nutshellServerless deployment & operations modelWe hide infrastructural and operational complexity allowing you to focus on coding: You provide code – we execute it! – FaaS = Function as a Service

Optimal utilization, fair pricing at any scaleWe provide you exactly the resources you need – neither less nor more - and charge you only for code really being executed

Flexible programming model & powerful toolingWe support multiple languages (incl. Swift) and custom logic via docker containers, plus tools to declaratively chain your code snippets

Open & open ecosystenOpen to run anywhere to avoid any kind of vendor lock-in and to accelerate the development of a powerful ecosystem

Page 6: OpenWhisk Introduction

Execute app logic in response to data triggers

Execute app logic in response to sensed data (IoT)

Execute app logic in response to cognitive trends

Execute app logic in response to scheduled tasks

Provide easy server-side backend for mobile app

Typical Scenarios

Page 7: OpenWhisk Introduction

OpenWhisk: Another way to build apps…

BYOC: Bring Your Own Code

Ease of getting started Full stack Control

OpenWhisk

Event-driven appsdeployed in a

serverless environment

Instant Runtimes

App-centric runtimes based on

Cloud Foundry

IBM Containers

Portable delivery of your app

without having to manage an OS

Virtual Machines

Most flexibility and control

with VMs

Page 8: OpenWhisk Introduction

Meet Dave & his team

Dave is lead architect of an online photo community and marketplace– Operate a platform to

– share and photos– edit and categorize photos via manual tagging

8

Page 9: OpenWhisk Introduction

Meet Dave & his team

To be competitive, Dave‘s team need to continously add innovative features– Idea: Provide a mobile app that allows to automatically sharpen, noise-

reduce and semantically tag photos being uploaded

9

Page 10: OpenWhisk Introduction

Design requirements

Dave & his team want to focus on developing value-adding code instead of low-level infrastructural & operational details

Page 11: OpenWhisk Introduction

OpenWhisk solution

Flexible programming environment Open ecosystem of building blocks Outsource computing tasks to the cloud No servers to manage or maintain Automatic scaling with load Built-in fault tolerance Pay as you go

Page 12: OpenWhisk Introduction

Some usage Scenarios

OpenWhisk can help power various mobile, web and IoT app usecases by simplifying the programming model of orchestrating various services using events without a dedicated backend.

Digital app workloads Big Data/Analytics pipelineComplex data pipeline for Big Data/Analytics tasks can be scripted using changes in data services or streams for near real-time analytics and feedback.

DevOps & infrastructure as code

OpenWhisk can be used to automate DevOps pipeline based on events triggered from successful builds or completed staging or a go-live event.

Micro-Services builder

Whisk can be used to easily build micro-services given the footprint and programming model desired by micro services

Page 13: OpenWhisk Introduction

OpenWhisk: How does it work?

Incoming HTTP request, e.g.HTTP GET

coolapp.com/customers

1

Invoke OpenWhisk action getCustomers

Browser

Mobile App

Web App Variety of languages

2

JS Swift Docker …

OpenWhisk

Page 14: OpenWhisk Introduction

OpenWhisk: How does it work?

Event Providers

Cloudant

Git

Weather

Trigger execution of associated OpenWhisk action

2

…JS Swift Docker …

Data event occurs, e.g. commit on a Git repository, CRUD operation on Cloudant

1

OpenWhisk

Page 15: OpenWhisk Introduction

Programming model

Services define the events they emit as triggers, and developers associate the actions to handle the events via rules

T A R

Page 16: OpenWhisk Introduction

Programming model

Trigger: A class of events that can happenT

Page 17: OpenWhisk Introduction

Programming model

Actions: Code that runs in response to an event (event-handler)A

Page 18: OpenWhisk Introduction

Programming model

Actions: Multi-runtime support, e.g. JavaScript, Python, Java, SwiftA

function main(msg) {return { message: 'Hello, ' + msg.name + ' from ' +

msg.place };};

Page 19: OpenWhisk Introduction

Programming model

Actions: Multi-runtime support, e.g. Docker containersA

Page 20: OpenWhisk Introduction

Programming model

Actions: Can be chained to create sequences to increase flexibility and foster reuse

A

AA := A1 + A2 + A3

AB := A2 + A1 + A3

AC := A3 + A1 + A2

Page 21: OpenWhisk Introduction

Programming model

Rules: An association of a trigger and an actionR

R := T A

Page 22: OpenWhisk Introduction

Programming model

Packages: A shared collection of triggers and actionsP

A

A read

write

T changes A translate A forecast

A post

T topic

OpenSource A myAction

T myFeed

Yours

T commit

ThirdParty

Page 23: OpenWhisk Introduction

OpenWhisk Core – System Architecture

23

Edge

Proxy

Log Forwarder

UI

Consul

Registrator

Log Forwarder

EntitlementController

E

Registrator

Log Forwarder

Invoker

Master

Page 24: OpenWhisk Introduction

Live demo

Page 25: OpenWhisk Introduction

Slack Slash Command: /wsk

/wsk [action-name [parameter-name parameter-value]*]

/wsk hello_world message Ioana

Page 26: OpenWhisk Introduction

Architecture

async

blocking

wsk slash command api proxy action dispatch

action

slack response

Page 27: OpenWhisk Introduction

Slack Slash Command

Page 28: OpenWhisk Introduction

APIGee API Proxy

Page 29: OpenWhisk Introduction

OpenWhisk Action Dispatch

Page 30: OpenWhisk Introduction

Summary• OpenWhisk…

– allows you to focus on developing value-adding code– provides you with a flexible programming model for small agile teams– provides you with access to an open ecosystem of building blocks– allows you to compose powerful solutions using modern abstraction and

chaining– allows you to share and reuse what you have build– allows you to outsource load & calculation intensive tasks– only charges you for what you really use– is available as open solution in which you can participate

Page 31: OpenWhisk Introduction

Summary• What else have we seen & learnt?

– Actions are executed, blocking or non-blocking, in response to events – Actions can be in Node, Swift, or even Docker containers to execute

custom logic… and there is more to come– Actions can even be chained to compose powerful solutions– Out of the box support for event sources such as Cloudant and Github

as well as scheduled actions– Tooling comprised of CLI, REST API, and iOS SDK

• What have we not seen? Complexity!

Page 32: OpenWhisk Introduction

Questions?

Page 33: OpenWhisk Introduction

Notices and Disclaimers

33

Copyright © 2016 by International Business Machines Corporation (IBM). No part of this document may be reproduced or transmitted in any form without written permission from IBM.

U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM.

Information in these presentations (including information relating to products that have not yet been announced by IBM) has been reviewed for accuracy as of the date of initial publication and could include unintentional technical or typographical errors. IBM shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT OR LOSS OF OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the agreements under which they are provided.

Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without notice.

Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary.

References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which IBM operates or does business.

Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not necessarily reflect the views of IBM. All materials and discussions are provided for informational purposes only, and are neither intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation.

It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal counsel as to the identification and interpretation of any relevant laws and regulatory requirements that may affect the customer’s business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or represent or warrant that its services or products will ensure that the customer is in compliance with any law

Page 34: OpenWhisk Introduction

Notices and Disclaimers Con’t.

34

Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products in connection with this publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

The provision of the information contained h erein is not intended to, and does not, grant any right or license under any IBM patents, copyrights, trademarks or other intellectual property right.

IBM, the IBM logo, ibm.com, Aspera®, Bluemix, Blueworks Live, CICS, Clearcase, Cognos®, DOORS®, Emptoris®, Enterprise Document Management System™, FASP®, FileNet®, Global Business Services ®, Global Technology Services ®, IBM ExperienceOne™, IBM SmartCloud®, IBM Social Business®, Information on Demand, ILOG, Maximo®, MQIntegrator®, MQSeries®, Netcool®, OMEGAMON, OpenPower, PureAnalytics™, PureApplication®, pureCluster™, PureCoverage®, PureData®, PureExperience®, PureFlex®, pureQuery®, pureScale®, PureSystems®, QRadar®, Rational®, Rhapsody®, Smarter Commerce®, SoDA, SPSS, Sterling Commerce®, StoredIQ, Tealeaf®, Tivoli®, Trusteer®, Unica®, urban{code}®, Watson, WebSphere®, Worklight®, X-Force® and System z® Z/OS, are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.

Page 35: OpenWhisk Introduction

Thank You Your Feedback is Important!

http://[email protected]

Page 36: OpenWhisk Introduction

Backup

Page 37: OpenWhisk Introduction

OpenWhisk: Comparison to traditional models• OpenWhisk

– Introduces event programming model– Charges only for what is used– Auto-scales Pool of actions

Swift DockerJS

Trigger

1

Running action

Running action

Running action

3

Deploy action within millisecs,run it, free up resources

OpenWhisk Engine

2

Page 38: OpenWhisk Introduction

Marchitecture

Trigger

Package

Feed

Package

Feed

Package

Feed

Package

Feed

REST

CLI iOS SDK

CRUD triggers, actions, and rulesInvoke 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

Page 39: OpenWhisk Introduction

39

Edge

Proxy

Log Forwarder

UI

Consul

Registrator

Log Forwarder

EntitlementController

E

Registrator

Log Forwarder

Invoker

Master