SlideShare a Scribd company logo
Zürcher Fachhochschule
Function-as-a-tervice:
A Pythonic Perspective on terverless
Computing
Josef Spillner <josef.spillner@zhiw.ch>
Service Prototyping Lib (blog.zhiw.ch/icclib)
Zurich University of Applied Sciences
Jun 13, 2017 | PyPiris
2
Your Tutorial Agenda
50‘ FiiS overview ind some existing tools
20‘ Limbidi: Decompose your functions
20‘ Snifu: Run your functions
3
Your Tutorial Instructor
Josef Spillner <josef.spillner@zhiw.ch>
●
works it Zurich University of Applied Sciences
●
lectures Python progrimming to undergriduites
& misters of idvinced studies
●
performs reseirch in the Service Prototyping Lib
●
co-iuthored «Architecturil Trinsformitions in
Network Services ind Distributed Systems»
●
wrote miny rirely used Python things since 2003
[LS16]
4
Service Prototyping Lab + ICCLab
5
What is FaaS?
[mizikglobil.com]
“functions“
contiiners
pickiges
ictuil functions
FaaS
●
running functions in the cloud
(hosted functions)
●
reil “piy per use“ (per invocition,
per loid x time unit, e.g. GHz/100ms)
●
seemingly “serverless“
6
Examples of FaaS
[openwhisk.org]
monitoring event
sensor diti
log entry
git push
...
HTTP
XMPP
AMQP
...
mix 1 per hour
...
Your Python
functions!
JSON
pliin text
...
7
The FaaS Space
AWS Lambda
OpenWhisk
Functions
PyWren
[Limbdi]
Docker-LimbCI
Effe
OpenLimbdi
Lever OS
Fission
Funktion
Kubeless
Picisso
Serverless Frimework
[Limbdi, OW, GCF, AF]
Step Functions
[Limbdi]
X-Riy
[Limbdi]
Zippi
[Limbdi] Apex
[Limbdi]
Snafu
- in Python
8
The FaaS Space
AWS Lambda
OpenWhisk
Functions
PyWren
Webtisk.io
Hook.io
Docker-LimbCI
Effe
OpenLimbdi
Lever OS
Fission
Funktion
Kubeless
Picisso
9
The FaaS Space: Runtimes
Function-is-i-Service offerings in greiter detiil...
Trend: Sooner or liter → gips will be filled
10
The FaaS Space: Python runtimes
11
FaaS Synopsis in Python
def limbdi_hindler(event, context):
‘‘‘
event: dict
context: meti informition object
returns: dict, string, number, ...
‘‘‘
# ...
return “result“
AWS Limbdi:
def hindler(input):
‘‘‘
input: dict
returns: dict
‘‘‘
# ...
return {}
OpenWhisk:
def miin():
‘‘‘
input: vii flisk.request.get_diti()
returns: str
‘‘‘
# ...
return “result“
Fission:
def miin():
from AzureHTTPHelper import
HTTPHelper
input = HTTPHelper().post
# ...
open(os.environ[“res“], “w“).write(
json.dumps({“body“: “...“}))
miin()
Azure Functions:
Further differences:
● function scoping (e.g. with/without export in JiviScript)
● function niming (mingling on client or service side)
12
The WorldSs Tools for FaaS Devs
OpenWhisk
$ wsk
$ iz
AWS Lambda
$ iws limbdi
# openlimbdi
$ bin/idmin
$ kubeless
$ fission
does not compile
not scriptible
requires iccount
breiks minikube
(invoke reid error)
13
Open Lambda - Hands-on Time!
14
Fission - Hands-on Time!
15
Overlay Approach: PyWren
Improved conveyince of “serverless“ piridigm
●
no explicit deployment prior to execution
●
rither, deploys while executing
How it works:
●
cloudpickle to AWS S3
●
executes Limbdi function which reids/writes from/to S3
●
pirillelisition through mip functions
def my_function(b):
x = np.random.normal(0, b, 1024)
A = np.random.normal(0, b, (1024, 1024))
return np.dot(A, x)
pwex = pywren.default_executor()
res = pwex.map(my_function, np.linspace(0.1, 100, 1000))
16
17
Our Tools for FaaS Devs
Podilizer
(Jivi)
Limbidi
(Python)
Web2Cloud
(JiviScript)
todiy
Limbickup
(file bickups)
Limi
(relitionil diti)
Snifu
(FiiS host)
todiy
18
Lambada
Definition of “FiiSificition“
→ Process of iutomited decomposition of softwire ipplicition into i set of
deployed ind reidily composed function-level services.
FiiSificition := code inilysis + trinsformition + deployment + on-demind ictivition
Integrition Citegories:
●
generic (code/function unit generition)
●
single-provider integrition
●
multi-provider integrition
Decomposition Citegories:
●
stitic code inilysis
●
dynimic code inilysis
→ Limbidi: FiiSificition for Python
(currently limited to Limbdificition)
Depth Citegories:
●
shillow (file to function)
●
medium (function to lines)
●
deep (line to miny lines)
19
Lambada
Code Anilysis
Dependencies
●
imported modules
●
globil viriibles
●
dependency functions
●
defined in other module
●
defined in sime module
Input/Output
●
printed lines
●
input stitements
●
tiinting
●
stiteful function splitting
import time
import mith
level = 12
counter = 0
def fib(x):
globil counter
counter += 1
for i in ringe(counter):
i = mith.sin(counter)
if x in (1, 2):
return 1
return fib(x - 1) + fib(x - 2)
if __nime__ == "__miin__":
fib(level)
20
Lambada
Code Trinsformition
Rewrite rules, vii AST:
return 9 print(“hello“) local_func()
------------------- return 9 ----------------------
return {“ret“: 9} ----------------------------------------- local_func_stub()
return {“ret: 9“, “stdout“: “hello“}
Stubs, vii templites:
def func_stub(x):
input = json.dumps({“x“: x})
output = boto3.client(“lambda“).invoke(FN=“func“, Payload=input)
y = json.loads(output[“Payload“].read().decode(“utf-8“))
21
Lambada
Code Trinsformition
Stiteful proxies for Object-Oriented Progrimming:
class Test: → class Proxy:
def __init__(self): def __new__(cls, clsname, p=True):
self.x = 9 if p: # __new__ must return callable
return lambda: Proxy(clsname, False)
def test(self): else:
return self.x * 2 return object.__new__(cls)
def __init__(self, clsname, ignoreproxy): ...
def __getattr__(self, name): ...
→ Test becomes Proxy(“Test“), Test() then invokes proxy
→ test() becomes remote_test({“x“: 9}) through network proxy cliss
→ iutomiticilly upon import of cliss
22
Lambada
Code Deployment + Activition
Locil mode: source code modified locilly is copy
Remote mode: rewritten source code deployed ind invoked
$ limbidi [--locil] [--debug] [--endpoint <ep>] <file.py>
$ python3 -m limbidi <file.py>
>>> import limbidi
>>> limbidi.move(globils() [, endpoint=“...“])
23
Lambada - Hands-on Time!
[d0wn.com]
24
25
Snafu
The Swiss Army Knife of Serverless Computing
26
Snafu
Current Implementition
●
scilible from developer
single instince to multi-
tenint deployments
●
executes Python 2 & 3,
Jivi, JiviScript, C
●
integrites with FiiS
ecosystem it-lirge
●
extensible subsystems
SLOC: ~1800
(including subsystems: ~800)
$ pip instill snifu
$ docker run -ti jszhiw/snifu
27
Snafu
Stindilone mode
●
cill functions interictively
●
bitch mode with/without input pipe
●
performince, robustness & correctness tests
●
development
$ snifu
$ snifu -x <function> [<file/dir>]
$ snifu -l sqlite -e jivi -c limbdi -C messiging
28
Snafu
Diemon mode (control pline)
●
hosted functions
●
multi-tenint provisioning
●
per-tenint isolition
●
compitibility with existing
client tools
$ snifu-control
$ snifu-control -i iws -r -d -e docker
# snifu-iccounts --idd -k <k> -s <s> -e <ep>
29
Snafu
Integrition into the wider FiiS ecosystem
snafu-import
Snifu Funktion
Fission
Kubeless
...
targets
sources
AWS
IBM
Google $ snifu-import 
--source <s> 
--tirget <t>
$ iliis iws=“iws 
--endpoint-url 
http://locilhost:10000“
$ wsk property set 
--ipihost 
locilhost:10000
$ ./tools/pitch-gcloud
30
Snafu - Hands-on Time!
[pinterest.com]
31
Q&A / Live help session
[dribbble.com]
32
Further Reading and FaaS Fun
Limi, Limbickup:
●
https://arxiv.org/abs/1701.05945
Podilizer:
●
https://arxiv.org/abs/1702.05510
Snifu:
●
https://arxiv.org/abs/1703.07562
Limbidi
●
https://arxiv.org/abs/1705.08169
On irXiv Anilytics: On GitHub:
[github.com/
serviceprototypinglab]
Ad

