SlideShare una empresa de Scribd logo
1 de 32
Descargar para leer sin conexión
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]

Más contenido relacionado

La actualidad más candente

La actualidad más candente (19)

Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.Internship final report@Treasure Data Inc.
Internship final report@Treasure Data Inc.
 
Functional Reactive Programming with RxJS
Functional Reactive Programming with RxJSFunctional Reactive Programming with RxJS
Functional Reactive Programming with RxJS
 
JavaScript Engines and Event Loop
JavaScript Engines and Event Loop JavaScript Engines and Event Loop
JavaScript Engines and Event Loop
 
Javascript Everywhere
Javascript EverywhereJavascript Everywhere
Javascript Everywhere
 
Letswift19-clean-architecture
Letswift19-clean-architectureLetswift19-clean-architecture
Letswift19-clean-architecture
 
Swift after one week of coding
Swift after one week of codingSwift after one week of coding
Swift after one week of coding
 
Event loop
Event loopEvent loop
Event loop
 
History of asynchronous in .NET
History of asynchronous in .NETHistory of asynchronous in .NET
History of asynchronous in .NET
 
R and C++
R and C++R and C++
R and C++
 
Extending Node.js using C++
Extending Node.js using C++Extending Node.js using C++
Extending Node.js using C++
 
RxSwift to Combine
RxSwift to CombineRxSwift to Combine
RxSwift to Combine
 
Python to scala
Python to scalaPython to scala
Python to scala
 
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
 
RxSwift to Combine
RxSwift to CombineRxSwift to Combine
RxSwift to Combine
 
Theads services
Theads servicesTheads services
Theads services
 
PlantUML
PlantUMLPlantUML
PlantUML
 
Scala Future & Promises
Scala Future & PromisesScala Future & Promises
Scala Future & Promises
 
Flux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul DixFlux and InfluxDB 2.0 by Paul Dix
Flux and InfluxDB 2.0 by Paul Dix
 
Python Objects
Python ObjectsPython Objects
Python Objects
 

Destacado

Managing change in the data center network
Managing change in the data center networkManaging change in the data center network
Managing change in the data center network
Interop
 
Data Center Network Trends - Lin Nease
Data Center Network Trends - Lin NeaseData Center Network Trends - Lin Nease
Data Center Network Trends - Lin Nease
HPDutchWorld
 

Destacado (20)

Serverless computing and Function-as-a-Service (FaaS)
Serverless computing and Function-as-a-Service (FaaS)Serverless computing and Function-as-a-Service (FaaS)
Serverless computing and Function-as-a-Service (FaaS)
 
Five myths about Network Function Virtualization (NFV)
Five myths about Network Function Virtualization (NFV) Five myths about Network Function Virtualization (NFV)
Five myths about Network Function Virtualization (NFV)
 
Function as a Service: IT forum expo 2017
Function as a Service: IT forum expo 2017Function as a Service: IT forum expo 2017
Function as a Service: IT forum expo 2017
 
Managing change in the data center network
Managing change in the data center networkManaging change in the data center network
Managing change in the data center network
 
Data center interconnect seamlessly through SDN
Data center interconnect seamlessly through SDNData center interconnect seamlessly through SDN
Data center interconnect seamlessly through SDN
 
Arista Networks - Building the Next Generation Workplace and Data Center Usin...
Arista Networks - Building the Next Generation Workplace and Data Center Usin...Arista Networks - Building the Next Generation Workplace and Data Center Usin...
Arista Networks - Building the Next Generation Workplace and Data Center Usin...
 
Nexus 7000 Series Innovations: M3 Module, DCI, Scale
Nexus 7000 Series Innovations: M3 Module, DCI, ScaleNexus 7000 Series Innovations: M3 Module, DCI, Scale
Nexus 7000 Series Innovations: M3 Module, DCI, Scale
 
Haxe dci-presentation by Andreas SÖDERLUND
Haxe   dci-presentation by Andreas SÖDERLUNDHaxe   dci-presentation by Andreas SÖDERLUND
Haxe dci-presentation by Andreas SÖDERLUND
 
