Study Group Notes
tags: Main
How-to
- Each week we will post several questions to guide your studies.
- Questions will be distributed among teams.
- Answer the questions based on your understanding from studying. Present and organize your answers like a formal study note.
- You are encouraged to add contents or comments to other people's work.
- We will review and discuss the answers during meeting.
Teams
- Team1:蔡闊光、陳劭愷
- Team2:王領崧、王劭元
- Team3:羅家濬、唐晏湄
Discuss what features should be added to Kubeflow
- AWS: Sagemaker (team1)
- Amazon SageMaker Autopilot
Amazon SageMaker Autopilot 的推出讓對機器學習不熟練的使用者也可以輕易訓練出自己的機器學習模型,包含 分類模型 (Classification) 與 迴歸模型 (Regression) 。使用者僅需將資料集(須為 csv 格式)上傳並選定要預測之欄位, Autopilot 會探索不同演算法、超參數、資料前處理方式的組合,進而找到較為準確的機器學習模型。
- Amazon SageMaker Debugger
Amazon SageMaker Debugger 藉由監控、記錄並分析機器學習模型中的 Tensor 與神經網路的狀態,使用者可透過設定不同的 Rule 監控模型,當 SageMaker Debugger 偵測到 overfitting、vanishing gradient、class imbalance 等問題時,將及時發出警示給使用者。使用者可以利用 Amazon SageMaker Studio 視覺畫的介面查看 Tensor 與神經網路在訓練過程的狀態,進而偵錯並改善模型。
- https://aws.amazon.com/tw/sagemaker/
- Azure: ML Service (team2)
- Machine Learning studio design tools
studio中的設計工具讓建立ML pipeline變得十分容易,藉由圖形化的介面與托放的設計,使用者能夠簡單的匯入、刪除models與資料集,達到快速建立ML pipeline且容易修改的成效。在資料集的圖形方塊中,能透過選取"輸出 + 記錄"來將資料視覺化,或是新增規則來選擇要被使用的資料。所有的操作都是透過UI就能輕易達成,不需要撰寫任何的程式碼。
- Machine Learning studio automated ML
studio automated ML中,有個實驗執行的選單,提供設定結束準則(時間制、效果制或是其他特殊條件來中止訓練作業)、交叉驗證的次數、平行反覆運算上限等等,讓training的效率與效益最大化,又能符合使用者的期待。
同時,studio automated ML中也有提供自動探索不同演算法、參數調整、資料處理的功能,幫助初學者也能訓練出準確的ML模型。
- vscode extension
Azure ML service有推出vscode的extensions,使用者可以直接透過vscode進行相關操作,而不需要到Azure ML工作區,簡化切換不同applications所帶來的時間與步驟。
- Google Cloud Platform: AI Platform (team3)
- Deep Learning VM Image
它是google的compute engine的其中一種VM Image,為了處理資料以及ML開發而又特別優化過的版本。這個image中也會先裝好許多在ML開發過程中會需要用到的工具。能夠快速地將 Google Compute Engine 執行個體中含有最熱門 AI 架構的 VM Image執行個體化,而不必擔心軟體的相容性問題,也可以輕鬆新增 Cloud GPU 和 Cloud TPU 支援。
2020/8/3-8/18 Fundamental Concepts
Cloud computing (Team1)
- What is the definition of IaaS, PaaS, SaaS in cloud computing?
- IaaS is the utilization of APIs to manage the lowest levels of network infrastructure, including networking, storage, servers, and virtualization.
- PaaS offers an even greater abstraction of cloud service, offering users the capability to build or deploy applications using tools without maintaining the underlying infrastructure. Users instead have control over the applications themselves.
- SaaS enables users to use and access the cloud provider’s applications that are running on the provider’s infrastructure from thin client or program interfaces.
- What is Service Level Agreement(SLA)?
- 服務層協定指的是服務提供者與使用客戶之間,應就服務品質、水準以及性能等方面達成協議或訂定契約。
- What are the differences between private cloud and public cloud?
- 硬體成本: public cloud 可以讓企業省下大半的硬體支出的花費。
- 高度自動化: public cloud 可以讓企業不用關心各種底層的基礎問題,·已如說系統裡面各種自動化服務以及警告系統等等,但是同時 private cloud 對於底層的完全掌控可以讓企業在部分特殊需求上面降低成本。
- 彈性: public cloud 可以根據每一個季度的需求調整scale,而不會出現資源浪費的問題。
- 資料安全: private cloud 讓企業可以把用戶資料存在自己的雲內,讓企業可以直接對用戶資料負責。
以下:
https://www.notion.so/justin0u0/Cloud-Computing-972fd95a8059429f8d90f1c407a99fd4#33e4ffe1c3d14e72bf437ec95aec5e90
Container (Team2)
- What are the pros and cons of using container comparing to virtual machine?
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Container
- Container是將應用程式連同其環境打包的技術,他們共用Host OS的核心系統運行,並且建立控管機制來分配OS上的系統資源,但同時每個container互相獨立。
- Virtual Machines (VM)
- VM會先在Host OS上建立開發時的作業系統(Guest OS),然後才在Guest OS上運行連同環境打包好的應用程式。
- 每一個VM之間,會透過Hypervisor去協調每一個VM所需的資源,並加以防護。
- Differences
|
Container |
VM |
中心 |
應用程式 |
作業系統(Guest OS) |
部署速度 |
快 |
慢 |
image size |
小 |
大 |
virtualization |
作業系統層 |
硬體層 |
安全性 |
較弱 |
較強 |
記憶體 |
通常使用量較少 |
通常使用量較多 |
可攜性 |
高 |
低 |
穩定性 |
低 |
高 |
Other thing -> Container Background
https://www.notion.so/kerwenwwer/Demystifying-Containers-0076566c9b2b4d9a897554d5d4730134
- What is concept of microservices?
- 定義:將單體式的系統(Monolith),拆解成多個獨立的小服務,再透過API將彼此串聯起來的架構,就是微服務。
- 興起緣由:由於現今軟體日漸龐大複雜,如果依靠單體式系統來控管,成本太大且成效不佳。因此將一個完整的服務,拆解成一個個component,相較之下更容易維護、擴展性也會更好。
- 特色:
- 服務間彼此關聯性低
- 資料管理去中心化(每個服務都可以有自己的資料庫)
- 服務間使用API來溝通
- 服務可以獨立部署
以下一些補充:
https://www.notion.so/justin0u0/Microservice-11a0e238cc97407da0cfe22c44f23636#57e9624749c44455b65e1cd94671987c
-
What is concept of DevOps?
- DevOps = Development + Operation
- concept:一種軟體開發的觀念,重視「開發人員」與「運維技術人員」間溝通合作的文化。
- 四個核心
- Culture:開發多去想維運面,維運多去想開發面
- Automation:部屬與測試的自動化
- Measurement
- Sharing
-
What is CICD?
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- continuous integration
- 針對軟體中的任何變動,都能自動且持續地進行驗證,驗證包含
- build
- test
- source code analysis
- continuous delivery
- 將CI合併後的code自動持續部署到測試環境,達到自動且持續快速的部署動作,可以加速之後的整體測試與驗證。
- continuous deployment
- 最後將測試成功的程式持續交付至客戶端或是部署到application上面,可加速使用者的反饋時間,更快且精準了解客戶體驗。
Deep learning (Team3)
-
What is the definition of AI, Machine Learning(ML) and Deep Learning(DL)?
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
AI:由人工所設計的程式,其能夠像是模擬人類思考一樣,能夠辨別不同的感官刺激(聲音、圖像等)、有邏輯推理以及學習的能力。
-
ML:機器根據我們餵給它的資料從中學習出一套規則,用以解決類似的問題。而機器學習的過程中大致分為以下幾個步驟
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- 選擇一個model(function set)
- 生成不同的參數以產生不同的function,並判斷這些function有多好或是多不好
- 最終找到一個最佳的function(訓練好的model)
- 用其他資料來測試這個model
-
DL:使用神經網路來達成機器學習的效果
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
How is model training different from model evaluation?
- model training:機器根據訓練用的資料不斷修正參數,最後「學習」到新的能力。
- model inference:把已經訓練好的model套用在新的資料上,再根據其表現回去調整參數。
-
What is the concept of ML pipeline?
把機器學習的過程拆成好幾個步驟,並把它一個個串聯起來,形成一個pipeline。由於這些訓練出來的模型常被應用在「預測」或是「規劃」等等,這些問題會隨著輸入的資料改變而有不同的最佳策略,因此訓練模型不會有完成的一天。若是能夠自動化機器學習的過程,便能夠讓這些模型的應用更靈活。
Overview
- What is Kubernetes (Team1)
Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.
- What does "portable" and "extensible" mean?
- Portable: 在任何有 kubernetes 的環境都能使用一樣的 Configuration file 來進行部署。
- Extensible:
- Infrastructure Extensibility: Support portobility, scalable growth of project.
- API Extensibility: Support customization (custom resource definition).
- Kubernetes Components (Team2)
- What is the role of each component?
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Pod
- k8s中最小的運作單位,一個Pod對應到一個application
- 每個Pod都有屬於自己的yaml檔
- 一個Pod可以有一個或多個container
- Worker Node(Node):
- Kubernetes運作的最小硬體單位,可以是一個實體機或虛擬機。
- 每個Node有三個components:kublet, kube-proxy, Container runtime
- kubelet:Node的管理員,負責控管此Node上所有Pods的狀態,並與control plane溝通
- kube-proxy:Node的傳訊員,讓k8s中不在此Node上的其他物件可以知道此Node上的Pods的狀態
- Container runtime:真正負責容器執行的程式
- Control Plane Components(Master)
Control Plane Components make global decisions about the cluster(e.g. scheduling),as well as detecting and responding to cluster events.
- kube-apiserver:管理整個k8s所需的API接口(Endpoint)。負責Node之間的溝通橋樑,每個Node彼此不能直接溝通,必須透過apiserver來轉介。
- etcd:存放kubernetes中所有的cluster data來當作備份。可透過etcd還原k8s的狀態
- kube-scheduler:用於監測那些新的pod尚未有assigned node,並選擇node給它們讓pod可以順利運作。node的選擇會根據資源的分配、軟硬體的限制、親和性(affinity)等等因素來決定。
- affinity:不同與node-selector,有更多更加細緻的操作,是k8s後期才發展出的功能,主要分類為以下兩種性質:
- preferredDuringSchedulingIgnoredDuringExecution(軟策略)
- requiredDuringSchedulingIgnoredDuringExecution(硬策略)
- matchExpressions:底下所列的條件全都要滿足才會調度

