SlideShare a Scribd company logo
Function-as-a-Service: A Pythonic Perspective
on Serverless Computing – Tutorial @ PyParis
2017
Josef Spillner
Zurich University of Applied Sciences, School of Engineering
Service Prototyping Lab (blog.zhaw.ch/icclab/)
8401 Winterthur, Switzerland
josef.spillner@zhaw.ch
June 9, 2017
Learning Objective
Learn on a practical level about different FaaS programming conventions,
runtimes, service providers and tools. Use some of the tools by yourself
to FaaSify simple Python applications.
1 Using Lambada
Snafu extracts your functions from code files.
Obtain Lambada directly from its source repository. You will furthermore
need Python 3.5 or more recent installed.
Listing 1: Obtaining Lambada
git clone https :// gitlab.com/josefspillner/lambada.git
Start by creating a file temperature.py. It contains one function and one
class which together form your «temperature application» (Listing 2).
Listing 2: Temperature application
def temperature ():
return 42.23
class CityTemperature :
def temperaturecity (self , city):
self.city = city
return 99
Now use Lambada to transform the contents into FaaS units which can still
be executed locally but are ready to be deployed in AWS Lambda (Listing 3).
1
transcript
type:
tutorial
distribution:
public
status:
final
initiative:
Service Tool-
ing
Listing 3: FaaSification process
./ lambada --local temperature.py
Then verify the generated Python file and notice its structure. Use any
editor of your choice on the newly generated file temperature_lambdafied.py.
Afterwards, check the functionality in the Python console. Run the following
(Listing 4).
Listing 4: FaaSified temperature application
python3
>>> import test_lambdafied
>>> dir( test_lambdafied )
>>> test_lambdafied .temperature ()
>>> test_lambdafied . temperature_remote (None , None)
>>> test_lambdafied . netproxy_handler ({"d": "{}", "name": "
temperaturecity ", "args": ["Winti"], "classname": "
CityTemperature "}, None)
Finally, it is time to deploy the code to AWS Lambda and execute it there.
You can run the command twice to verify that in the second case no redeploy-
ment happens (Listing 5). In parallel, you can verify the deployments in the
AWS Lambda Dashboard at https://<orgname>.signin.aws.amazon.com/console.
Listing 5: FaaSified temperature application
./ lambada temperature.py
./ lambada temperature.py # nothing happens , already deployed
2 Using Snafu
Snafu runs your functions in code files.
Start off with obtaining Snafu from its source repository.
Listing 6: Obtaining Snafu
git clone https :// github.com/ serviceprototypinglab /snafu
You can directly run Snafu without any configuration. It ships with a num-
ber of default functions in various languages. Notice how on first startup, the
interpreters for non-Python functions are compiled first. This means that while
the first startup is a bit slow, the second and subsequent ones are quote fast
(Listing 7).
Listing 7: Running Snafu
./ snafu
# type Ctrl+D
./ snafu # everything compiled
# type Ctrl+D again
2
Now run Snafu in C mode, meaning that the default interpreter is for func-
tions implemented in C. Select the sample C Fibonacci function and execute it
with a low parameter n (Listing 8).
Listing 8: Executing a C function
./ snafu -e c
# type function: fib_so.handler
# type argument: 10
# type Ctrl+D
Now remember your previous example functions used with Lambada. Obvi-
ously, Snafu can interpret this file as well. Execute Snafu on this file and explore
the execution (Listing 9).
Listing 9: Executing a Python function
./ snafu .../ path -to -lambada/temperature.py
For testing functions prior to deployment to AWS, it is convenient to use
Snafu’s control plane mode. In this mode, the default calling convention is the
same as in AWS Lambda (Listing 10).
Listing 10: Using the control plane
./snafu -control .../ path -to -lambada/temperature.py
# notice how no methods are selectable
# type Ctrl+D
# add to source: lambda_handler(event , context):return str(
temperature ())
# & run snafu -control command again
# open a second terminal , and run:
aws --endpoint -url http :// localhost :10000 lambda invoke --
function -name test. lambda_handler --payload ’{" event ":
""}’ /tmp/_out
cat /tmp/_out
3 Using Fission
Note: You will need to have Kubernetes installed with minikube + kubectl.
Ensure that the minikube context is used by kubectl. Furthermore, ensure that
your system user is in the group docker.
Listing 11: Fission script
# prepare
kubectl config use -context minikube
kubectl create -f http :// fission.io/fission.yaml
kubectl create -f http :// fission.io/fission -nodeport.yaml
export FISSION_URL=http ://$(minikube ip):31313
export FISSION_ROUTER=$(minikube ip):31314
3
# initiate
fission env create --name python --image fission/python -env
curl https :// raw. githubusercontent .com/fission/fission/
master/examples/python/hello.py > hello.py
# explore & deploy
cat hello.py
fission function create --name hello --env python --code
hello.py
# output: function ’hello ’ created
fission route create --method GET --url /hello --function
hello
# output: trigger ’35ad2fae -**** -**** -**** -679 d755fde8f ’
created
curl http :// $FISSION_ROUTER /hello
# user interface
kubectl create -f https :// raw. githubusercontent .com/fission/
fission -ui/master/docker/fission -ui.yaml
# output: deployment "fission -ui" created
# output: service "fission -ui" created
xdg -open http ://$(minikube ip):31319
4 Using OpenLambda (tentative)
Listing 12: OpenLambda script
git clone https :// github.com/open -lambda/open -lambda
cd open -lambda
sudo apt -get install libpython2 .7-dev
sudo make
bin/admin new -cluster pyparis
# returns lots of JSON
bin/admin workers -cluster pyparis
# output: Started worker: pid ...
bin/admin status -cluster pyparis
# output: Worker Pings: ...
cat quickstart/handlers/hello/lambda_func.py
# ... minimal Lambda -signature Python function
cp -r quickstart/handlers/hello pyparis/registry
curl -X POST localhost :8080/ runLambda/hello -d ’{" name ": "
Alice "}’
# -> permission denied !?
4
Ad

More Related Content

What's hot (19)

AMC Minor Technical Issues
AMC Minor Technical IssuesAMC Minor Technical Issues
AMC Minor Technical Issues
Apache Traffic Server
 
python_certificate
python_certificatepython_certificate
python_certificate
Tyler Heckstall
 
2020.02.15 DelEx - CI/CD in AWS Cloud
2020.02.15 DelEx - CI/CD in AWS Cloud2020.02.15 DelEx - CI/CD in AWS Cloud
2020.02.15 DelEx - CI/CD in AWS Cloud
Peter Salnikov
 
OctoLab Cookbook: how to use composer.yml and stop creating issues about
OctoLab Cookbook: how to use composer.yml and stop creating issues aboutOctoLab Cookbook: how to use composer.yml and stop creating issues about
OctoLab Cookbook: how to use composer.yml and stop creating issues about
Kamil Samigullin
 
Python to scala
Python to scalaPython to scala
Python to scala
kao kuo-tung
 
PyParis2018 - Python tooling for continuous deployment
PyParis2018 - Python tooling for continuous deploymentPyParis2018 - Python tooling for continuous deployment
PyParis2018 - Python tooling for continuous deployment
Arthur Lutz
 
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipelineKubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeAcademy
 
Launching Applications
Launching ApplicationsLaunching Applications
Launching Applications
primeteacher32
 
OSTU - Wireshark Capture Filters (by Ray Tompkins)
OSTU - Wireshark Capture Filters (by Ray Tompkins)OSTU - Wireshark Capture Filters (by Ray Tompkins)
OSTU - Wireshark Capture Filters (by Ray Tompkins)
Denny K Miu
 
K8s
K8sK8s
K8s
Sam Zheng
 
Using zone.js
Using zone.jsUsing zone.js
Using zone.js
Standa Opichal
 
Kernel Recipes 2014 - Quick state of the art of clang
Kernel Recipes 2014 - Quick state of the art of clangKernel Recipes 2014 - Quick state of the art of clang
Kernel Recipes 2014 - Quick state of the art of clang
Anne Nicolas
 
Toolfactory foam mar21_2013
Toolfactory foam mar21_2013Toolfactory foam mar21_2013
Toolfactory foam mar21_2013
Ross Lazarus
 
iptables and Kubernetes
iptables and Kubernetesiptables and Kubernetes
iptables and Kubernetes
HungWei Chiu
 
Reactive programming in PHP
Reactive programming in PHPReactive programming in PHP
Reactive programming in PHP
Johney Park
 
Fun421 stephens
Fun421 stephensFun421 stephens
Fun421 stephens
Tess Ferrandez
 
KubeCon EU 2016: Getting the Jobs Done With Kubernetes
KubeCon EU 2016: Getting the Jobs Done With KubernetesKubeCon EU 2016: Getting the Jobs Done With Kubernetes
KubeCon EU 2016: Getting the Jobs Done With Kubernetes
KubeAcademy
 
Kubernetes service with ha
Kubernetes service with haKubernetes service with ha
Kubernetes service with ha
Sam Zheng
 
Logging library migrations - A case study for the Apache Software Foundation ...
Logging library migrations - A case study for the Apache Software Foundation ...Logging library migrations - A case study for the Apache Software Foundation ...
Logging library migrations - A case study for the Apache Software Foundation ...
corpaulbezemer
 
2020.02.15 DelEx - CI/CD in AWS Cloud
2020.02.15 DelEx - CI/CD in AWS Cloud2020.02.15 DelEx - CI/CD in AWS Cloud
2020.02.15 DelEx - CI/CD in AWS Cloud
Peter Salnikov
 
OctoLab Cookbook: how to use composer.yml and stop creating issues about
OctoLab Cookbook: how to use composer.yml and stop creating issues aboutOctoLab Cookbook: how to use composer.yml and stop creating issues about
OctoLab Cookbook: how to use composer.yml and stop creating issues about
Kamil Samigullin
 
PyParis2018 - Python tooling for continuous deployment
PyParis2018 - Python tooling for continuous deploymentPyParis2018 - Python tooling for continuous deployment
PyParis2018 - Python tooling for continuous deployment
Arthur Lutz
 
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipelineKubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeAcademy
 
Launching Applications
Launching ApplicationsLaunching Applications
Launching Applications
primeteacher32
 
OSTU - Wireshark Capture Filters (by Ray Tompkins)
OSTU - Wireshark Capture Filters (by Ray Tompkins)OSTU - Wireshark Capture Filters (by Ray Tompkins)
OSTU - Wireshark Capture Filters (by Ray Tompkins)
Denny K Miu
 
Kernel Recipes 2014 - Quick state of the art of clang
Kernel Recipes 2014 - Quick state of the art of clangKernel Recipes 2014 - Quick state of the art of clang
Kernel Recipes 2014 - Quick state of the art of clang
Anne Nicolas
 
Toolfactory foam mar21_2013
Toolfactory foam mar21_2013Toolfactory foam mar21_2013
Toolfactory foam mar21_2013
Ross Lazarus
 
iptables and Kubernetes
iptables and Kubernetesiptables and Kubernetes
iptables and Kubernetes
HungWei Chiu
 
Reactive programming in PHP
Reactive programming in PHPReactive programming in PHP
Reactive programming in PHP
Johney Park
 
KubeCon EU 2016: Getting the Jobs Done With Kubernetes
KubeCon EU 2016: Getting the Jobs Done With KubernetesKubeCon EU 2016: Getting the Jobs Done With Kubernetes
KubeCon EU 2016: Getting the Jobs Done With Kubernetes
KubeAcademy
 
Kubernetes service with ha
Kubernetes service with haKubernetes service with ha
Kubernetes service with ha
Sam Zheng
 
Logging library migrations - A case study for the Apache Software Foundation ...
Logging library migrations - A case study for the Apache Software Foundation ...Logging library migrations - A case study for the Apache Software Foundation ...
Logging library migrations - A case study for the Apache Software Foundation ...
corpaulbezemer
 

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

Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
William Stewart
 
Steps to install ns3
Steps to install ns3Steps to install ns3
Steps to install ns3
DIGITAL PADM
 
HPC_MPI_CICID_OA.pptx
HPC_MPI_CICID_OA.pptxHPC_MPI_CICID_OA.pptx
HPC_MPI_CICID_OA.pptx
ObjectAutomation2
 
Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple
Wojciech Barczyński
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetes
Liran Cohen
 
Tensorflow in production with AWS Lambda
Tensorflow in production with AWS LambdaTensorflow in production with AWS Lambda
Tensorflow in production with AWS Lambda
Fabian Dubois
 
[k8s] Kubernetes terminology (1).pdf
[k8s] Kubernetes terminology (1).pdf[k8s] Kubernetes terminology (1).pdf
[k8s] Kubernetes terminology (1).pdf
Frederik Wouters
 
Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023
Henry Schreiner
 
Parallel Processing with IPython
Parallel Processing with IPythonParallel Processing with IPython
Parallel Processing with IPython
Enthought, Inc.
 
Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475
Max Kleiner
 
How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2
Fernando Lopez Aguilar
 
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE LabHow to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
FIWARE
 
Open erp on ubuntu
Open erp on ubuntuOpen erp on ubuntu
Open erp on ubuntu
Iker Coranti
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
Paul Czarkowski
 
Installing OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.xInstalling OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.x
Nader Karimi
 
Zero downtime deployment of micro-services with Kubernetes
Zero downtime deployment of micro-services with KubernetesZero downtime deployment of micro-services with Kubernetes
Zero downtime deployment of micro-services with Kubernetes
Wojciech Barczyński
 
How to speed up your (API client) modules
How to speed up your (API client) modulesHow to speed up your (API client) modules
How to speed up your (API client) modules
Gonéri Le Bouder
 
Open Dayligth usando SDN-NFV
Open Dayligth usando SDN-NFVOpen Dayligth usando SDN-NFV
Open Dayligth usando SDN-NFV
Open Networking Perú (Opennetsoft)
 
kubernetes for beginners
kubernetes for beginnerskubernetes for beginners
kubernetes for beginners
Dominique Dumont
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
adrian_nye
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
William Stewart
 
Steps to install ns3
Steps to install ns3Steps to install ns3
Steps to install ns3
DIGITAL PADM
 
Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple
Wojciech Barczyński
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetes
Liran Cohen
 
Tensorflow in production with AWS Lambda
Tensorflow in production with AWS LambdaTensorflow in production with AWS Lambda
Tensorflow in production with AWS Lambda
Fabian Dubois
 
[k8s] Kubernetes terminology (1).pdf
[k8s] Kubernetes terminology (1).pdf[k8s] Kubernetes terminology (1).pdf
[k8s] Kubernetes terminology (1).pdf
Frederik Wouters
 
Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023
Henry Schreiner
 
Parallel Processing with IPython
Parallel Processing with IPythonParallel Processing with IPython
Parallel Processing with IPython
Enthought, Inc.
 
Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475
Max Kleiner
 
How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2
Fernando Lopez Aguilar
 
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE LabHow to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
How to Deploy Spark Instance Using Ansible 2.0 in FIWARE Lab
FIWARE
 
Open erp on ubuntu
Open erp on ubuntuOpen erp on ubuntu
Open erp on ubuntu
Iker Coranti
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
Paul Czarkowski
 
Installing OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.xInstalling OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.x
Nader Karimi
 
Zero downtime deployment of micro-services with Kubernetes
Zero downtime deployment of micro-services with KubernetesZero downtime deployment of micro-services with Kubernetes
Zero downtime deployment of micro-services with Kubernetes
Wojciech Barczyński
 
How to speed up your (API client) modules
How to speed up your (API client) modulesHow to speed up your (API client) modules
How to speed up your (API client) modules
Gonéri Le Bouder
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
adrian_nye
 
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...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 ...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 ...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, ...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 ...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...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...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 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
Pôle Systematic Paris-Region
 
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é ?
Pôle Systematic Paris-Region
 
Osis18_Cloud : Projet Wolphin
Osis18_Cloud : Projet Wolphin 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 NUMAOsis18_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 BittorrentOsis18_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-heritageOsis18_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...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 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
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...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...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...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)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 parmentelatPyParis 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...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 ...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 ...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, ...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 ...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...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...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 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
Pôle Systematic Paris-Region
 
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
Pôle Systematic Paris-Region
 
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
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...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 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
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...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...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...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)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 parmentelatPyParis 2017 / Un mooc python, by thierry parmentelat
PyParis 2017 / Un mooc python, by thierry parmentelat
Pôle Systematic Paris-Region
 