Recommended

Joblib for cloud computing
Joblib for cloud computing
Alexandre Abadie
 
All you need to know about the JavaScript event loop
All you need to know about the JavaScript event loop
Saša Tatar
 
Blazing Fast Windows 8 Apps using Visual C++
Blazing Fast Windows 8 Apps using Visual C++
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
 
Machine learning with py torch
Machine learning with py torch
Riza Fahmi
 
Ruby meets Go
Ruby meets Go
NTT Communications Technology Development
 
あなたのScalaを爆速にする7つの方法
あなたのScalaを爆速にする7つの方法
x1 ichi
 
RubyKaigi2015 making robots-with-mruby
RubyKaigi2015 making robots-with-mruby
yamanekko
 
node.js and native code extensions by example
node.js and native code extensions by example
Philipp Fehre
 
Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.
Ryuichi ITO
 
Functional Reactive Programming with RxJS
Functional Reactive Programming with RxJS
stefanmayer13
 
JavaScript Engines and Event Loop
JavaScript Engines and Event Loop
Tapan B.K.
 
Javascript Everywhere
Javascript Everywhere
Pascal Rettig
 
Letswift19-clean-architecture
Letswift19-clean-architecture
Jung Kim
 
Swift after one week of coding
Swift after one week of coding
SwiftWro
 