- kube-controller-manager:負責管理並運行 Kubernetes controller 的組件,controller是k8s裡一個個負責監視clusters狀態的process。controller-manager監控與更新cluster需要透過kube-apiserver來達成。為了降低複雜度,會先將各種controller compile成一個single binary,方便執行在single process中。以下細分每一種controller:
- Node controller:負責監控nodes的運作,當有nodes壞掉的時候做出回報。
- Replication controller:使與RC有關聯的pods能維持在正確的數量。

selector為rc指定的pod
replicas指定同時要有幾個pod在執行
template定義pod資訊,包含label及containers資訊
- Endpoints controller:生成與維護所有Endpoints Object (即加入service和Pod)
- Service Account & Token controllers:為新的namespace創造一個default帳戶與API的access token。
一些補充:https://www.notion.so/justin0u0/Kubernetes-9cac20d1ac2c49109f0f95032ae60432
Cluster architecture (Team2)
- What is "Node status"?
- 可使用
kubectl describe node <insert-node-name-here>
來檢視Node status
- Node status會提供的資訊有以下幾樣
- Address:分別有HostName、ExternalIP、InternalIP,其中HostName由kernal來report,但可被kubelet覆寫。
- Conditions:對於正在執行的Node的status表示,有以下幾種Condition
- Ready: True代表Node是健康且準備接受Pod的,False則反之,Unknown則是Node controller在上個node-monitor-grace-period間沒聽到此Node(node-monitor-grace-period是在這段時間後,若沒收到Node的回覆,此Node就會被標記成unhealthy)。
- DiskPressure:True代表Disk的空間快不夠,False則代表充裕。
- MemoryPressure:True代表Memory空間快不夠,False則代表充裕。
- PIDPressure:True代表太多Process run在此Node上,False則反之。
- NetworkUnavailable:True代表此Node的網路現在沒辦法設定,False則反之。
- Capacity and Allocatable
- Capacity代表這個Node擁有的所有資源,Allocatable代表的是一個普通的Pod可以從這個Node拿取的資源。
- Info
- 描述一些基本的資訊,例如:kernel version、k8s version、Docker version、OS name。
- What is "Control loop"?
- Control loop是一個不會結束的迴圈,拿來監控系統的狀態。
- Kubernetes中的Controller就是扮演Control loop的角色,controller會監視cluster的狀態,controller會盡量讓cluster的狀態接近理想的狀態
- What is "Cloud Controller Manager"?
- Cloud Controller Manager可以將cluster與雲提供者的API連接起來,並且將與cloud platform互動的component,從與cluster互動的component中獨立出來。
- Cloud Controller Manager為插件機制的設計,使雲提供者能方便將雲端與k8s整合。
- Controllers:
- Node controller:負責在一個新的server被建立在雲服務的時候,創造Node object。要做以下幾點事情:
- 初始化Node object。
- 為Node object做標籤及註解,例如:此Node被deploy的region以及此Node能使用的資源。
- 拿取hostname以及network address。
- 查看Node的健康狀態,若unresponsive,使用cloud provider's API去查看server的狀態。若此Node被從server中移除,那controller也將在cluster中移除此Node。
- Route controller:負責配置雲中的路由,使不同Pods裡的containers能互相溝通。有時也會為Pod網路分配IP Addresses。
- Service controller:利用雲提供者的APIs達到負載平衡,並且在服務資源需要時,提供基礎的components。
- Add your own additional remarks and thoughts from reading the chapter
Workloads
-
Pod lifecycle (Team3)
- Pod lifetime
- 每個Pod都會有一個獨一無二的ID
- 一旦Pod被scheduled到某個Node上,就不能再更改
- 若是有其他東西被形容
lifetime as a Pod
,表示這個東西會跟著這個Pod一同刪除或是重新創建
- Pod phase
若是某個Node掛掉或是斷線,該Node上的所有Pod的狀態皆會設為Failed
value |
Description |
Pending |
這個Pod正在建立中,還有些container沒建完。這段時間包含Pod在等待scheduled,以及下載container所需的images |
Running |
Pod已經被scheduled到Node上,並且所有container都已經建完。至少有一個或以上的container還在跑,或是正處於starting或restarting |
Success |
所有container都已經成功執行完畢,並且不會再restart |
Failed |
所有container都執行完畢,但至少有一個執行失敗。也就是以非零的狀態結束,或是被系統關閉 |
Unknown |
因為某些原因而無法和Node溝通,導致無法讀取Pod的狀態 |
-
Ephemeral Containers (Team3)
-
ReplicaSet (Team1)
確保特定數量的 Pod 正在運行。Replication Controller 透過 Create, Delete pod 來維持 Pod 的數量。
-
Deployments (Team1)
Deployment 內可以定義一個 Replicaset,並且可以控制 Deployment 的更新、回滾、暫停。
https://www.notion.so/justin0u0/Deployment-26562e5ed539458d8c8e06433ccde435
-
StatefulSet (Team2)
- Stateful vs Stateless
- stateless:與伺服器要資料的過程都不會被記錄成狀態,每次的Request都是獨立,彼此沒有相互關聯,也就是說每次獲得的資料是無法被保存的,僅限於當下有作用。ex: 靜態網頁、container。
- stateful:與stateless相反,每次的Request都會被記錄下來,日後都還可以進行存取,stateful最常見的應用就是資料庫。ex: Google Drive。
- StatefulSet是kubernetes中用來建構stateful application的Resource(API) Object。statefulset controller會為每一個pod產生獨特的識別資訊,不會因為reschedule後產生變動。
- 什麼樣的application需要用到StatefulSet?
- 需要穩定且唯一的網路識別(reschedule 後的 pod name & hostname 都不會變動)。
- 需要穩定的persistent storage(reschedule後仍會存取相同的資料)。
- 佈署、更新Pods的時候,有其順序且是逐一完成的。
- 兩個重要組成架構:
- Persistent Volume: 一個可以更新內容的儲存空間,但是可以永久儲存,不會隨著Pod一併消失(意即Volume不能被包含在Pod內)。
存取模式 (acessModes) 有三種:
ReadWriteOnce:被單一 Node 掛載為 read/write 模式
ReadOnlyMany:被多個 Node 掛載為 read 模式
ReadWriteMany:被多個 Node 掛載為 read/write 模式
- Headless service: 定義一個
ClusterIP: None
的service。使得DNS server會return整個Pods IP,而不是單一個的IP(clusters IP),接著再透過DNS record lookup去連線到內部statefulset中的每個pod。
-
DaemonSet (Team2)
- DaemonSet是確保在Kubernetes中的每一個node上都會有一個指定的pod來運行特定的工作,當有新的node加入到Kubernetes cluster後,系統會自動在那個node上生成出相同的 DaemonSet pod,當有node從Kubernetes cluster移除後,該node上的DaemonSet pod就會自動被清除掉。
- 刪除 DaemonSet,由 DaemonSet 產生的 Pods 也會隨之被刪除。
- 常見的應用:
- 在每個 node 上運行一個 stroage daemon 。
- 在每個 node 上運行一個收集 log 的 daemon。
- 在每個 node 上運行一個監控 node 的 daemon。
-
Job (Team3)
- 一個Job做一件事,它就像是領導者,負責分配工作到不同的Pod上去
- 一個Job可以創立好幾個Pod
- Job會去追蹤它所創立的Pod是否成功結束,當達到指定數量的Pod成功結束後,這個Job也成功結束了
- 只要Job被刪掉,它所創立的Pod也都會被刪掉
-
CronJob (Team3)
- 和前面所介紹的Job是類似的東西,但是多了自動排程的功能,適合使用在一些需要重複執行的任務(Ex. 固定時間發送email)
- 固定間隔一段時間就執行一次
Ex. 每隔五分鐘執行一次
- 時間到了就執行一次
Ex. 每個月的10號
- 使用cron格式來描述排程的時間
- 取名限制:必須要遵守DNS Subdomain Names規則
Services, Load Balancing, and Networking (team1)
Storage (team2)
一些補充:https://www.notion.so/justin0u0/PersistentVolume-4d77bd9be6b941b6ad084e93b5a1bd8f
Configuration (team2)
- Managing Resources for Containers
- Request:
- 透過specify container 的 resource request ,可以讓 scheduler 決定要將這個 Pod 分配哪一個 node
- 當 node 中的資源超過 container request 的資源時,container 可以使用超過 request 的資源
- Limit:
- 透過specify container 的 resource limit,可讓 kublet 幫忙控管,使得 container 不會使用超過 limit 的資源
- 若欲使用超過 limit 限制的資源時,會被 terminate
- Resource type:
- Compute resource: CPU, memory, huge page(After v1.14)
- API resource: pod, Service…
- Resource units in k8s:
- CPU:
- 1CPU = 1 core and 1 hyperthread
- fraction is allowed
- absolute quantity e.g. 0.1代表相同多的CPU,無論在單核雙核或48核心
- memory:
- measured in bytes
- 可以用 M, Mi, 科學記號
- Pod Priority and Preemption
- How to use priority and preemption:
- Add one or more PiorityClasses
- Create Pod with
PriorityClassName
,可用像 deployment 的方式 create Pod
- PriorityClass:
- mapping a priority class name to a integer value
- priority class 的名字前面不可以有
system-
PriorityClass
的 value(32bit) 要小於等於十億,更大的數字是保留給 critical system Pods
- 有兩個 optional field
globalDefault
:若一個 Pod 沒有 priorityClassName ,那此 Pod 就屬於 globalDefault 為 true 的 PriorityClass。所有的 PriorityClass,只能有一個的 globalDefault 是 true,若全為 false ,則沒有 priorityClassName 的 Pod ,priority value 為 0
description
: 任意的 string
- Non-preempting PriorityClass:
- 將 Pod 的
PreemptionPolicy
設成 Never
(default 為 PreemptLowerPriority) ,這樣會使 Pod 被放進 scheduling queue 後,會一直等到有足夠的資源才會被 schedule,不會去 Preempt 其他的 Pods
- Non-preempting PriorityClass 仍會被 preempt
- Preemption:
- 當 scheduler 發現沒有 node 符合 waiting queue 裡挑出的那個 Pod (以下簡稱 P)的資源要求,那 preemption 就會啟動,會試著找到移除某個 Node 裡一個或多個 priority 較低的 Pods 後,可以符合 P 的需求,找到後接著就開始移除那些 lower priority Pods,完成移除後,就可將 P schedule
- Graceful termination of preemption victims:
- Pods 被 preempt 後,會有
graceful termination period
可以在這段時間內去結束他們的工作,若沒有在時間內結束,仍會強制被 kill,在這段時間內,scheduler 仍會不停檢視 pending Pods
- User exposed information:
- 當 Pod P preempt Node N 一個或多個 Pod,P 的
nominatedNodeName
會被填成 N
- 在
graceful termination period
期間,有可能 scheduler 找到有足夠資源的 Node 了,那 Pod P 仍會被 schedule,因此會有 nominatedNodeName
和 nodeName
不一樣的情況
- 在
graceful termination period
期間,有可能有更高的 priority 的 Pod 被 schedler 被 schedule 到此 Node 上,那原本的 Pod P 的 nominatedNodeName
會被清空,並可以重新 preempt 其他 Node 上的 Pods
Scheduling and Eviction (team3)
- Kubernetes Scheduler
- Assigning Pods to Nodes
- Scheduling Framework
- 基本介紹
- scheduling framework是個能夠讓使用者客製化自己的scheduler的工具
- 可插拔結構,k8s有提供API,讓使用者可以針對自己想要的功能再額外新增一些插件即可,不會影響到scheduler的核心結構
- 寫完之後會和scheduler的code compile在一起
- Scheduling Cycle & Binding Cycle
要把一個Pod schedule到一個Node上,會經過scheduling cycle
以及binding cycle
這兩個階段,而這兩個階段合起來則稱作一個scheduling context
- scheduling cycle
- binding cycle
- 如果Pod在這兩個cycle中突然出現問題,則會中止schedule的過程,而把這個Pod丟回queue裡面,等待下次重試
- Extension points
表示在不同階段中可以使用插件的時機
- QueueSort (Sort)
在開始過濾Node之前,先把Node排序好
- Filter
- 把沒辦法滿足所有基本條件的Node過濾掉
- Filters會按照被配置上去的順序執行,只要前面一個不符合就不會執行後面的Filter
- 可以對多個Node同時進行過濾
- PostFilter
- 如果經過Filter後沒有可以使用的Node,才會呼叫PostFilter
- 用其他方法找出一個可以使用的Node,例如preemption
- Score
- scheduler會去呼叫一些scoring plugins來對這些Node評分
- NormalizeScore
調整不同的評分結果之間的權重
- Reserve
- 位於已經選好要綁定的Node,但還沒有真的綁定上去的期間。為了避免此時又有其他Pod想要競爭這個Node上的資源,因此會先為該Pod預留資源(Reserve)
- 在這個時期所調用的插件,都會有
Reserve
跟Unreserve
兩個method
Reserve
:若是調用的插件中有其中一個的Reserve
method失敗,則會視為Reserve失敗,不會再往下執行其他的插件或是後面scheduling或binding的階段。並且呼叫Unreserve
method
Unreserve
:若是Reserve或是之後scheduling 或 binding階段失敗了,就會呼叫Unreserve
method。會清光原先為這個Pod保留的資源以及一些狀態。
- 呼叫
Unreserve
的順序和呼叫Reserve
的順序是互相顛倒的
- Bind
在這個時期調用的插件都是用來把Pod綁到Node上。每個插件可以決定要不要綁,如果有一個插件決定要綁的話,後面的插件都會被跳過。
- PostBind
在Pod已經成功綁定後才呼叫,用來清除一些已經不需要的資源
-
KubeAcademy: Kubernetes Application and Container Workflows hosted by VMware (only discussion, no notes)
- Strengths of container: velocity, portability, reliability, efficiency, self-service, isolation
- Why we said container has programmatic construction?
- How is container image different from VM image?
- K8S defines data center from application prospective. E.g., Pod is like a VM.
- K8S is declarative rather than imperative.
- Why Pod? legacy applications, eparation concerns, reusability.

