Download presentation
Presentation is loading. Please wait.
Published byEleanore Atkins Modified over 8 years ago
1
Function as a Service An Ad Hoc Approach to Cloud Computing By Keith Downie
2
Traditional Cloud Computing Three main categories: Software as a Service Platform as a Service Infrastructure as a Service 2
3
Abstracts away details of the underlying infrastructure Physical resources, disk images, block storage, etc. Hypervisors provision virtual machines Primarily used for deploying and scaling application servers Examples: Amazon EC2, Rackspace, Windows Azure 3
4
Platform as a Service Abstracts away most details of the server Operating system, execution environment, database, etc. Developers provide server-side code, provider handles everything else Similar to IaaS from an application perspective The same server code could run on both Examples: AWS Elastic Beanstalk, Google App Engine, Windows Azure 4
5
Application as a Service Provider manages infrastructure, platform, and software Usually a suite of software that primarily operates in the cloud Accessed through a thin client, such as a web site Most of the work for the application is done in the cloud Examples: Google Docs, Office 365, Lucid Charts 5
6
Function as a Service Provides an abstraction similar to a function call Abstraction is used from the software Application sends functions to the cloud to be executed and gets a return value How much of the execution is done in the cloud is up to the application 6
7
Related Works Remote Procedure Call (RPC) Application sends a request for a service from another computer 7 Application Agent Service Remote Machine Service already implemented on the remote machine
8
Related Works Active Networking ANTS [Wetherall] Network devices are able to incorporate code it receives Code that is shipped fits into a specific framework Used to incorporate new protocols into the network 8 ANTS sends code to supplement the execution of a remote device Function as a Service sends code remotely in order to supplement local execution
9
Client-server workflow Client 9 Cloud Provider Server http.get(foo.json)foo.json
10
FaaS workflow 10 FaaS Provider FaaS.exec(bar)return(bar) function foo function bar var x=1 API
11
FaaS workflow 11 FaaS Provider FaaS.update(‘app’, {x:1}) function foo function bar var x=1 API ‘app’ x=1
12
FaaS workflow 12 FaaS Provider FaaS.exec(foo, [1, 2], {y:3}) function foo function bar var x=4 API ‘app’ x=4 def foo(a, b): return x+y+a+b
13
Messages {action: ‘execute’, function: #packaged byte code, namespace: ‘app’, variables: [1, 2], gvars: {y: 3} } 13 {action: ‘load’, hash: #SHA1 function hash, namespace: ‘app’, variables: [1, 2], gvars: {y: 3} }
14
FaaS workflow 14 FaaS Provider FaaS.exec(foo, [1, 2], {y:3})return(4+3+1+2) function foo function bar var x=4 API ‘app’ x=4 def foo(a, b): return x+y+a+b
15
FaaS Provider Smart Thermostat Thermostat 15 Reader FaaS.update(‘thermo’,…) ‘thermo’ token
16
Tokens Tokens used for authentication Want to balance flexibility and control Two types of tokens Public tokens Private tokens Token is included in every message to the cloud 16
17
Public Tokens Gives the developer control over cloud interaction Developer registers with the cloud provider Issues public tokens to users Creates white list of functions in the cloud Public tokens can only send function hashes Defines what namespaces a token can access Sets permissions for the public token Developer pays for resources used by public tokens 17 token: { private_id: 0x1234, public_id: 0x5678, permissions: { rate_limit: 2, namespaces: [‘thermo’, ‘app’], TTL: # time/date } checksum: #Signed checksum }
18
Private Tokens Gives the user control over cloud interaction User registers out of band with the cloud provider Receives a private token Token can be used to run any function Can define their own namespaces Can make their own public tokens User pays for resources used 18
19
White Lists 19 Cloud Provider FaaS.exec(makeDecisionHash) temperatures[] ‘thermo’ public token makeDecision() public token White List makeDecision decision FaaS.update(‘thermo’,…)
20
White Lists 20 Cloud Provider FaaS.exec(makeNewDecision) temperatures[] ‘thermo’ public token makeDecision() public token White List makeDecision error code makeNewDecision() makeDecision
21
makeNewDecision() White Lists 21 Cloud Provider FaaS.exec(makeNewDecision) temperatures[] ‘thermo’ new token White List makeNewDecision new decision Cache
22
Thermostat Comparing Cloud Models 22 FaaS Provider Reader Cloud Provider Thermostat Reader
23
Thermostat Comparing Cloud Models 23 FaaS Provider Reader Cloud Provider Thermostat Reader
24
Thermostat Comparing Cloud Models 24 FaaS Provider Reader Cloud Provider Thermostat Reader makeDecision()
25
Device Comparing Cloud Models 25 FaaS ProviderCloud Provider Device Low Battery High Battery
26
Thermostat Comparing Cloud Models 26 FaaS Provider Reader Cloud Provider Thermostat Reader
27
Thermostat Comparing Cloud Models 27 FaaS Provider Reader Cloud Provider Thermostat Reader New Provider
28
Thermostat Comparing Cloud Models 28 FaaS Provider Reader Cloud Provider Thermostat Reader New Provider
29
Thermostat Comparing Cloud Models 29 FaaS Provider Reader Cloud Provider Thermostat Reader
30
Thermostat Comparing Cloud Models 30 FaaS Provider Reader Cloud Provider Thermostat Reader Personal Server
31
Prototypes Cloud prototype built in Python Application prototypes to solidify proof of concept Two Prototype Applications Smart home thermostat Mobile feed reader 31 No performance evaluation Feel free to ask questions!
32
Packaging Functions Python introspection Function byte code Parameter inputs Global variable calls 32 def foo(a,b): return a+b+z byteCode = foo.__code__ globalRefs = foo.__code__.co_names func = byteCode import new bar = new.function(func, {z: 3}) bar(1,2) #Returns 1+2+3 foo(1,2) #Error, ‘z’ not defined ‘new’ library used to run Python functions in a container import marshal marshal.dumps(foo.__code__) foo.__code__ == marshal.loads(foo.__code__) ‘marshal’ library used to package and unpackage byte code
33
Cloud API From the application’s perspective, the abstraction is used through an API 33 import CloudAPI as api api.setToken = getToken(‘public.token’) def bar(a): return a+” ”+b api.update({b: “World”}, namespace=“app”) api.exec(bar, “Hello”, namespace=“app”) # Returns “Hello World” import CloudAPI as api api.setToken = getToken(‘public.token’) barHash = # Load hash from disk api.update({b: “World”}, namespace=“app”) api.exec(barHash, “Hello”, namespace=“app”) # Returns “Hello World” API handles packaging code, hashing, and communication with the server Returns either the return value of the function or an error message
34
FaaS Provider Smart Thermostat Thermostat 34 Reader Thermostat Monitor
35
Mobile Feed Reader Mobile application to aggregate various feeds Can enter search terms that filter stories Gather all matching stories since the last time the application was used Want to use as little battery life as possible 35 Cloud computing!
36
Mobile Feed Reader 36 FaaS Provider Mobile Device Reddit Server set subreddits set search terms register repeating function get feedsfeeds.json
37
Mobile Feed Reader Client on mobile device written in HTML and Javascript Python functions are written and ‘compiled’ beforehand Functions were registered in the cloud Hashes of the functions are accessible to the web app When the web app wants to communicate with the cloud Loads the saved hashes on file Builds a JSON message to send to the cloud for that function Reads the JSON return it gets from the cloud and displays this to the user 37
38
Future Works Currently the only supported language is Python Can explore what other interpreted languages can be used Security analysis Is the signed checksum enough to prevent tampering? Should key pair encryption be used for every message? Typically slow, perhaps only encrypt certain messages Synchronizing namespaces in a cloud environment What happens when conflicts occur? How to model synchronizing to mitigate conflicts 38
39
Conclusion Work shows how such a cloud model can work Shows that interesting properties can be gained by such a model Prototype applications that evaluate the idea 39
40
Thank you! Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.