DCI - the architecture from the future
DCI - the architecture from the futureDCI - the architecture from the future
DCI - the architecture from the future
 
The New Network for the Data Center
The New Network for the Data CenterThe New Network for the Data Center
The New Network for the Data Center
 
06 - IDNOG04 - Dion Leung (Coriant) - Emerging Trends & Real Deployments for ...
06 - IDNOG04 - Dion Leung (Coriant) - Emerging Trends & Real Deployments for ...06 - IDNOG04 - Dion Leung (Coriant) - Emerging Trends & Real Deployments for ...
06 - IDNOG04 - Dion Leung (Coriant) - Emerging Trends & Real Deployments for ...
 
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 2013Alcatel-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
 
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...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...
 
Integrating SDN into the Data Center
Integrating SDN into the Data CenterIntegrating SDN into the Data Center
Integrating SDN into the Data Center
 
Data Center Interconnects: An Overview
Data Center Interconnects: An OverviewData Center Interconnects: An Overview
Data Center Interconnects: An Overview
 
Managing and Implementing Network Function Virtualization with Intelligent OSS
Managing and Implementing Network Function Virtualization with Intelligent OSSManaging and Implementing Network Function Virtualization with Intelligent OSS
Managing and Implementing Network Function Virtualization with Intelligent OSS
 
Container as a Service with Docker
Container as a Service with DockerContainer as a Service with Docker
Container as a Service with Docker
 
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...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...
 
How will virtual networks, controlled by software, impact OSS systems?
How will virtual networks, controlled by software, impact OSS systems?How will virtual networks, controlled by software, impact OSS systems?
How will virtual networks, controlled by software, impact OSS systems?
 
Data Center Network Trends - Lin Nease
Data Center Network Trends - Lin NeaseData Center Network Trends - Lin Nease
Data Center Network Trends - Lin Nease
 

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

MLOps Case Studies: Building fast, scalable, and high-accuracy ML systems at ...
MLOps Case Studies: Building fast, scalable, and high-accuracy ML systems at ...MLOps Case Studies: Building fast, scalable, and high-accuracy ML systems at ...
MLOps Case Studies: Building fast, scalable, and high-accuracy ML systems at ...
Masashi Shibata
 

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

Twins: OOP and FP
Twins: OOP and FPTwins: OOP and FP
Twins: OOP and FP
 
Cluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CCluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in C
 
Everything ruby
Everything rubyEverything ruby
Everything ruby
 
Tasks: you gotta know how to run them
Tasks: you gotta know how to run themTasks: you gotta know how to run them
Tasks: you gotta know how to run them
 
PyHEP 2018: Tools to bind to Python
PyHEP 2018:  Tools to bind to PythonPyHEP 2018:  Tools to bind to Python
PyHEP 2018: Tools to bind to Python
 
Introduction to PiCloud
Introduction to PiCloudIntroduction to PiCloud
Introduction to PiCloud
 
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
Distributed computing with Ray. Find your hyper-parameters, speed up your Pan...
 
GDG-MLOps using Protobuf in Unity
GDG-MLOps using Protobuf in UnityGDG-MLOps using Protobuf in Unity
GDG-MLOps using Protobuf in Unity
 
Python Load Testing - Pygotham 2012
Python Load Testing - Pygotham 2012Python Load Testing - Pygotham 2012
Python Load Testing - Pygotham 2012
 
MLOps Case Studies: Building fast, scalable, and high-accuracy ML systems at ...
MLOps Case Studies: Building fast, scalable, and high-accuracy ML systems at ...MLOps Case Studies: Building fast, scalable, and high-accuracy ML systems at ...
MLOps Case Studies: Building fast, scalable, and high-accuracy ML systems at ...
 
Exciting JavaScript - Part I
Exciting JavaScript - Part IExciting JavaScript - Part I
Exciting JavaScript - Part I
 
Python Hashlib & A True Story of One Bug
Python Hashlib & A True Story of One BugPython Hashlib & A True Story of One Bug
Python Hashlib & A True Story of One Bug
 
Node.js Patterns for Discerning Developers
Node.js Patterns for Discerning DevelopersNode.js Patterns for Discerning Developers
Node.js Patterns for Discerning Developers
 