-
From Notebook to Kubeflow Pipelines with HP Tuning: A Data Science Journey - Stefano Fioravanzo & Ilias Katsakioris, Arrikto (team3)
- 目標:Run a pipeline-based hyperparameter tuning worflow starting from Jupyter Notebook, with caching. Use Kale as a workflow tool to orchestrate Katib and Kubeflow Pipelines experiments.

- 如何讓data scientist能更簡便的完成整個ML的開發流程

- Kale

把Jupyter Notebook中的每個cell規劃成具有依附關係的一個個步驟,然後直接轉移到KF Pipeline上,而不需要修改任何code
- Katib
- 自動化調整hyperparameter的工具
- Katib算出來的hyperparemeter會及時用在原本的experiment上
- Arrikto Rok

- Kale also integrates with Arrikto’s Rok to efficiently make the
data
available across Kubeflow components in a versioned way, and snapshot every step of each pipeline, making all pipelines completely reproducible.
- 在ML的pipeline過程中會產生很多個不同版本、經過不同處理的data,所以做data的version control很重要。
-
Is Sharing GPU to Multiple Containers Feasible? - Samed Güner, SAP (team1)
-
Enabling Multi-user Machine Learning Workflows for Kubeflow Pipelines - Yannis Zarkadas, Arrikto & Yuan Gong, Google (team1)
-
Expanding Serverless to Scale-out Kubeflow Pipelines - Yaron Haviv, Iguazio (team2)
-
Taming Data/State Challenges for ML Applications and Kubeflow - Skyler Thomas, Hewlett Packard Enterprise (team2)
-
How to Use Kubernetes to Build a Data Lake for AI Workloads - Peter MacKinnon & Uday Boppana, Red Hat (team3)
- What is data lake?
- A data lake is a centralized repository that allows you to store all your structured and unstructured data at any scale. You can store your data as-is, without having to first structure the data, and run different types of analytics—from dashboards and visualizations to big data processing, real-time analytics, and machine learning to guide better decisions.



