COSCUP x RubyConf TW 2021

自動化 AIoT 機器學習循環 - Kubernetes 結合 KubeEdge 從雲端擴展至邊緣
08-01, 12:05–12:45 (Asia/Taipei), AU
Language: 漢語


Talk Length

40

您是否知悉並同意如採遠端形式分享,需提供預錄影片(您需同意大會才能接受您的稿件) – yes Translate Title

Build an end-to-end automated AIoT system on a cloud-edge integrated platform

Abstract

隨著人工智慧的興起,雲計算資源的需求不斷的提升,除了在雲端計算需求量增加外,近年 5G 的上路,運算資源的需求也從雲端漸漸擴展到邊緣端,而邊緣端的計算需求提供了更貼近使用者的服務,像是資料的收集、訊號控制等,為了提供符合 5G 高速網路的邊緣計算架構 AIoT(Artificial Intelligent Internet of Thing)便是近期相當熱門的話題,利用最新開源 K8s 邊緣服務 KubeEdge 嘗試將雲端服務延伸到邊緣端,設計出專用於邊緣計算的 AIoT 運算平台。

實作架構:
Cloud node ( server cluster )
訓練xception模型部署,能提供貓與狗的辨識,接著利用docker container將它包成一個屬於TF serving的pod,部署到Kubernetes上,再利用KubeEdge的 controller將雲端上的pod 部署到邊緣端。
Edge node ( server )
得到從雲端透過KubeEdge controller部署的pod,提供給 edge device 貓狗辨識的服務,以及收集從pi傳來的照片,利用辨識的準確率來衡量資料是否有效,將有效資料再回傳給雲端提供模型更多的data set。
Edge device ( raspberry pi 4)
透過mqtt將拍好的照片傳送至edge node上,而接著pi便利用TF serving的API 去向edge node上的訓練模型傳送一個辨識要求,從Edge node 上的 辨識模型取得辨識結果。
效果
收集來自pi傳來的新照片,對於追求更高準確率的模型是相當好的data set,使得device使用者能得到更好的服務,得到更高準確率的結果。不斷對來回傳送新資料,模型的準確率不斷提高,透過了架構上的設計,使得使用者能得到越來越高的準確率服務,且有效運用雲端及邊緣端的資源分配,及雲技術的嘗試而開發出一套系統。

Kubernetes
是一個可以幫助我們管理微服務(microservices)的系統,可以自動化地部署及管理多台機器上的多個容器,用於自動部署、擴充和管理「容器化(containerized)應用程式」的開源系統。
=> 用於cloud 的控制,controller的延伸與KubeEdge結合

KubeEdge
是一個開源系統,可將本機容器化應用程序編排和設備管理擴展到Edge的主機。 它基於Kubernetes而構建,為雲和邊緣之間的網絡,應用程序部署和metadata同步提供核心基礎架構支持。 也支持MQTT,並允許開發人員創建自定義邏輯並在Edge上啟用資源受限的設備通信。 KubeEdge由雲和邊緣組成。支援同網段下,能在連線網路時讓edge node及cloud node溝通。
=> 利用KubeEdge機制,將kubenetes的雲端延伸至邊緣端,及進行
資料及交換。

平台的應用及優勢
優勢
1. 容器化的環境(container)能在不同的作業環境上快速部署,不限於單
一或有限制的作業環境。

  1. 在聯網的情況下做運算資源分配,需大量運算資源配置雲端上,少量
    則在邊緣端。

  2. 做到即時部署、即時更新的快速部署。

  3. 做到 End to End 的 DevOps 平台控制,雲端就能控制、部署到邊
    緣端。

克服現有邊緣運算問題:
1. 容器化,可擴展性且高相容性的邊緣平台
不論在何種作業環境都能快速部署,也能擴增邊緣端應用的數量。

  1. End to End 的操控性,從雲端到邊緣端的操控性
    從雲端便能操控到邊緣端的運作的延伸性,也能得到邊緣端的狀態。

  2. 計算資源的分配及資源消耗
    讓邊緣裝置不必負擔大量的運算,傳輸到雲端來使用雲端資源。

  3. 輕量化的邊緣端配置
    使用輕量化的資料儲存及溝通方式,減少邊緣端的負擔。

系統平台的設計角度:

                   在AIoT的架構下,將原本單一的雲端平台分為較貼近使用者的邊緣端及
                   雲端。

克服現有邊緣運算問題:
1. 容器化,可擴展性且高相容性的邊緣平台
不論在何種作業環境都能快速部署,也能擴增邊緣端應用的數量。

               2. End to End 的操控性,從雲端到邊緣端的操控性          
                   從雲端便能操控到邊緣端的運作的延伸性,也能得到邊緣端的狀態。

               3. 計算資源的分配及資源消耗                 
                   讓邊緣裝置不必負擔大量的運算,傳輸到雲端來使用雲端資源。

               4. 輕量化的邊緣端配置                                                   
                   使用輕量化的資料儲存及溝通方式,減少邊緣端的負擔
Difficulty

中階

hackmd url

https://hackmd.io/@coscup/SylAravCd/%2F%40coscup%2FrkyhHTPC_

slido url

https://app.sli.do/event/sdjiqj3v

English Abstract

Build an AIoT system which could deploy AI model automatically and continously from cloud to edge, collected and sent new valid data from edge to cloud. After cloud node continously receive new data and retrain model to deploy, users could get better service through the Cloud-edge life cycle.
- Thourgh the container lightweight and Kubernetes cloud orchestration advantages, users could easily scale the edge devices and no system restrictions.

Through automatic and continuous updating of AI model, users can continuously get better services. Besides, users can also change their services through the webpage, and choose and deploy the services which they need.

KubeEdge is based on Kubernetes. It provides the network between cloud and edge, and extends the scheduling for service from cloud to edge. This also called “the lightweight of Kubernetes”. In the architecture of AIoT, it divide the original cloud platform to cloud and edge which is closer to users. In compare with cloud, edge can provide more immediate service than cloud.

Continuously collecting a large amount of new data from edge node makes AI model accuracy higher. AI model is also used to filter invalid data by the identification result. In this way, it can reduce the computing resource when sending back and training on the cloud node.

See also: