Botless:无服务器 Chatbot 框架

Botless 是一个无服务器驱动的 CloudEvents 连接的 Chatbot 框架。本次演讲将介绍 chatbot 框架,并描述使用与云供应商所不知的新兴计算和事件技术来构建高度可扩展的应用程序的方法。

1. Scott Nichols n3wscott Software Engineer Google Botless: Building a Serverless Chatbot Framework

2.We are going to build the botless framework together, right now. We will optimize for price, and flexibility of extensions. 2

3.Collect Requirements 3

4./uptime 128 Days! 4

5./define crd CRD stands for Custom Resource Definition. 5




9. No servers Elastic Portable Serverless Service-based Event-driven Pay only for usage 9


11. ------------- ---------- ------------ Standardize </> </> </> </> ------ -------- --------- 11


13.Knative Building blocks for serverless workloads on Kubernetes [kay-native] 13

14.Knative project ● Set of primitives (build, events, serving...) ● Solves for modern development patterns ● Implements learnings from Google, partners ● Ingredient or platform for Serverless 14

15.Knative collaboration 15

16.Knative enabled Serverless Containers on GCF GKE Serverless Add-on SAP Kyma Products Pivotal Function Service IBM Cloud Functions Red Hat Cloud Functions Pivotal riff OpenFaaS T-mobile Jazz Primitives Build Serving Eventing ... Platform Kubernetes 16

17.General Architecture 17

18.Chat Adapter Bot Action Botless Knative Kubernetes 18

19. Receive Chat Server Parser Registry Adapter Command X Command Y 19

20. Receive Chat Server Adapter Chat Server Protocol. Outputs chat messages in to Chat Message Cloud Event. 20

21.CloudEvents a specification for describing event data in a common way. 21

22. { "cloudEventsVersion" : "0.1", "eventType" : "com.example.someevent", CloudEvents "source" : "", "eventID" : "A234-1234-1234", "eventTime" : "2018-04-05T17:31:00Z", "contentType" : "text/xml", "data" : "<much wow=\"xml\"/>" } 22

23. Receive Chat Server Chat Source Adapter 23

24. apiVersion: kind: ChatSource metadata: name: example-chat-source spec: Chat Receive server: Server Adapter host: auth: username: botless password: ref: name: botless-chatserver key: botlessCredentials Chat Source sink: apiVersion: kind: Channel name: msg 24

25.Chat Server Chat Source Parser Registry Command X Command Y 25

26.Chat Source Parser Registry Command X Command Y 26

27. Knative, principled eventing objects Eventing constructs : ● sources (producer) sources ● Channel (delivery) ● Subscription (linkage) Channel ● callable (custom functions) Subscription callable Channel 27

28.Knative, channels apiVersion: kind: Channel metadata: name: k8ssource Channel spec: provisioner: name: default 28

29.Knative, subscriptions apiVersion: kind: Subscription metadata: name: sub-example namespace: default spec: channel: apiVersion: kind: Channel Channel name: upstream-channel subscriber: ref: apiVersion: kind: Service Subscription callable name: caller-example reply: channel: apiVersion: Channel kind: Channel name: downstream-channel 29