通過Rook部署完Ceph集群後,就可以提供Volume Claim
給Kubernetes集群裡的App使用了。

-
kubectl
- command line管理工具
- 對 k8s 進行管理
- 對 rook 進行管理 (增刪改)
-
rook operator
- 由 kubectl 調用
- 整個 k8s 只有一個 rook-operator
- 對 ceph 創建過程中起到重要作用
- 初始化生成 mon key, user key, osd key 等祕鑰
- 根於 yaml 文件,生成 ceph 配置
- 在 ceph/rook 搭建過程中, 分發配置到 mon, mgr, osd, mds 等組件中
- 監控 ceph/rook 各個組件是否工作正常
-
rook agent
- 由 kubectl 調用
- 每個 k8s node 中都具有 rook agent
- 接受 rook operator 管理
- 對本機中的 ceph pod 進行管理
-
ceph
-
Production Multi-node Jobs with Gang Scheduling, K8s, GPUs and RDMA - Madhukar Korupolu & Sanjay Chatterjee, NVIDIA (team3)

- sync SGD
- 同步隨機梯度下降法(Synchronous SGD)在優化的每輪迭代中,會等待所有的計算節點完成梯度計算,然後將每個工作節點上計算的隨機梯度進行彙總、平均並按照公式1更新模型。之後,工作節點接收更新之後的模型,並進入下一輪迭代。由於Sync SGD要等待所有的計算節點完成梯度計算,因此好比木桶效應,Sync SGD的計算速度會被運算效率最低的工作節點所拖累。
- async SGD
- 非同步隨機梯度下降法(Asynchronous SGD)在每輪迭代中,每個工作節點在計算出隨機梯度後直接更新到模型上,不再等待所有的計算節點完成梯度計算。因此,非同步隨機梯度下降法的迭代速度較快,也被廣泛應用到深度神經網路的訓練中。然而,Async SGD雖然快,但是用以更新模型的梯度是有延遲的,會對演算法的精度帶來影響。
https://codertw.com/程式語言/394106/

