ibm bluemix openwhisk: cloud foundry summit 2016, frankfurt, germany: the future of cloud...

75
Serverless and Event-driven Applications with Cloud Foundry and OpenWhisk Andrei Yurkevich (@yurkvch) Chief Technology Officer Andreas Nauerz (@AndreasNauerz) Technical Product Manager

Upload: openwhisk

Post on 16-Apr-2017

304 views

Category:

Software


1 download

TRANSCRIPT

Page 1: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

Serverless and Event-driven Applications with Cloud Foundry and OpenWhisk

Andrei Yurkevich (@yurkvch)Chief Technology Officer

Andreas Nauerz (@AndreasNauerz)Technical Product Manager

Page 2: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

@altoros

@yurkvch

WHAT WE DOAltoros brings “software assembly lines” into organizationsthrough integration of solutions offered by the Cloud Foundry ecosystem.

TRAINING:

FOR OPERATORS FOR DEVELOPERS

DEVELOPER ADOPTION

CONSULTING

PROOF OF CONCEPT

& IMPLEMENTATION

APP DEVELOPMENT & MICROSERVICES

2

POPULARPOPULAR

Delivered by partners:

Delivered by Altoros:

Page 3: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

@altoros

@yurkvch

WHO WE AREAltoros offices Delivery partner in APAC

3

Minsk, BY

Oslo, NO

Sunnyvale, CA

(HQ)Chicopee,

MA

London, UK

Espoo, FI

Buenos Aires, ARSanta Fe,

AR

Tokyo, JP

Silkeborg, DK

Zurich, CH

Taby, SE

Page 4: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

4

We will tell you about…

● Why we need event-driven infrastructure

Page 5: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

5

We will tell you about…

● Why we need event-driven infrastructure

● Requirements for event-driven infrastructure

Page 6: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

6

We will tell you about…

● Why we need event-driven infrastructure

● Requirements for event-driven infrastructure

● Introducing OpenWhisk

Page 7: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

7

We will tell you about…

● Why we need event-driven infrastructure

● Requirements for event-driven infrastructure

● Introducing OpenWhisk

● OpenWhisk and CloudFoundry

Page 8: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

8

We will tell you about…

● Why we need event-driven infrastructure

● Requirements for event-driven infrastructure

● Introducing OpenWhisk

● OpenWhisk and CloudFoundry

● Demo

Page 9: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

9

Welcome to Industrial internet!

Page 10: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

10

Devices can be...

Page 11: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

11

How would you implement it?

Page 12: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

12

OK, let’s move step by step

Page 13: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

13

And if you want it to be HA?

Page 14: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

14

What about another device?

Page 15: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

15

Let’s be smart!

Page 16: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

16

An unexpected spike!

Page 17: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

17

Scaling out!

Page 18: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

18

And traffic goes down...

Page 19: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

19

An excessive compute?

Page 20: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

20

Or maybe those ones?

Page 21: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

21

And in the meantime...

Page 22: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

22

And further down...

Page 23: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

23

And...

Page 24: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

24

One process, one container

Page 25: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

25

One process, one container

Page 26: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

26

But if we don’t scale fast...

How much does it cost?

Page 27: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

27

Ideal case

Page 28: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

28

Compute follows traffic

Page 29: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

29

Compute follows traffic

Page 30: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

30

So what are the requirements?

● Invoke and scale as fast as possible● Terminate after completion

Page 31: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

31

So what are the requirements?

● Invoke and scale as fast as possible● Terminate after completion● Charge per compute used

Page 32: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

32

So what are the requirements?

● Invoke and scale as fast as possible● Terminate after completion● Charge per compute used● Guaranteed message delivery● Load balancing

Page 33: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

33

So what are the requirements?

● Invoke and scale as fast as possible● Terminate after completion● Charge per compute used● Guaranteed message delivery● Load balancing● High availability● Self-healing

Page 34: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

34

So what are the requirements?

● Invoke and scale as fast as possible● Terminate after completion● Charge per compute used● Guaranteed message delivery● Load balancing● High availability● Self-healing

● Support of multiple technologies

● Have possibility to launch other microservices

● Write and read data from multiple data sources

Page 35: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

35

So what are the requirements?

● Invoke and scale as fast as possible● Terminate after completion● Charge per compute used● Guaranteed message delivery● Load balancing● High availability● Self-healing

● Support of multiple technologies

● Have possibility to launch other microservices

● Write and read data from multiple data sources

● Abstract developers from the infrastructure

Page 36: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

Yorktown, NY

OpenWhisk in a nutshell

Raleigh, NCAustin, TX

Boeblingen, Germany

Serverless computing in general and OpenWhisk in particular is regarded an important effort 31

Page 37: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

37

OpenWhisk in a nutshell

„Event-action platform to execute code in response to events“

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

Page 38: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

38

OpenWhisk in a nutshell

„Event-action platform to execute code in response to events“

Delivered as open source & managed service on IBM Bluemix

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

Page 39: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

39

OpenWhisk in a nutshell

Serverless deployment & operations model

Page 40: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

40

OpenWhisk in a nutshell

Serverless deployment & operations model

Optimal utilization & granular pricing

Page 41: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

41

OpenWhisk in a nutshell

Serverless deployment & operations model

Optimal utilization & granular pricing

Scales on a per-request basis

Page 42: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

42

OpenWhisk in a nutshell

Serverless deployment & operations model

Optimal utilization & granular pricing

Flexible programming model

Supports higher-level programming constructs (e.g. sequencing)

