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.

An intro to serverless and OpenWhisk for Kafka users

109 views

Published on

My talk from Kafka Summit London 2019. It's aimed at Kafka users who want to know what the serverless buzz is all about, with an explanation of what it's for, and a quick crash course in how to get started with Apache OpenWhisk.

Video at https://dalelane.co.uk/blog/?p=3769

Published in: Technology
  • DOWNLOAD FULL eBOOK INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookeBOOK Crime, eeBOOK Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL eBOOK INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. PDF eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc eBook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookeBOOK Crime, eeBOOK Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

An intro to serverless and OpenWhisk for Kafka users

  1. 1. © 2019 IBM Corporation Building serverless apps with Kafka Dale Lane An introduction to serverless with Apache OpenWhisk IBM Event StreamsApache Kafka @dalelane
  2. 2. © 2019 IBM Corporation Agenda § What is “serverless”? § Implementations § Apache OpenWhisk § Demos
  3. 3. © 2019 IBM Corporation What is “serverless”?
  4. 4. © 2019 IBM Corporation Serverless §An architectural pattern where your code is run: – in response to events – only on-demand on a per-request basis
  5. 5. © 2019 IBM Corporation Evolution of deployment patterns Monolith
  6. 6. © 2019 IBM Corporation Evolution of deployment patterns Microservice Microservice Microservice Monolith
  7. 7. © 2019 IBM Corporation Evolution of deployment patterns Function Function Function Function Function Function Function Function Microservice Microservice Microservice Monolith
  8. 8. © 2019 IBM Corporation Evolution of deployment patterns Bare metal Virtual machines Containers Orchestration Serverless
  9. 9. © 2019 IBM Corporation Function FaaS Platform PaaS Infrastructure IaaS Container CaaS Bare metal Evolution of deployment patterns
  10. 10. © 2019 IBM Corporation Definition github.com/cncf/wg-serverless
  11. 11. © 2019 IBM Corporation Definition github.com/cncf/wg-serverless
  12. 12. © 2019 IBM Corporation Definition applications that do not require server management applications bundled as one or more functions [developers] no longer need to spend time and resources on server provisioning, maintenance, updates, scaling and capacity planning
  13. 13. © 2019 IBM Corporation How is serverless different? Monolith Microservice Microservice Microservice Function Function Function Function Function Function Function Function
  14. 14. © 2019 IBM Corporation How is serverless different?
  15. 15. © 2019 IBM Corporation How is serverless different?
  16. 16. © 2019 IBM Corporation How is serverless different? £ $ € kr Fr ¥
  17. 17. © 2019 IBM Corporation Example use cases § Event processing § Data processing § Scheduled tasks § Scalable REST APIs
  18. 18. © 2019 IBM Corporation The Twelve Factor App
  19. 19. © 2019 IBM Corporation Serverless is good for: § Infrequent or sporadic demand § Focused, short duration processing § Highly dynamic workloads § Stateless workloads § Inconsistent demand § Scheduled infrequent tasks § Flexibility
  20. 20. © 2019 IBM Corporation Implementations
  21. 21. © 2019 IBM Corporation Implementations – platform
  22. 22. © 2019 IBM Corporation Implementations – platform
  23. 23. © 2019 IBM Corporation Implementations – platform
  24. 24. © 2019 IBM Corporation Implementations – platform
  25. 25. © 2019 IBM Corporation Implementations – platform
  26. 26. © 2019 IBM Corporation Implementations – hosted
  27. 27. © 2019 IBM Corporation Implementations – private cloud
  28. 28. © 2019 IBM Corporation Implementations – installable
  29. 29. © 2019 IBM Corporation Implementations s.cncf.io
  30. 30. © 2019 IBM Corporation Serverless framework serverless.com/framework
  31. 31. © 2019 IBM Corporation Apache OpenWhisk
  32. 32. © 2019 IBM Corporation OpenWhisk openwhisk.apache.org
  33. 33. © 2019 IBM Corporation OpenWhisk – who
  34. 34. © 2019 IBM Corporation OpenWhisk – where
  35. 35. © 2019 IBM Corporation OpenWhisk concepts
  36. 36. © 2019 IBM Corporation OpenWhisk concepts event
  37. 37. © 2019 IBM Corporation OpenWhisk concepts event action
  38. 38. © 2019 IBM Corporation OpenWhisk concepts event action function (eventobj) { // do something return result; }
  39. 39. © 2019 IBM Corporation OpenWhisk languages
  40. 40. © 2019 IBM Corporation OpenWhisk languages
  41. 41. © 2019 IBM Corporation OpenWhisk concepts event action
  42. 42. © 2019 IBM Corporation OpenWhisk concepts event actiontrigger
  43. 43. © 2019 IBM Corporation OpenWhisk concepts actiontrigger ruleevent
  44. 44. © 2019 IBM Corporation OpenWhisk concepts actionrule event actionrule actionrule actionrule trigger
  45. 45. © 2019 IBM Corporation OpenWhisk concepts rule event rule rule rule trigger trigger trigger trigger action event event event
  46. 46. © 2019 IBM Corporation OpenWhisk concepts actiontrigger ruleevent function main(params) { return { hello : 'world' }; } hello.js
  47. 47. © 2019 IBM Corporation OpenWhisk concepts actiontrigger ruleevent function main(params) { return { hello : 'world' }; } hello.js
  48. 48. © 2019 IBM Corporation OpenWhisk concepts actiontrigger ruleevent function main(params) { return { hello : 'world' }; } $ wsk action create helloworld hello.js ok: created action helloworld hello.js
  49. 49. © 2019 IBM Corporation OpenWhisk concepts actiontrigger ruleevent function main(params) { return { hello : 'world' }; } $ wsk action create helloworld hello.js ok: created action helloworld $ wsk action invoke helloworld ok: invoked /guest/helloworld with id 7df9c9dfbb hello.js
  50. 50. © 2019 IBM Corporation OpenWhisk actions blocking non-blocking
  51. 51. © 2019 IBM Corporation OpenWhisk actions blocking non-blocking periodic
  52. 52. © 2019 IBM Corporation OpenWhisk actions action action action
  53. 53. © 2019 IBM Corporation OpenWhisk concepts actiontrigger ruleevent
  54. 54. © 2019 IBM Corporation OpenWhisk implementation proxy
  55. 55. © 2019 IBM Corporation OpenWhisk implementation proxy controller
  56. 56. © 2019 IBM Corporation OpenWhisk implementation proxy controller store
  57. 57. © 2019 IBM Corporation OpenWhisk implementation proxy controller store service registry invoker
  58. 58. © 2019 IBM Corporation OpenWhisk implementation proxy controller store service registry invoker invoker invoker invoker invoker invoker
  59. 59. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  60. 60. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  61. 61. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  62. 62. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  63. 63. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  64. 64. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  65. 65. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  66. 66. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  67. 67. © 2019 IBM Corporation Container management start X init X X run X X X medium.com/openwhisk/squeezing-the-milliseconds-how-to-make-serverless-platforms-blazing-fast-aea0e9951bd0
  68. 68. © 2019 IBM Corporation Container management start X init X X run X X X medium.com/openwhisk/squeezing-the-milliseconds-how-to-make-serverless-platforms-blazing-fast-aea0e9951bd0
  69. 69. © 2019 IBM Corporation Container management start X init X X run X X X medium.com/openwhisk/squeezing-the-milliseconds-how-to-make-serverless-platforms-blazing-fast-aea0e9951bd0
  70. 70. © 2019 IBM Corporation Resource limits github.com/apache/incubator-openwhisk
  71. 71. © 2019 IBM Corporation Demos – installable
  72. 72. © 2019 IBM Corporation Deployment options
  73. 73. © 2019 IBM Corporation git clone https://github.com/apache/incubator-openwhisk-devtools.git cd incubator-openwhisk-devtools/docker-compose make quick-start
  74. 74. © 2019 IBM Corporation OpenWhisk event providers trigger ruleevent
  75. 75. © 2019 IBM Corporation cd incubator-openwhisk-devtools/docker-compose make create-provider-cloudant make create-provider-kafka
  76. 76. © 2019 IBM Corporation git clone https://github.com/apache/incubator-openwhisk-package-kafka.git cd incubator-openwhisk-package-kafka export OPENWHISK_AUTH=$OPENWHISK_HOME/ansible/files/auth.whisk.system ./installKafka.sh $OPENWHISK_AUTH $SYSTEM_IP_ADDR http://$SYSTEM_IP_ADDR:5984 local_ $SYSTEM_IP_ADDR
  77. 77. © 2019 IBM Corporation Demo
  78. 78. © 2019 IBM Corporation Demo event Message produced to Kafka topic MY.EVENTS
  79. 79. © 2019 IBM Corporation kafka-topics.sh --create --topic MY.EVENTS --replication-factor 1 --partitions 1 --zookeeper $SYSTEM_IP_ADDR:3181
  80. 80. © 2019 IBM Corporation Demo event Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger
  81. 81. © 2019 IBM Corporation wsk trigger create myKafkaTrigger -f /whisk.system/messaging/kafkaFeed -p brokers '["9.174.23.208:3092"]' -p topic MY.EVENTS
  82. 82. © 2019 IBM Corporation Demo event Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger
  83. 83. © 2019 IBM Corporation Demo event Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger sendToSlack action action
  84. 84. © 2019 IBM Corporation Demo event Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger sendToSlack action action
  85. 85. © 2019 IBM Corporation wsk action create sendToSlack slack-action.js
  86. 86. © 2019 IBM Corporation Demo event Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger sendToSlack action action
  87. 87. © 2019 IBM Corporation Demo ruleevent Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger slackOnKafkaMessages sendToSlack action action
  88. 88. © 2019 IBM Corporation wsk rule create slackOnKafkaMessages myKafkaTrigger sendToSlack
  89. 89. © 2019 IBM Corporation Demo ruleevent Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger slackOnKafkaMessages sendToSlack action action
  90. 90. © 2019 IBM Corporation
  91. 91. © 2019 IBM Corporation Reminder
  92. 92. © 2019 IBM Corporation Demos – using a hosted service
  93. 93. © 2019 IBM Corporation Demo Orders Voyages Ships Containers Alerts VoyagesOrder Order Management Microservice Fleet/Ships Simulator Microservice Voyages Management Microservice Kafka Streams Kafka
  94. 94. © 2019 IBM Corporation
  95. 95. © 2019 IBM Corporation Demo
  96. 96. © 2019 IBM Corporation Demo ruleevent Message produced to Kafka topic “alerts” kafkaAlert trigger processAlert action action
  97. 97. © 2019 IBM Corporation
  98. 98. © 2019 IBM Corporation Demo ruleevent Message produced to Kafka topic “alerts” kafkaAlert trigger processAlert action action
  99. 99. © 2019 IBM Corporation Orders Voyages Ships Containers Alerts VoyagesOrder Order Management Microservice Fleet/Ships Simulator Microservice Voyages Management Microservice Kafka Kafka Streams
  100. 100. © 2019 IBM Corporation Summary
  101. 101. © 2019 IBM Corporation Summary / roundup §An architectural pattern where your code is run: – in response to events – only on-demand on a per-request basis
  102. 102. © 2019 IBM Corporation Getting started twitter.com/openwhisk medium.com/openwhisk slack.openwhisk.org youtube.com/channel/UCbzgShnQk8F43NKsvEYA1SA #openwhisk developer.ibm.com/code/patterns/category/serverless serverlessconf.io
  103. 103. © 2019 IBM Corporation Thank you Dale Lane Software Engineer, IBM Event Streams IBM Event Streams - ibm.com/cloud/event-streams https://slack-invite-ibm-cloud-tech.mybluemix.net/

×