Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Developing Serverless Applications with Apache OpenWhisk


Published on

Niklas Heidloff

Sample Application


IBM Cloud Functions

Published in: Software
  • Be the first to comment

Developing Serverless Applications with Apache OpenWhisk

  1. 1. Developing Serverless Applications with Apache OpenWhiskNiklas Heidloff Developer Advocate, IBM @nheidloff April 2018
  2. 2. Agenda Disclaimers 1)  Introduction to Serverless 2)  Development of Serverless Functions 3)  Development of Serverless Applications @nheidloff Most information in this session is about Apache OpenWhisk, some features are only available in IBM Cloud Functions – indicated on slides via icons Focus is on development related topics, not on operations
  3. 3. Serverless “Serverless computing is a cloud computing execution model in which the cloud provider dynamically manages the allocation of machine resources. Pricing is based on the actual amount of resources consumed by an application.” (via Wikipedia) Sample scenario: Serverless Web Application @nheidloff
  4. 4. Use Cases @nheidloff Volatile and/or event-driven workload that can be split in smaller short-running pieces APIs Data processing Event processing
  5. 5. Apache OpenWhisk “Apache OpenWhisk is a serverless, open source cloud platform that executes functions in response to events without developer concern for managing the lifecycle or operations of the containers that execute the code.” (via Apache) Supported runtimes: Node.js, Python, PHP, Swift and Docker Deployment: On-premises or in the cloud @nheidloff
  6. 6. Apache OpenWhisk Supported runtimes: Node.js, Python, PHP, Swift and Docker Development Local development via standard tooling and IDEs Web tooling provided by cloud providers @nheidloff
  7. 7. JavaScript Function @nheidloff
  8. 8. Asynchronous JavaScript Function @nheidloff
  9. 9. JavaScript Function with Dependencies @nheidloff
  10. 10. JavaScript Function in Docker @nheidloff
  11. 11. Debugging JavaScript Functions in Docker @nheidloff
  12. 12. Function Invocation via CLI @nheidloff
  13. 13. Function Invocation via HTTP @nheidloff
  14. 14. Function Invocation via HTTP @nheidloff
  15. 15. API Management @nheidloff
  16. 16. API Management @nheidloff
  17. 17. API Management @nheidloff
  18. 18. API Management @nheidloff
  19. 19. Serverless Applications @nheidloff Development of single functions is easy, but how do you build cloud-native applications with lots of functions? Functions are stateless, applications have state “There is no such thing as a stateless architecture, it’s just someone else’s problem” (via Jonas Bonér)
  20. 20. OpenWhisk Conductor Functions @nheidloff Conductor functions allow invoking a series of functions
  21. 21. Composer Composer is a new programming model for composing functions, built on Apache OpenWhisk Declarative and programmatic approach to define sophisticated flows between functions in cloud-native apps State management between ‘stateless’ functions based on OpenWhisk Conductor Actions@nheidloff
  22. 22. Sample Application: Send Notification 1)  Application is triggered with a person id and a subject 2)  First function returns the profile for the specific user with an email address and optionally a phone number 3)  If the profile has a phone number, a text message is sent, otherwise an email @nheidloff
  23. 23. Sample Application @nheidloff Visualized in IBM Cloud Functions Shell
  24. 24. Sample Application Polyglot JavaScript TypeScript Java Kotlin @nheidloff
  25. 25. Sample Invocation via CLI @nheidloff
  26. 26. Invocation Results @nheidloff Visualized in IBM Cloud Functions Shell
  27. 27. Session Flow @nheidloff Visualized in IBM Cloud Functions Shell
  28. 28. JavaScript Function in Visual Studio Code @nheidloff
  29. 29. TypeScript Function in Visual Studio Code @nheidloff
  30. 30. Java Function in Eclipse @nheidloff
  31. 31. Kotlin Function in IntelliJ IDEA @nheidloff
  32. 32. Composer Application @nheidloff
  33. 33. Composer Programming Constructs @nheidloff
  34. 34. Activity @nheidloff
  35. 35. Summary @nheidloff Apache OpenWhisk is an open source serverless platform OpenWhisk functions can be developed via Docker OpenWhisk can used in the cloud and on-premises IBM Cloud Functions is based on OpenWhisk and adds ... API management Composer to build cloud-native applications Try out OpenWhisk and Cloud Functions:
  36. 36. Resources Sample Application OpenWhisk IBM Cloud Functions @nheidloff