Scales on a per-request basis

Polyglot support

Page 43: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

43

OpenWhisk in a nutshell

Serverless deployment & operations model

Optimal utilization & granular pricing

Flexible programming model

Open (Apache 2) & open ecosystem

Supports higher-level programming constructs (e.g. sequencing)

Open interface for event providers

Scales on a per-request basis

Polyglot support

Leverages Docker, Kafka, Consul, …

Page 44: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

44

OpenWhisk in a nutshell

Serverless deployment & operations model

Optimal utilization & granular pricing

Flexible programming model

Open (Apache 2) & open ecosystem

Supports higher-level programming constructs (e.g. sequencing)

Open interface for event providers

Scales on a per-request basis

Polyglot support

Implemented in Scala

Leverages Docker, Kafka, Consul, …

Page 45: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

Swift

Application

Container VMCF

2

Polling

1b

Request

1a

Traditional model

• Continous polling due to missing event programming model

• Charges even when idling due to poor utilization

Process & idle

Page 46: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

Swift

Application

Container VMCF

2

Polling

1b

Request

1a

Traditional model

• Continous polling due to missing event programming model

• Charges even when idling due to poor utilization

• Worry about scaling- When to scale? (mem-, cpu-, response time-driven)- How fast to scale?

Process & idle

Page 47: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

Swift

Application

Container VMCF

2

Polling

1b

Request

1a

Traditional model

• Continous polling due to missing event programming model

• Charges even when idling due to poor utilization

• Worry about scaling- When to scale? (mem-, cpu-, response time-driven)- How fast to scale?

• Worry about resiliency- At least 2 processes for HA (driving cost)- Deployment in multiple regions (driving cost)- Keep them running & healthy

Process & idle

Page 48: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

OpenWhisk

• Introduces event programming model• Charges only for what is used due to optimal

utilization 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 49: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

OpenWhisk

• Introduces event programming model• Charges only for what is used due to optimal

utilization

• Scales inherently- One process per request

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 50: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

OpenWhisk

• Introduces event programming model• Charges only for what is used due to optimal

utilization

• Scales inherently- One process per request

• No cost overhead for resiliency- No long running process for HA

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 51: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

} 1

Event Providers

OpenWhisk

Cloudant

Push Notifcations

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

Trigger execution of associated OpenWhisk action

2

…JS Swift Docker …

Page 52: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

OpenWhisk

JS Swift Docker …

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

1 2 Invoke associated OpenWhisk action „getCustomers“

Browser

Mobile App

Web App

Variety of languages

Page 53: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

• 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 54: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

Trigger: „A class of events that can happen“T

Page 55: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

A Actions: „An event-handler, i.e. code that runs in response to an event“

Page 56: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

A

AA:= A1

+ A2+ A3

AB:= A2

+ A1+ A3

AC:= A3

+ A1+ A2

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

Page 57: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

R

R := T A

Rules: „An association of a trigger and an action“

Page 58: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

myActionmyFeedT

A

Packages: „A shared collection of triggers and actions“P

A forecast

OpenSource YoursThird

Party

translatelanguageIdtextToSpeechA

AA

databaseCreatedocumentRead...changesT

AAA

Push Notifications

sendMessagewebhookT

A

webhookT

postA

WebsocketsendA

Page 59: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

You want to try OpenWhisk on your own?

Page 60: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

You want to try OpenWhisk on your own?

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

Page 61: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

OpenWhisk in a nutshell

You want to try OpenWhisk on your own?

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

• Want to try out our open-source OpenWhisk offering?Visit: https://developer.ibm.com/openwhisk/

Page 62: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

62

Demo time!

http://bit.ly/1Uw6OP3

Page 63: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

63

I will show you...

Page 64: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

64

How did it work?

https://developer.ibm.com/openwhisk/2016/04/01/ibm-bluemix-openwhisk-whats-under-the-hood/

Page 65: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

65

Another prospective

Page 66: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

@yurkvch @altoros 6

6

Cloud Foundry and OpenWhisk

Page 67: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

67

I can’t use OpenWhisk on Bluemix because

Vendor lock-in

Page 68: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

68

I can’t use OpenWhisk on Bluemix because

Vendor lock-inAll my data is (in local datacenter)

Page 69: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

69

I can’t use OpenWhisk on Bluemix because

Vendor lock-inAll my data is (in local datacenter)

We implement a hybrid strategy

Page 70: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

70

I can’t use OpenWhisk on Bluemix because

Vendor lock-inAll my data is (in local datacenter)

We implement a hybrid strategy

We don’t use Bluemix at...

Page 71: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

71

I can’t use OpenWhisk on Bluemix because

Vendor lock-inAll my data is (in local datacenter)

We implement a hybrid strategy

We don’t use Bluemix at...

I need to have the compute device on the network edge

Page 72: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

72

I can’t use OpenWhisk on Bluemix because

Vendor lock-inAll my data is (in a local data center)

We implement a hybrid strategy

We don’t use Bluemix at...

I need to have the compute device on the network edge

Security!

Page 73: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

73

https://github.com/openwhisk

Page 74: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

altoros.comblog.altoros.com

developer.ibm.com/openwhisk

74

@yurkvch@altoros

Questions? @AndreasNauerz@OpenWhisk

Page 75: IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Future of Cloud Programming

altoros.comblog.altoros.com

developer.ibm.com/openwhisk

75

@yurkvch@altoros

Thank you! @AndreasNauerz@OpenWhisk