CS5412: LECTURE 4 IMPLEMENTING A SMART FARM
Ken Birman Spring, 2018
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 1
CS5412: LECTURE 4 Ken Birman IMPLEMENTING A SMART FARM Spring, - - PowerPoint PPT Presentation
CS5412: LECTURE 4 Ken Birman IMPLEMENTING A SMART FARM Spring, 2018 HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 1 INTERNET OF THINGS (I O T) Todays cloud has been enlarged in recent years so that we can connect devices to the cloud,
Ken Birman Spring, 2018
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 1
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 2
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 3
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 4
4
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 5
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 6
IoT Edge Server runs a stripped- down set of cloud functionality, but close to the device. Internet link (might not always be up, and may be slow). Full cloud datacenter
KEN BIRMAN (KEN@CS.CORNELL.EDU) 7
First tier: inexpensive computation on meta-data Key-value object store holds specialized knowledge models for categories (cows, pigs, dogs, trees…) Cow p=.85 Pig p=.6 Cows Pigs Cow:Bessie p=.97 Pig:Wilber p=.04 Cow:Bessie
Most likely a cow! What’s that?
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 8
9
IoT Devices Google GRPC Slow but universal Blob Store NoSQL Database
Image processing engine
. . . Image upload path Vendor-supplied services (fairly rigid)
Azure IoT Hub
KEN BIRMAN (KEN@CS.CORNELL.EDU)
IoT Devices Today: Functions do lightweight computing and interact purely with vendor-supplied (standardized) services. Blob Store NoSQL Database Image processing engine . . .
10
Google GRPC Slow but universal Image upload path
Azure IoT Hub
KEN BIRMAN (KEN@CS.CORNELL.EDU)
Cow hoof-health evaluation microservice
Blob Store NoSQL Database Image processing engine . . .
11
Google GRPC Slow but universal IoT Devices Image upload path
Azure IoT Hub
KEN BIRMAN (KEN@CS.CORNELL.EDU)
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 12
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 13
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 14
Schedule the vet! GPU GPU
KEN BIRMAN (KEN@CS.CORNELL.EDU) 15
Photo upload Key-hash Sharded, replicated blob store Done! Event meta-data IoT Hub Function Key-hash Sharded knowledge store Hoof crack, p=.78 GPU-accelerated computation Rough terrain, p=.03
router
Hoof crack, p=.78 2-node shard
N1 N2 replica N3 N4
Function Svc
Thick line denotes “large objects”
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 16
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 17
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 18
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 19
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 20
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 21
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 22
Idle Swivel Focus Take Photo Handle various mundane events Movement sensed! Point the camera Send swivel command to Camera {args…} Motion event {args…} Pointed! Focus the camera Send focus command to Camera {args…} Camera movement done {args…} Focused! Take a photo Send photo command to Camera {args…} Focus operation done {args…} Captured photo {info, } Orange: “camera to Azure IoT” Green: “Azure IoT to camera”
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 23
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2019SP 24
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 25
Current State: Data in the (key,value) store can hold any information you like Version=17
New Event Function launched to handle it Triggered action (issued after successful state update)
Updated state replaces prior state (“Replace state version 17 with state version 18”)
1 2 3 4 5
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 26
Current State: Data in the (key,value) store can hold any information you like Version=17
New Event Function launched to handle it Must retry!
Tries to update version 16, but version has changed to 17…
1 2 3 4 5
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 27
Current State: Data in the (key,value) store can hold any information you like Version=18
New Event Function launched to handle it Triggered action (issued after successful state update)
Updated state replaces prior state (“Replace state version 18 with state version 19”)
1 6 7 8 9
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 28
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 29
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 30
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 31
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 32
IoT Edge inside!
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 33
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 34
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 35
Still using search plan A Starting to use insecticide spraying policy from plan B
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 36
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 37
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 38
Functions µ-Service
Length of a typical “action” Typically a single “RPC” or some other event from a client
Long-running, could continuously evolve some form of knowledge base using background computation that might be quite slow/costly. Long-term state Lives outside the functions, like in a key-value store Could be in memory, or in local files, or could be in other µ-Services. Resource footprint Long-term state is small, function itself runs in a lightweight container Long-term state might be huge, computation runs on heavier-weight compute nodes dedicated to the role for long periods of time Access to accelerators Probably not. If needed, yes. Cost to own & operate Pay only for cycles you use. Can be very costly, but amortized over many clients.
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 39
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 40
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 41
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 42
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 43
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 44
Azure Function Server Functions: Lightweight, event-triggered programs in containers, “pay for what you use” resource model Message bus or queue µ-Services: some Azure provided, some “new”
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 45
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 46
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 47
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 48