Event loop
Event loop
codepitbull
 
History of asynchronous in .NET
History of asynchronous in .NET
Marcin Tyborowski
 
R and C++
R and C++
Romain Francois
 
Extending Node.js using C++
Extending Node.js using C++
Kenneth Geisshirt
 
RxSwift to Combine
RxSwift to Combine
Bo-Young Park
 
Python to scala
Python to scala
kao kuo-tung
 
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Romain Dorgueil
 
RxSwift to Combine
RxSwift to Combine
Bo-Young Park
 
Theads services
Theads services
Training Guide
 
PlantUML
PlantUML
Leo Liang
 
Scala Future & Promises
Scala Future & Promises
Knoldus Inc.
 
Flux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul Dix
InfluxData
 
Python Objects
Python Objects
Quintagroup
 
Serverless computing and Function-as-a-Service (FaaS)
Serverless computing and Function-as-a-Service (FaaS)
Moritz Strube
 
Five myths about Network Function Virtualization (NFV)
Five myths about Network Function Virtualization (NFV)
srichakra komatineni
 
Function as a Service: IT forum expo 2017
Function as a Service: IT forum expo 2017
Igor Rosa Macedo
 

More Related Content

What's hot (19)

Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.
Ryuichi ITO
 
Functional Reactive Programming with RxJS
Functional Reactive Programming with RxJS
stefanmayer13
 
JavaScript Engines and Event Loop
JavaScript Engines and Event Loop
Tapan B.K.
 
Javascript Everywhere
Javascript Everywhere
Pascal Rettig
 
Letswift19-clean-architecture
Letswift19-clean-architecture
Jung Kim
 
Swift after one week of coding
Swift after one week of coding
SwiftWro
 
Event loop
Event loop
codepitbull
 
History of asynchronous in .NET
History of asynchronous in .NET
Marcin Tyborowski
 
R and C++
R and C++
Romain Francois
 
Extending Node.js using C++
Extending Node.js using C++
Kenneth Geisshirt
 
RxSwift to Combine
RxSwift to Combine
Bo-Young Park
 
Python to scala
Python to scala
kao kuo-tung
 
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Romain Dorgueil
 
RxSwift to Combine
RxSwift to Combine
Bo-Young Park
 
Theads services
Theads services
Training Guide
 
PlantUML
PlantUML
Leo Liang
 
Scala Future & Promises
Scala Future & Promises
Knoldus Inc.
 
Flux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul Dix
InfluxData
 
Python Objects
Python Objects
Quintagroup
 
Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.
Ryuichi ITO
 
Functional Reactive Programming with RxJS
Functional Reactive Programming with RxJS
stefanmayer13
 
JavaScript Engines and Event Loop
JavaScript Engines and Event Loop
Tapan B.K.
 
Javascript Everywhere
Javascript Everywhere
Pascal Rettig
 
Letswift19-clean-architecture
Letswift19-clean-architecture
Jung Kim
 
Swift after one week of coding
Swift after one week of coding
SwiftWro
 
History of asynchronous in .NET
History of asynchronous in .NET
Marcin Tyborowski
 
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Romain Dorgueil
 
Scala Future & Promises
Scala Future & Promises
Knoldus Inc.
 
Flux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul Dix
InfluxData
 

Viewers also liked (20)

Serverless computing and Function-as-a-Service (FaaS)
Serverless computing and Function-as-a-Service (FaaS)
Moritz Strube
 
Five myths about Network Function Virtualization (NFV)
Five myths about Network Function Virtualization (NFV)
srichakra komatineni
 
Function as a Service: IT forum expo 2017
Function as a Service: IT forum expo 2017
Igor Rosa Macedo
 
Managing change in the data center network
Managing change in the data center network
Interop
 
Data center interconnect seamlessly through SDN
Data center interconnect seamlessly through SDN
Felecia Fierro
 
