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
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
Agenda •  Motivation & Approach •  What is OpenWhisk? •  Usage scenarios •  OpenWhisk programming model •  Demo 3
Region BRegion 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 applicationMonolithic applicationMonolithic applicationMonolithic application
„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
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
Traditional model Swift Application Container! VMCF! 2 Polling 1b Request 1a•  Continous polling due to missing event programming model •  Charged even when idling •  Worry about scaling Process & idle
OpenWhisk – execution model •  Introduces event programming model •  Charges only for what is used •  Scales inherently 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
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
OpenWhisk: How does it work? OpenWhisk JS Swift! Docker … Incoming HTTP request, e.g. HTTP POST mynewcoolapp.com/customers 1 2 Invoke associated OpenWhisk actionBrowser Mobile App Web App
Usage Scenarios •  Microservices-based apps / APIs •  Mobile Backends •  Data (Stream) Processing •  IoT •  Cognitive •  Bots 11
OpenWhisk as an alternative compute model in Bluemix 12 abstraction Full stack control
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
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)
Demo
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
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
Thank you @michael_beh @AndreasNauerz

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

  • 1.
    serverlessconf.io IBM Bluemix OpenWhisk TheFuture 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
  • 2.
    Motivation & ProjectHistory •  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
  • 3.
    Agenda •  Motivation &Approach •  What is OpenWhisk? •  Usage scenarios •  OpenWhisk programming model •  Demo 3
  • 4.
    Region BRegion A Challengeswith 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 applicationMonolithic applicationMonolithic applicationMonolithic application
  • 5.
    „Serverless, event-driven platformto 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
  • 6.
    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
  • 7.
    Traditional model Swift Application Container! VMCF! 2 Polling 1b Request 1a• Continous polling due to missing event programming model •  Charged even when idling •  Worry about scaling Process & idle
  • 8.
    OpenWhisk – executionmodel •  Introduces event programming model •  Charges only for what is used •  Scales inherently 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
  • 9.
    OpenWhisk: How doesit 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
  • 10.
    OpenWhisk: How doesit work? OpenWhisk JS Swift! Docker … Incoming HTTP request, e.g. HTTP POST mynewcoolapp.com/customers 1 2 Invoke associated OpenWhisk actionBrowser Mobile App Web App
  • 11.
    Usage Scenarios •  Microservices-basedapps / APIs •  Mobile Backends •  Data (Stream) Processing •  IoT •  Cognitive •  Bots 11
  • 12.
    OpenWhisk as analternative compute model in Bluemix 12 abstraction Full stack control
  • 13.
    Programming model •  Servicesdefine 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
  • 14.
    OpenWhisk – architecturalconcepts 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)
  • 15.
  • 16.
    Summary •  Actions areexecuted, 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
  • 17.
    How can Iget 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
  • 18.