Ad

Recently uploaded (20)

ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 

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

  • 1. Function-as-a-Service: A Pythonic Perspective on Serverless Computing – Tutorial @ PyParis 2017 Josef Spillner Zurich University of Applied Sciences, School of Engineering Service Prototyping Lab (blog.zhaw.ch/icclab/) 8401 Winterthur, Switzerland [email protected] June 9, 2017 Learning Objective Learn on a practical level about different FaaS programming conventions, runtimes, service providers and tools. Use some of the tools by yourself to FaaSify simple Python applications. 1 Using Lambada Snafu extracts your functions from code files. Obtain Lambada directly from its source repository. You will furthermore need Python 3.5 or more recent installed. Listing 1: Obtaining Lambada git clone https :// gitlab.com/josefspillner/lambada.git Start by creating a file temperature.py. It contains one function and one class which together form your «temperature application» (Listing 2). Listing 2: Temperature application def temperature (): return 42.23 class CityTemperature : def temperaturecity (self , city): self.city = city return 99 Now use Lambada to transform the contents into FaaS units which can still be executed locally but are ready to be deployed in AWS Lambda (Listing 3). 1 transcript type: tutorial distribution: public status: final initiative: Service Tool- ing
  • 2. Listing 3: FaaSification process ./ lambada --local temperature.py Then verify the generated Python file and notice its structure. Use any editor of your choice on the newly generated file temperature_lambdafied.py. Afterwards, check the functionality in the Python console. Run the following (Listing 4). Listing 4: FaaSified temperature application python3 >>> import test_lambdafied >>> dir( test_lambdafied ) >>> test_lambdafied .temperature () >>> test_lambdafied . temperature_remote (None , None) >>> test_lambdafied . netproxy_handler ({"d": "{}", "name": " temperaturecity ", "args": ["Winti"], "classname": " CityTemperature "}, None) Finally, it is time to deploy the code to AWS Lambda and execute it there. You can run the command twice to verify that in the second case no redeploy- ment happens (Listing 5). In parallel, you can verify the deployments in the AWS Lambda Dashboard at https://<orgname>.signin.aws.amazon.com/console. Listing 5: FaaSified temperature application ./ lambada temperature.py ./ lambada temperature.py # nothing happens , already deployed 2 Using Snafu Snafu runs your functions in code files. Start off with obtaining Snafu from its source repository. Listing 6: Obtaining Snafu git clone https :// github.com/ serviceprototypinglab /snafu You can directly run Snafu without any configuration. It ships with a num- ber of default functions in various languages. Notice how on first startup, the interpreters for non-Python functions are compiled first. This means that while the first startup is a bit slow, the second and subsequent ones are quote fast (Listing 7). Listing 7: Running Snafu ./ snafu # type Ctrl+D ./ snafu # everything compiled # type Ctrl+D again 2
  • 3. Now run Snafu in C mode, meaning that the default interpreter is for func- tions implemented in C. Select the sample C Fibonacci function and execute it with a low parameter n (Listing 8). Listing 8: Executing a C function ./ snafu -e c # type function: fib_so.handler # type argument: 10 # type Ctrl+D Now remember your previous example functions used with Lambada. Obvi- ously, Snafu can interpret this file as well. Execute Snafu on this file and explore the execution (Listing 9). Listing 9: Executing a Python function ./ snafu .../ path -to -lambada/temperature.py For testing functions prior to deployment to AWS, it is convenient to use Snafu’s control plane mode. In this mode, the default calling convention is the same as in AWS Lambda (Listing 10). Listing 10: Using the control plane ./snafu -control .../ path -to -lambada/temperature.py # notice how no methods are selectable # type Ctrl+D # add to source: lambda_handler(event , context):return str( temperature ()) # & run snafu -control command again # open a second terminal , and run: aws --endpoint -url http :// localhost :10000 lambda invoke -- function -name test. lambda_handler --payload ’{" event ": ""}’ /tmp/_out cat /tmp/_out 3 Using Fission Note: You will need to have Kubernetes installed with minikube + kubectl. Ensure that the minikube context is used by kubectl. Furthermore, ensure that your system user is in the group docker. Listing 11: Fission script # prepare kubectl config use -context minikube kubectl create -f http :// fission.io/fission.yaml kubectl create -f http :// fission.io/fission -nodeport.yaml export FISSION_URL=http ://$(minikube ip):31313 export FISSION_ROUTER=$(minikube ip):31314 3
  • 4. # initiate fission env create --name python --image fission/python -env curl https :// raw. githubusercontent .com/fission/fission/ master/examples/python/hello.py > hello.py # explore & deploy cat hello.py fission function create --name hello --env python --code hello.py # output: function ’hello ’ created fission route create --method GET --url /hello --function hello # output: trigger ’35ad2fae -**** -**** -**** -679 d755fde8f ’ created curl http :// $FISSION_ROUTER /hello # user interface kubectl create -f https :// raw. githubusercontent .com/fission/ fission -ui/master/docker/fission -ui.yaml # output: deployment "fission -ui" created # output: service "fission -ui" created xdg -open http ://$(minikube ip):31319 4 Using OpenLambda (tentative) Listing 12: OpenLambda script git clone https :// github.com/open -lambda/open -lambda cd open -lambda sudo apt -get install libpython2 .7-dev sudo make bin/admin new -cluster pyparis # returns lots of JSON bin/admin workers -cluster pyparis # output: Started worker: pid ... bin/admin status -cluster pyparis # output: Worker Pings: ... cat quickstart/handlers/hello/lambda_func.py # ... minimal Lambda -signature Python function cp -r quickstart/handlers/hello pyparis/registry curl -X POST localhost :8080/ runLambda/hello -d ’{" name ": " Alice "}’ # -> permission denied !? 4