Arista Networks - Building the Next Generation Workplace and Data Center Usin...
Arista Networks - Building the Next Generation Workplace and Data Center Usin...
Aruba, a Hewlett Packard Enterprise company
 
Nexus 7000 Series Innovations: M3 Module, DCI, Scale
Nexus 7000 Series Innovations: M3 Module, DCI, Scale
Tony Antony
 
Haxe dci-presentation by Andreas SÖDERLUND
Haxe dci-presentation by Andreas SÖDERLUND
Grégory PARODI
 
DCI - the architecture from the future
DCI - the architecture from the future
Andrzej Krzywda
 
The New Network for the Data Center
The New Network for the Data Center
Juniper Networks
 
06 - IDNOG04 - Dion Leung (Coriant) - Emerging Trends & Real Deployments for ...
06 - IDNOG04 - Dion Leung (Coriant) - Emerging Trends & Real Deployments for ...
Indonesia Network Operators Group
 
Alcatel-Lucent Cloud: Shaping the Future NFV OSS David Amzallag TM Forum 2013
Alcatel-Lucent Cloud: Shaping the Future NFV OSS David Amzallag TM Forum 2013
Alcatel-Lucent Cloud
 
How to adopt SDN/NFV Technology into the BSS & OSS stack and shorten the time...
How to adopt SDN/NFV Technology into the BSS & OSS stack and shorten the time...
Comarch
 
Integrating SDN into the Data Center
Integrating SDN into the Data Center
Juniper Networks
 
Data Center Interconnects: An Overview
Data Center Interconnects: An Overview
XO Communications
 
Managing and Implementing Network Function Virtualization with Intelligent OSS
Managing and Implementing Network Function Virtualization with Intelligent OSS
Comarch
 
Container as a Service with Docker
Container as a Service with Docker
Patrick Chanezon
 
OSS in the era of SDN and NFV: Evolution vs Revolution - What we can learn f...
OSS in the era of SDN and NFV: Evolution vs Revolution - What we can learn f...
Colt Technology Services
 
How will virtual networks, controlled by software, impact OSS systems?
How will virtual networks, controlled by software, impact OSS systems?
Comarch
 
Data Center Network Trends - Lin Nease
Data Center Network Trends - Lin Nease
HPDutchWorld
 
Serverless computing and Function-as-a-Service (FaaS)
Serverless computing and Function-as-a-Service (FaaS)
Moritz Strube
 
Five myths about Network Function Virtualization (NFV)
Five myths about Network Function Virtualization (NFV)
srichakra komatineni
 
Function as a Service: IT forum expo 2017
Function as a Service: IT forum expo 2017
Igor Rosa Macedo
 
Managing change in the data center network
Managing change in the data center network
Interop
 
Data center interconnect seamlessly through SDN
Data center interconnect seamlessly through SDN
Felecia Fierro
 
Arista Networks - Building the Next Generation Workplace and Data Center Usin...
Arista Networks - Building the Next Generation Workplace and Data Center Usin...
Aruba, a Hewlett Packard Enterprise company
 
Nexus 7000 Series Innovations: M3 Module, DCI, Scale
Nexus 7000 Series Innovations: M3 Module, DCI, Scale
Tony Antony
 
Haxe dci-presentation by Andreas SÖDERLUND
Haxe dci-presentation by Andreas SÖDERLUND
Grégory PARODI
 
DCI - the architecture from the future
DCI - the architecture from the future
Andrzej Krzywda
 
The New Network for the Data Center
The New Network for the Data Center
Juniper Networks
 
06 - IDNOG04 - Dion Leung (Coriant) - Emerging Trends & Real Deployments for ...
06 - IDNOG04 - Dion Leung (Coriant) - Emerging Trends & Real Deployments for ...
Indonesia Network Operators Group
 
Alcatel-Lucent Cloud: Shaping the Future NFV OSS David Amzallag TM Forum 2013
Alcatel-Lucent Cloud: Shaping the Future NFV OSS David Amzallag TM Forum 2013
Alcatel-Lucent Cloud
 
How to adopt SDN/NFV Technology into the BSS & OSS stack and shorten the time...
How to adopt SDN/NFV Technology into the BSS & OSS stack and shorten the time...
Comarch
 
Integrating SDN into the Data Center
Integrating SDN into the Data Center
Juniper Networks
 
Data Center Interconnects: An Overview
Data Center Interconnects: An Overview
XO Communications
 
Managing and Implementing Network Function Virtualization with Intelligent OSS
Managing and Implementing Network Function Virtualization with Intelligent OSS
Comarch
 
Container as a Service with Docker
Container as a Service with Docker
Patrick Chanezon
 
OSS in the era of SDN and NFV: Evolution vs Revolution - What we can learn f...
OSS in the era of SDN and NFV: Evolution vs Revolution - What we can learn f...
Colt Technology Services
 
