Top Banner
serverlessconf.io IBM Bluemix OpenWhisk The Future of Cloud Programming: Event-driven and Serverless Computing with OpenWhisk Michael Behrendt, Chief Architect Bluemix Core Platform @michael_beh Dr. Andreas Nauerz, Technical Offering Manager @AndreasNauerz
18

Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

Apr 16, 2017

Download

Software

ServerlessConf
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

serverlessconf.io

IBM Bluemix OpenWhisk The Future of Cloud Programming: Event-driven and Serverless Computing with OpenWhisk Michael Behrendt, Chief Architect Bluemix Core Platform @michael_beh Dr. Andreas Nauerz, Technical Offering Manager @AndreasNauerz

Page 2: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

Motivation & Project History

•  Observation: – Early days of serverless & event-driven – Mix of business user vs. developer-focused efforts.

What are commonalities?

•  Initiated project with IBM Research (programming model group) vs. product dev from day 1

2

Page 3: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

Agenda

• Motivation & Approach • What is OpenWhisk? •  Usage scenarios • OpenWhisk programming model •  Demo

3

Page 4: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

Region B Region A

Challenges with Microservices & traditional runtimes

4

Break-down into microservices

Make each micro service HA

Protect against regional outage

Explosion of # of containers / processes

à Increase of infrastructure cost footprint

à Increase of operational mgmt cost & complexity

Monolithic application Monolithic application Monolithic application Monolithic application

Page 5: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

„Serverless, event-driven platform to execute code in response to events“

Delivered as... 1. Open Source 2. Managed service in IBM Bluemix

OpenWhisk in a nutshell

whisk (v) : to move nimbly and quickly. Source: merriam-webster.com

Page 6: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

Design principles & technical approach

1. Open interface for event providers 2. Polyglot support 3. Support higher-level programming constructs as appropriate (e.g. sequencing) 4. Scales on a per-request basis 5. Enable sharing of actions & event providers

•  Implementation –  Started in node, switched to Scala

•  Leverages Docker, Kafka, consul, Akka, …

•  Apache 2 license

6

Page 7: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

Traditional model

Swift

Application

Container! VM CF!

2

Polling

1b

Request

1a •  Continous polling due to missing event programming model

•  Charged even when idling •  Worry about scaling

Process & idle

Page 8: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

OpenWhisk – execution model

•  Introduces event programming model •  Charges only for what is used •  Scales inherently

Pool of actions

Swift! Docker JS!

Trigger

1

Running action

Running action

Running action

3

Deploy action within millisecs, run it, free up resources

OpenWhisk Engine

2

Page 9: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

OpenWhisk: How does it work?

} 1

Event Providers

OpenWhisk

Cloudant

Git

Weather

Data event occurs, e.g. - Commit on a Git Repository - CRUD operation on Cloudant - ….

Trigger execution of associated OpenWhisk action

2

… JS Swift! Docker …

Variety of languages

Page 10: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

OpenWhisk: How does it work?

OpenWhisk

JS Swift! Docker …

Incoming HTTP request, e.g. HTTP POST mynewcoolapp.com/customers

1 2 Invoke associated OpenWhisk action Browser

Mobile App

Web App

Page 11: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

Usage Scenarios

•  Microservices-based apps / APIs

•  Mobile Backends

•  Data (Stream) Processing

•  IoT

•  Cognitive

•  Bots 11

Page 12: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

OpenWhisk as an alternative compute model in Bluemix

12

“Making containers a first class citizen of OpenWhisk is very interesting, and a move which takes the direction of serverless architectures into many potentially new directions and combinations.” – RedMonk*

abstraction Full stack control

Page 13: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

Programming model

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

•  The developer only needs to care about implementing the desired application logic - the system handles the rest

T R A

Page 14: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

OpenWhisk – architectural concepts

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 (and potentially other abstractions going forward)

Page 15: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

Demo

Page 16: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

Summary

•  Actions are executed, blocking or non-blocking, in response to events or timer-based (cron syntax, 1s granularity)

•  Actions can be in Node, Swift, or Docker containers to execute custom logic… and there is more to come

•  Actions can be chained to compose powerful solutions •  Event Providers can be added via packages • Out of the box support for event sources such as Cloudant (couchDB),

Github, … •  Tooling comprised of CLI, REST API, and iOS SDK

Page 17: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

How can I get my hands on OpenWhisk?

1.  Want to try out our IBM Bluemix OpenWhisk offering? •  Sign-up today at: https://new-console.ng.bluemix.net/openwhisk/

2.  Want to try out the open-source OpenWhisk project? •  Visit: https://github.com/openwhisk/openwhisk/

17

Page 18: Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming with OpenWhisk

Thank you

@michael_beh @AndreasNauerz