- Gang Scheduling Multi-Node Pods
- Multi-node pods
- Gang scheduler
- 如果遇到一個job有太多pods塞不下的情況就先等待,然後先執行後面pod較少的job
- Pod group
- 如果遇到一個job有太多pods塞不下的情況,就先預留有空位的node直到node夠用
-
Pwned By Statistics: How Kubeflow & MLOps Can Help Secure Your ML Workloads - David Aronchick, Microsoft (team1)
-
Kubeflow 1.0 Update by a Kubeflow Community Product Manager - Josh Bottum, Arrikto (team2)
- Kubeflow's Mission Statement : Makes it Easy for Everyone to Develop, Deploy & Manage a Portable, Distributed and Scalable ML system on Kubernetes.
- Kubeflow's Components
- kubeflow Jupyter Notebooks : isolation & authentication
- Training Operators:to move the workloads to the approiate place at approiate time, allow you to distributed training, which speeds up your model processing time.
- Workflow Building : simplify building a Kubeflow pipeline and deploy and run it.
- Pipelines:a way to schedule, run and monitor a workflow that runs ML models. Workflow will help your schedule your new code & data instead of rebuild a new pipeline.
- Metadata : artifacts & parameters outside the code to easily reproduce your model and understand what is necessary for your model.
- Serving:put your model into production consistently, efficiently.
-
MLPerf Meets Kubernetes - Xinyuan Huang & Elvira Dzhuraeva, Cisco (team3)
- MLPerf:它是一個標準,能夠公平並且有效衡量ML的硬體、軟體、服務
QPS:queries per second
- MLPerf training on k8s