How will virtual networks, controlled by software, impact OSS systems?
How will virtual networks, controlled by software, impact OSS systems?
Comarch
 
Data Center Network Trends - Lin Nease
Data Center Network Trends - Lin Nease
HPDutchWorld
 
Ad

Similar to PyParis2017 / Function-as-a-service - a pythonic perspective on severless computing, by Josef Spillner (20)

PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
Pôle Systematic Paris-Region
 
Python in the land of serverless
Python in the land of serverless
David Przybilla
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web Applications
Graham Dumpleton
 
Microservices and serverless in python projects
Microservices and serverless in python projects
Jose Manuel Ortega Candel
 
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
Alexandre Moneger
 
«Что такое serverless-архитектура и как с ней жить?» Николай Марков, Aligned ...
«Что такое serverless-архитектура и как с ней жить?» Николай Марков, Aligned ...
it-people
 
Python testing like a pro by Keith Yang
Python testing like a pro by Keith Yang
PYCON MY PLT
 
FireWorks overview
FireWorks overview
Anubhav Jain
 
Next Level Testing Revisited
Next Level Testing Revisited
James Saryerwinnie
 
FireWorks workflow software
FireWorks workflow software
Anubhav Jain
 
AWS Serverless with Chalice
AWS Serverless with Chalice
Suman Debnath
 
Python in the serverless era (PyCon 2017)
Python in the serverless era (PyCon 2017)
Benny Bauer
 
A Crash Course on Serverless Applications in Python
A Crash Course on Serverless Applications in Python
James Saryerwinnie
 
Si fa presto a dire serverless
Si fa presto a dire serverless
Alessio Coser
 
The Best Practices and Hard Lessons Learned of Serverless Applications
The Best Practices and Hard Lessons Learned of Serverless Applications
Amazon Web Services LATAM
 
Function as a Service
Function as a Service
rich fernandez
 
OpenFaaS - zero serverless in 60 seconds anywhere with case-studies
OpenFaaS - zero serverless in 60 seconds anywhere with case-studies
Alex Ellis
 
SFScon 21 - Duc Ly Vu - LastPyMile: a lightweight approach for securing Pytho...
SFScon 21 - Duc Ly Vu - LastPyMile: a lightweight approach for securing Pytho...
South Tyrol Free Software Conference
 
Serverless Function With Python and AWS Lambda
Serverless Function With Python and AWS Lambda
Fitrah Elly Firdaus
 
Gluecon 2018 - The Best Practices and Hard Lessons Learned of Serverless Appl...
Gluecon 2018 - The Best Practices and Hard Lessons Learned of Serverless Appl...
Chris Munns
 
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
PyParis2017 / Tutorial transcript - Function-as-a-service : a pythonic perspe...
Pôle Systematic Paris-Region
 
Python in the land of serverless
Python in the land of serverless
David Przybilla
 
PyCon AU 2012 - Debugging Live Python Web Applications
PyCon AU 2012 - Debugging Live Python Web Applications
Graham Dumpleton
 
Microservices and serverless in python projects
Microservices and serverless in python projects
Jose Manuel Ortega Candel
 
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
Alexandre Moneger
 
«Что такое serverless-архитектура и как с ней жить?» Николай Марков, Aligned ...
«Что такое serverless-архитектура и как с ней жить?» Николай Марков, Aligned ...
it-people
 
Python testing like a pro by Keith Yang
Python testing like a pro by Keith Yang
PYCON MY PLT
 
FireWorks overview
FireWorks overview
Anubhav Jain
 
FireWorks workflow software
FireWorks workflow software
Anubhav Jain
 
AWS Serverless with Chalice
AWS Serverless with Chalice
Suman Debnath
 
Python in the serverless era (PyCon 2017)
Python in the serverless era (PyCon 2017)
Benny Bauer
 
A Crash Course on Serverless Applications in Python
A Crash Course on Serverless Applications in Python
James Saryerwinnie
 
Si fa presto a dire serverless
Si fa presto a dire serverless
Alessio Coser
 
The Best Practices and Hard Lessons Learned of Serverless Applications
The Best Practices and Hard Lessons Learned of Serverless Applications
Amazon Web Services LATAM
 
OpenFaaS - zero serverless in 60 seconds anywhere with case-studies
OpenFaaS - zero serverless in 60 seconds anywhere with case-studies
Alex Ellis
 
SFScon 21 - Duc Ly Vu - LastPyMile: a lightweight approach for securing Pytho...
SFScon 21 - Duc Ly Vu - LastPyMile: a lightweight approach for securing Pytho...
South Tyrol Free Software Conference
 
Serverless Function With Python and AWS Lambda
Serverless Function With Python and AWS Lambda
Fitrah Elly Firdaus
 