Nix for Python developers
Nix for Python developersNix for Python developers
Nix for Python developers
 
Euro python2011 High Performance Python
Euro python2011 High Performance PythonEuro python2011 High Performance Python
Euro python2011 High Performance Python
 
Dlr
DlrDlr
Dlr
 
Python高级编程(二)
Python高级编程(二)Python高级编程(二)
Python高级编程(二)
 
CoffeeScript - TechTalk 21/10/2013
CoffeeScript - TechTalk 21/10/2013CoffeeScript - TechTalk 21/10/2013
CoffeeScript - TechTalk 21/10/2013
 
ECMAScript 6 and the Node Driver
ECMAScript 6 and the Node DriverECMAScript 6 and the Node Driver
ECMAScript 6 and the Node Driver
 
End-to-end Big Data Projects with Python - StampedeCon Big Data Conference 2017
End-to-end Big Data Projects with Python - StampedeCon Big Data Conference 2017End-to-end Big Data Projects with Python - StampedeCon Big Data Conference 2017
End-to-end Big Data Projects with Python - StampedeCon Big Data Conference 2017
 

Más de Pôle Systematic Paris-Region

Más de 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...OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...
OSIS19_IoT :Transparent remote connectivity to short-range IoT devices, by Na...
 
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...
OSIS19_Cloud : SAFC: Scheduling and Allocation Framework for Containers in a ...
 
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...
OSIS19_Cloud : Qu’apporte l’observabilité à la gestion de configuration? par ...
 
OSIS19_Cloud : Performance and power management in virtualized data centers, ...
OSIS19_Cloud : Performance and power management in virtualized data centers, ...OSIS19_Cloud : Performance and power management in virtualized data centers, ...
OSIS19_Cloud : Performance and power management in virtualized data centers, ...
 
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 ...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 ...
 
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...
OSIS19_Cloud : Attribution automatique de ressources pour micro-services, Alt...
 
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...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...
 
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 MoyOsis19_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
 
Osis18_Cloud : Pas de commun sans communauté ?
Osis18_Cloud : Pas de commun sans communauté ?Osis18_Cloud : Pas de commun sans communauté ?
Osis18_Cloud : Pas de commun sans communauté ?
 
Osis18_Cloud : Projet Wolphin
Osis18_Cloud : Projet Wolphin Osis18_Cloud : Projet Wolphin
Osis18_Cloud : Projet Wolphin
 
Osis18_Cloud : Virtualisation efficace d’architectures NUMA
Osis18_Cloud : Virtualisation efficace d’architectures NUMAOsis18_Cloud : Virtualisation efficace d’architectures NUMA
Osis18_Cloud : Virtualisation efficace d’architectures NUMA
 
Osis18_Cloud : DeepTorrent Stockage distribué perenne basé sur Bittorrent
Osis18_Cloud : DeepTorrent Stockage distribué perenne basé sur BittorrentOsis18_Cloud : DeepTorrent Stockage distribué perenne basé sur Bittorrent
Osis18_Cloud : DeepTorrent Stockage distribué perenne basé sur Bittorrent
 
Osis18_Cloud : Software-heritage
Osis18_Cloud : Software-heritageOsis18_Cloud : Software-heritage
Osis18_Cloud : Software-heritage
 
OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...
OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...
OSIS18_IoT: L'approche machine virtuelle pour les microcontrôleurs, le projet...
 
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 riotOSIS18_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
 
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...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...
 
OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...
OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...
OSIS18_IoT : Securisation du reseau des objets connectes, par Nicolas LE SAUZ...
 
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...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...
 
OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)
OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)
OSIS18_IoT : RTEMS pour l'IoT professionnel, par Pierre Ficheux (Smile ECS)
 
PyParis 2017 / Un mooc python, by thierry parmentelat
PyParis 2017 / Un mooc python, by thierry parmentelatPyParis 2017 / Un mooc python, by thierry parmentelat
PyParis 2017 / Un mooc python, by thierry parmentelat
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Último (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

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 <josef.spillner@zhiw.ch> 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 <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]
  • 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]