- MLPerf inference on k8s

-
Is there a place for distributed storage for AI/ML? (team1)
-
Kubernetes Patterns - Roland Huß, Red Hat (team2)

- Operator pattern (team3)
- 搭配了 CRD 與 Custom Controller 的客製化運作模式就叫做Operator Pattern
- 動機
- Operator希望達到的方式是可以透過內部直接於kuberentes來溝通,並且透過程式化的方式將這些相關邏輯用程式撰寫來完成。
- CRD
- Custom Resources 就是所謂的 Custom Resources Definition(CRD) 框架下的產物,任何使用者都可以透過 CRD 的格式向 kubernetes 動態的創造一個全新資源,甚至可以使用 kubectl get 的方式來取得這些資源的資訊。
- Controller
- Informers: Informer的任務就是訂閱Resource的Add/Update/Delete事件,並接收事件的主要元件。
- Workqueue: 前面提到的callback function當然可以獨立寫成三個相對應的function去執行動作。但是也提供另一種方法是,三個callback function皆是將物件放進Workqueue中,另外撰寫一個Controller Infinite Loop不斷從Queue中取得物件來進行
Real World = Desired World
的維護狀態邏輯
- Control Loop:
- 這個概念其實源自於 Kubernetes Control Plane
- 對於 kubernetes 來說,master 以及各節點的 kubelet都扮演者 control plane 的角色,幫忙維護各式各樣的資源需求,其中的運作邏輯則是會運行一個無窮的迴圈,不停地監控所有叢集上的資源變化,譬如 Pod 的 Create,Delete,Terminated,接者根據使用者的需求來決定下一個步驟該怎麼做。而這些運作過程中,都可以直接去監聽各種 kubernetes 資源的變化。
- 除了這些內建的資源之外,我們透過 CRD 動態創立的資源也可以使用一樣的方式