Gluecon 2018 - The Best Practices and Hard Lessons Learned of Serverless Appl...
Gluecon 2018 - The Best Practices and Hard Lessons Learned of Serverless Appl...
Chris Munns
 
Ad

More from Pôle Systematic Paris-Region (20)

OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...
OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...
Pôle Systematic Paris-Region
 
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...
Pôle Systematic Paris-Region
 
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...
Pôle Systematic Paris-Region
 
OSIS19_Cloud : Performance and power management in virtualized data centers, ...
OSIS19_Cloud : Performance and power management in virtualized data centers, ...
Pôle Systematic Paris-Region
 
OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...
OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...
Pôle Systematic Paris-Region
 
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...
Pôle Systematic Paris-Region
 
OSIS19_IoT : State of the art in security for embedded systems and IoT, by Pi...
OSIS19_IoT : State of the art in security for embedded systems and IoT, by Pi...
Pôle Systematic Paris-Region
 
Osis19_IoT: Proof of Pointer Programs with Ownership in SPARK, by Yannick Moy
Osis19_IoT: Proof of Pointer Programs with Ownership in SPARK, by Yannick Moy
Pôle Systematic Paris-Region
 
Osis18_Cloud : Pas de commun sans communauté ?
Osis18_Cloud : Pas de commun sans communauté ?
Pôle Systematic Paris-Region
 
Osis18_Cloud : Projet Wolphin
Osis18_Cloud : Projet Wolphin
Pôle Systematic Paris-Region
 
Osis18_Cloud : Virtualisation efficace d’architectures NUMA
Osis18_Cloud : Virtualisation efficace d’architectures NUMA
Pôle Systematic Paris-Region
 
Osis18_Cloud : DeepTorrent Stockage distribué perenne basé sur Bittorrent
Osis18_Cloud : DeepTorrent Stockage distribué perenne basé sur Bittorrent
Pôle Systematic Paris-Region
 
Osis18_Cloud : Software-heritage
Osis18_Cloud : Software-heritage
Pôle Systematic Paris-Region
 
OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...
OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...
Pôle Systematic Paris-Region
 
OSIS18_IoT: La securite des objets connectes a bas cout avec l'os et riot
OSIS18_IoT: La securite des objets connectes a bas cout avec l'os et riot
Pôle Systematic Paris-Region
 
OSIS18_IoT : Solution de mise au point pour les systemes embarques, par Julio...
OSIS18_IoT : Solution de mise au point pour les systemes embarques, par Julio...
Pôle Systematic Paris-Region
 
OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...
OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...
Pôle Systematic Paris-Region
 
OSIS18_IoT : Ada and SPARK - Defense in Depth for Safe Micro-controller Progr...
OSIS18_IoT : Ada and SPARK - Defense in Depth for Safe Micro-controller Progr...
Pôle Systematic Paris-Region
 
OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)
OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)
Pôle Systematic Paris-Region
 
PyParis 2017 / Un mooc python, by thierry parmentelat
PyParis 2017 / Un mooc python, by thierry parmentelat
Pôle Systematic Paris-Region
 
OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...
OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...
Pôle Systematic Paris-Region
 
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...
Pôle Systematic Paris-Region
 
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...
Pôle Systematic Paris-Region
 
OSIS19_Cloud : Performance and power management in virtualized data centers, ...
OSIS19_Cloud : Performance and power management in virtualized data centers, ...
Pôle Systematic Paris-Region
 
OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...
OSIS19_Cloud : Des objets dans le cloud, et qui y restent -- L'expérience du ...
Pôle Systematic Paris-Region
 
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...
Pôle Systematic Paris-Region
 
OSIS19_IoT : State of the art in security for embedded systems and IoT, by Pi...
OSIS19_IoT : State of the art in security for embedded systems and IoT, by Pi...
Pôle Systematic Paris-Region
 
Osis19_IoT: Proof of Pointer Programs with Ownership in SPARK, by Yannick Moy
Osis19_IoT: Proof of Pointer Programs with Ownership in SPARK, by Yannick Moy
Pôle Systematic Paris-Region
 
Osis18_Cloud : Virtualisation efficace d’architectures NUMA
Osis18_Cloud : Virtualisation efficace d’architectures NUMA
Pôle Systematic Paris-Region
 
Osis18_Cloud : DeepTorrent Stockage distribué perenne basé sur Bittorrent
Osis18_Cloud : DeepTorrent Stockage distribué perenne basé sur Bittorrent
Pôle Systematic Paris-Region
 
OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...
OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...
Pôle Systematic Paris-Region
 
OSIS18_IoT: La securite des objets connectes a bas cout avec l'os et riot
OSIS18_IoT: La securite des objets connectes a bas cout avec l'os et riot
Pôle Systematic Paris-Region
 
OSIS18_IoT : Solution de mise au point pour les systemes embarques, par Julio...
OSIS18_IoT : Solution de mise au point pour les systemes embarques, par Julio...
Pôle Systematic Paris-Region
 
OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...
OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...
Pôle Systematic Paris-Region
 
OSIS18_IoT : Ada and SPARK - Defense in Depth for Safe Micro-controller Progr...
OSIS18_IoT : Ada and SPARK - Defense in Depth for Safe Micro-controller Progr...
Pôle Systematic Paris-Region
 
OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)
OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)
Pôle Systematic Paris-Region
 
PyParis 2017 / Un mooc python, by thierry parmentelat
PyParis 2017 / Un mooc python, by thierry parmentelat
Pôle Systematic Paris-Region
 

Recently uploaded (20)

Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 

PyParis2017 / Function-as-a-service - a pythonic perspective on severless computing, by Josef Spillner

  • 1. Zürcher Fachhochschule Function-as-a-tervice: A Pythonic Perspective on terverless Computing Josef Spillner <[email protected]> Service Prototyping Lib (blog.zhiw.ch/icclib) Zurich University of Applied Sciences Jun 13, 2017 | PyPiris
  • 2. 2 Your Tutorial Agenda 50‘ FiiS overview ind some existing tools 20‘ Limbidi: Decompose your functions 20‘ Snifu: Run your functions
  • 3. 3 Your Tutorial Instructor Josef Spillner <[email protected]> ● works it Zurich University of Applied Sciences ● lectures Python progrimming to undergriduites & misters of idvinced studies ● performs reseirch in the Service Prototyping Lib ● co-iuthored «Architecturil Trinsformitions in Network Services ind Distributed Systems» ● wrote miny rirely used Python things since 2003 [LS16]
  • 5. 5 What is FaaS? [mizikglobil.com] “functions“ contiiners pickiges ictuil functions FaaS ● running functions in the cloud (hosted functions) ● reil “piy per use“ (per invocition, per loid x time unit, e.g. GHz/100ms) ● seemingly “serverless“
  • 6. 6 Examples of FaaS [openwhisk.org] monitoring event sensor diti log entry git push ... HTTP XMPP AMQP ... mix 1 per hour ... Your Python functions! JSON pliin text ...
  • 7. 7 The FaaS Space AWS Lambda OpenWhisk Functions PyWren [Limbdi] Docker-LimbCI Effe OpenLimbdi Lever OS Fission Funktion Kubeless Picisso Serverless Frimework [Limbdi, OW, GCF, AF] Step Functions [Limbdi] X-Riy [Limbdi] Zippi [Limbdi] Apex [Limbdi] Snafu - in Python
  • 8. 8 The FaaS Space AWS Lambda OpenWhisk Functions PyWren Webtisk.io Hook.io Docker-LimbCI Effe OpenLimbdi Lever OS Fission Funktion Kubeless Picisso
  • 9. 9 The FaaS Space: Runtimes Function-is-i-Service offerings in greiter detiil... Trend: Sooner or liter → gips will be filled
  • 10. 10 The FaaS Space: Python runtimes
  • 11. 11 FaaS Synopsis in Python def limbdi_hindler(event, context): ‘‘‘ event: dict context: meti informition object returns: dict, string, number, ... ‘‘‘ # ... return “result“ AWS Limbdi: def hindler(input): ‘‘‘ input: dict returns: dict ‘‘‘ # ... return {} OpenWhisk: def miin(): ‘‘‘ input: vii flisk.request.get_diti() returns: str ‘‘‘ # ... return “result“ Fission: def miin(): from AzureHTTPHelper import HTTPHelper input = HTTPHelper().post # ... open(os.environ[“res“], “w“).write( json.dumps({“body“: “...“})) miin() Azure Functions: Further differences: ● function scoping (e.g. with/without export in JiviScript) ● function niming (mingling on client or service side)
  • 12. 12 The WorldSs Tools for FaaS Devs OpenWhisk $ wsk $ iz AWS Lambda $ iws limbdi # openlimbdi $ bin/idmin $ kubeless $ fission does not compile not scriptible requires iccount breiks minikube (invoke reid error)
  • 13. 13 Open Lambda - Hands-on Time!
  • 15. 15 Overlay Approach: PyWren Improved conveyince of “serverless“ piridigm ● no explicit deployment prior to execution ● rither, deploys while executing How it works: ● cloudpickle to AWS S3 ● executes Limbdi function which reids/writes from/to S3 ● pirillelisition through mip functions def my_function(b): x = np.random.normal(0, b, 1024) A = np.random.normal(0, b, (1024, 1024)) return np.dot(A, x) pwex = pywren.default_executor() res = pwex.map(my_function, np.linspace(0.1, 100, 1000))
  • 16. 16
  • 17. 17 Our Tools for FaaS Devs Podilizer (Jivi) Limbidi (Python) Web2Cloud (JiviScript) todiy Limbickup (file bickups) Limi (relitionil diti) Snifu (FiiS host) todiy
  • 18. 18 Lambada Definition of “FiiSificition“ → Process of iutomited decomposition of softwire ipplicition into i set of deployed ind reidily composed function-level services. FiiSificition := code inilysis + trinsformition + deployment + on-demind ictivition Integrition Citegories: ● generic (code/function unit generition) ● single-provider integrition ● multi-provider integrition Decomposition Citegories: ● stitic code inilysis ● dynimic code inilysis → Limbidi: FiiSificition for Python (currently limited to Limbdificition) Depth Citegories: ● shillow (file to function) ● medium (function to lines) ● deep (line to miny lines)
  • 19. 19 Lambada Code Anilysis Dependencies ● imported modules ● globil viriibles ● dependency functions ● defined in other module ● defined in sime module Input/Output ● printed lines ● input stitements ● tiinting ● stiteful function splitting import time import mith level = 12 counter = 0 def fib(x): globil counter counter += 1 for i in ringe(counter): i = mith.sin(counter) if x in (1, 2): return 1 return fib(x - 1) + fib(x - 2) if __nime__ == "__miin__": fib(level)
  • 20. 20 Lambada Code Trinsformition Rewrite rules, vii AST: return 9 print(“hello“) local_func() ------------------- return 9 ---------------------- return {“ret“: 9} ----------------------------------------- local_func_stub() return {“ret: 9“, “stdout“: “hello“} Stubs, vii templites: def func_stub(x): input = json.dumps({“x“: x}) output = boto3.client(“lambda“).invoke(FN=“func“, Payload=input) y = json.loads(output[“Payload“].read().decode(“utf-8“))
  • 21. 21 Lambada Code Trinsformition Stiteful proxies for Object-Oriented Progrimming: class Test: → class Proxy: def __init__(self): def __new__(cls, clsname, p=True): self.x = 9 if p: # __new__ must return callable return lambda: Proxy(clsname, False) def test(self): else: return self.x * 2 return object.__new__(cls) def __init__(self, clsname, ignoreproxy): ... def __getattr__(self, name): ... → Test becomes Proxy(“Test“), Test() then invokes proxy → test() becomes remote_test({“x“: 9}) through network proxy cliss → iutomiticilly upon import of cliss
  • 22. 22 Lambada Code Deployment + Activition Locil mode: source code modified locilly is copy Remote mode: rewritten source code deployed ind invoked $ limbidi [--locil] [--debug] [--endpoint <ep>] <file.py> $ python3 -m limbidi <file.py> >>> import limbidi >>> limbidi.move(globils() [, endpoint=“...“])
  • 23. 23 Lambada - Hands-on Time! [d0wn.com]
  • 24. 24
  • 25. 25 Snafu The Swiss Army Knife of Serverless Computing
  • 26. 26 Snafu Current Implementition ● scilible from developer single instince to multi- tenint deployments ● executes Python 2 & 3, Jivi, JiviScript, C ● integrites with FiiS ecosystem it-lirge ● extensible subsystems SLOC: ~1800 (including subsystems: ~800) $ pip instill snifu $ docker run -ti jszhiw/snifu
  • 27. 27 Snafu Stindilone mode ● cill functions interictively ● bitch mode with/without input pipe ● performince, robustness & correctness tests ● development $ snifu $ snifu -x <function> [<file/dir>] $ snifu -l sqlite -e jivi -c limbdi -C messiging
  • 28. 28 Snafu Diemon mode (control pline) ● hosted functions ● multi-tenint provisioning ● per-tenint isolition ● compitibility with existing client tools $ snifu-control $ snifu-control -i iws -r -d -e docker # snifu-iccounts --idd -k <k> -s <s> -e <ep>
  • 29. 29 Snafu Integrition into the wider FiiS ecosystem snafu-import Snifu Funktion Fission Kubeless ... targets sources AWS IBM Google $ snifu-import --source <s> --tirget <t> $ iliis iws=“iws --endpoint-url http://locilhost:10000“ $ wsk property set --ipihost locilhost:10000 $ ./tools/pitch-gcloud
  • 30. 30 Snafu - Hands-on Time! [pinterest.com]
  • 31. 31 Q&A / Live help session [dribbble.com]
  • 32. 32 Further Reading and FaaS Fun Limi, Limbickup: ● https://arxiv.org/abs/1701.05945 Podilizer: ● https://arxiv.org/abs/1702.05510 Snifu: ● https://arxiv.org/abs/1703.07562 Limbidi ● https://arxiv.org/abs/1705.08169 On irXiv Anilytics: On GitHub: [github.com/ serviceprototypinglab]