SlideShare une entreprise Scribd logo
1  sur  62
Télécharger pour lire hors ligne
Writing and deploying serverless
Python applications
César Cárdenas Desales
PyCon Ireland, October 2017
About me
Software Architect at Webrepublic AG
Python User since v.2.0
Co-organizer of the Swiss Python Summit (next on Feb. 2018)
Coorganizer of the Zurich Python User Group
@ccdesales
Intro What is it?
Architecture Archeology - Client server
A fat do-it-all Server
Mostly on-premises server
Upfront investment
Capacity planning
Scaling was a nightmare
Cloud based architectures
+ Servers can be disposable, unless
they’re snowflakes
+ Application architecture can make
scaling easier or more difficult
- Capacity planning still required
- Still pay ($$) if your server is idle
Capacity planning
How many servers?
How powerful?
How much memory?
What do we do with excess resources?
What if we have too little resources?
How do we (dynamically) grow or shrink resources?
Resources become obsolete
What if we suffer the Slashdot effect?
Serverless: a very simple yet powerful idea
● You submit units of work for execution
● Pay only for computing time you consume
Serverless: Well, there’s actually a server...
What does Serverless mean for you?
● Less Work
○ No need to run servers in premises
○ No need to manage servers in the cloud (admin, patches)
○ No need to plan capacity or scaling
● Potential money savings
○ Only pay for computing time you use
Why does it make me excited
● I’m an aging developer
Why does serverless make me excited?
● I’m an aging developer
● Potentially unlimited scaling
● Computing resources are
disposable
● Low level maintenance is
abstracted out…
● (it’s somebody else’s problem)
● IT assets are programmable
Serverless with AWS Lambda
AWS Lambda
● Amazon Web Services’ serverless platform
Supported technologies
Choose
template
Choose
trigger
Add config
& code
Test
Write
client
The process
Choose
template
Choose
trigger
Add config
& code
Test
Write
client
Choose template
Choose template
Choose
template
Choose
trigger
Add config
& code
Test
Write
client
Choose trigger
Choose
template
Choose
trigger
Add config
& code
Test
Write
client
Add config & code
● Upload .ZIP file
● Upload file from
Amazon S3
Add config & code
● VPC
● Env variables
● Security roles
Max. 300 secs
Choose
template
Choose
trigger
Add config
& code
Test
Write
client
Test
Test
Choose
template
Choose
trigger
Add config
& code
Test
Write
client
Client
Output - synchronous call
Output - Asynchronous call
Precondition to run the exercises
tree ~/.aws cat ~/.aws/config
[default]
region = eu-west-1
cat ~/.aws/credentials
[default]
aws_access_key_id = SOME_ID
aws_secret_access_key = AKEY
Serverless the
easy way:
Zappa
What is zappa?
● A python framework for serverless applications
● Used as command line tool
● Manages application lifecycle
○ Creation
○ Deploy
○ Update
○ Undeploy Configure Deploy Test
pip install zappa
● Installs latest zappa
Configure Deploy Test
zappa init
● Optional
● Initializes project
● Creates zappa_settings.json file
● YAML format also available
Configure Deploy Test
Zappa code looks like Flask
● example.py
● zappa_settings.json
Configure Deploy Test
zappa deploy dev
Calling deploy for stage dev..
Downloading and installing dependencies..
Packaging project as zip.
Uploading servless-dev-1506419080.zip (5.9MiB)..
100%|███████████████| 6.16M/6.16M [00:01<00:00, 2.16MB/s]
Scheduling..
Scheduled servless-dev-zappa-keep-warm-handler.keep_warm_callback
with expression rate(4 minutes)!
TestConfigure Deploy Test
zappa deploy dev
Uploading servless-dev-template-1506419092.json (1.6KiB)..
100%|███████████████| 1.61K/1.61K [00:00<00:00, 3.71KB/s]
Waiting for stack servless-dev to create (this can take a bit)..
75%|███████████▎ | 3/4 [00:09<00:04, 4.94s/res]
Deploying API Gateway..
Deployment complete!:
https://x0doi1ioid.execute-api.eu-west-1.amazonaws.com/dev
TestConfigure Deploy Test
zappa deploy dev
Uploading servless-dev-template-1506419092.json (1.6KiB)..
100%|███████████████| 1.61K/1.61K [00:00<00:00, 3.71KB/s]
Waiting for stack servless-dev to create (this can take a bit)..
75%|███████████▎ | 3/4 [00:09<00:04, 4.94s/res]
Deploying API Gateway..
Deployment complete!:
https://x0doi1ioid.execute-api.eu-west-1.amazonaws.com/dev
TestConfigure Deploy Test
TestConfigure Deploy Test
Restful API
Boto3
curl https://x0doi1ioid.execute-api.eu-west-1.amazonaws.com/dev
hello from Flask
TestConfigure Deploy Test
Other commands
zappa tail
● Show latest logs
zappa update dev
● Update code and
settings
zappa undeploy dev
● Remove lambda
function
● Remove AWS API
Gateway
Zappa creates and deploys the Lambda
Zappa goodies
● Creates deployment package (modules from current virtualenv)
● Performs deployments (no manual *.zip uploads)
● Support for stages (dev, stage, prod)
● Manages settings:
○ Environment variables
○ Logging (AWS CloudWatch)
○ Domain names
○ VPC
○ Security roles
○ Certificates and keys
● API creation
Zappa creates a (AWS API Gateway) RESTful API
Why API Gateway?
● Interoperability
○ It’s only JSON over HTTP
○ Other platforms
○ Other AWS technologies
○ Other languages
○ Clients not tied to boto
● RESTful API
● Request Throttling/Limits
● Authorization tokens
Pitfalls & tips
Pitfalls
● 300 seconds execution time limit
● Calls must be stateless
● Cold start for 1st request -> Keep warm calls
○ An computing instance must be started
○ Can also happen during low traffic periods
● Logging only to CloudWatch
Pitfalls
● Fragmentation in a myriad of microservices
● No (DB) connection pooling
● Data potentially leaves your country
● Flame wars
○ 1 (Git) repository per service
○ All services in 1 (Git) repository
● Potential vendor lock-in
● Flow control and error handling gets tricky
AWS Steps Functions - Orchestration
Diagram Amazon States Language
The upsell - AWS Steps Functions
Geography matters
● Regions
● Availability
zones
● Edge locations
Content Delivery Networks
● AWS CloudFront: Amazon’s CDN
● Content served by edge location
closest to client
○ Images
○ Pages
○ Streams
Edge Locations
● AWS CloudFront: Amazon’s CDN
● Content served by edge location
closest to client
○ Images
○ Pages
○ Streams
Lambda Functions deployed into Regions
● Or, into a EC2 instance < AZ < Region
● High latency on requests from distant
areas
AWS Lambda@Edge
● Lambdas deployed to edge
locations
● Requests to Lambdas served by
closest (edge) location
AWS Lambda pricing
Free tier
First dosis is free
AWS Lambda pricing
Requests
First 1 million requests
per month are free
$0.20 per 1 million
requests thereafter
($0.0000002 per request)
Duration
Billing rounded up to the
nearest 100ms
Depending on the
amount of allocated
memory
Other
Data transfer (external)
Data storage
AWS API Gateway, $3.50
per million API calls
received
Alternatives
Vendor
Google Cloud Functions
(Beta, only JS, no env
vars)
Microsoft Azure
Functions
Python libs
Chalice
Apex
Vendor agnostic
The Serverless
framework
https://goo.gl/yYh2M4
Shameless plug
● Swiss Python Summit 2018
● February 16th, 2018
● Close to Zurich
● CFP still open
● www.python-summit.ch
Thank
@ccdesales
https://github.com/ccdesales/serverless_examples
you!

Contenu connexe

Tendances

Tracing Microservices with Zipkin
Tracing Microservices with ZipkinTracing Microservices with Zipkin
Tracing Microservices with Zipkin
takezoe
 

Tendances (20)

Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
Deliver Docker Containers Continuously On AWS - DevOpsCon Munich 2016
 
Local Lambda Debugging
Local Lambda DebuggingLocal Lambda Debugging
Local Lambda Debugging
 
Nashorn: JavaScript that doesn't suck - Tomer Gabel, Wix
Nashorn: JavaScript that doesn't suck - Tomer Gabel, WixNashorn: JavaScript that doesn't suck - Tomer Gabel, Wix
Nashorn: JavaScript that doesn't suck - Tomer Gabel, Wix
 
From Three Nines to Five Nines - A Kafka Journey
From Three Nines to Five Nines - A Kafka JourneyFrom Three Nines to Five Nines - A Kafka Journey
From Three Nines to Five Nines - A Kafka Journey
 
Andrew Nelson - Zabbix and SNMP on Linux
Andrew Nelson - Zabbix and SNMP on LinuxAndrew Nelson - Zabbix and SNMP on Linux
Andrew Nelson - Zabbix and SNMP on Linux
 
Honest Performance Testing with "NDBench" (Vinay Chella, Netflix) | Cassandra...
Honest Performance Testing with "NDBench" (Vinay Chella, Netflix) | Cassandra...Honest Performance Testing with "NDBench" (Vinay Chella, Netflix) | Cassandra...
Honest Performance Testing with "NDBench" (Vinay Chella, Netflix) | Cassandra...
 
Distributed Systems explained (with NodeJS) - Bruno Bossola, JUG Torino
Distributed Systems explained (with NodeJS) - Bruno Bossola, JUG TorinoDistributed Systems explained (with NodeJS) - Bruno Bossola, JUG Torino
Distributed Systems explained (with NodeJS) - Bruno Bossola, JUG Torino
 
Clouds presentation, aws meetup v2
Clouds presentation, aws meetup   v2Clouds presentation, aws meetup   v2
Clouds presentation, aws meetup v2
 
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthUSENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
 
Netflix Keystone - How Netflix Handles Data Streams up to 11M Events/Sec
Netflix Keystone - How Netflix Handles Data Streams up to 11M Events/SecNetflix Keystone - How Netflix Handles Data Streams up to 11M Events/Sec
Netflix Keystone - How Netflix Handles Data Streams up to 11M Events/Sec
 
Uber Real Time Data Analytics
Uber Real Time Data AnalyticsUber Real Time Data Analytics
Uber Real Time Data Analytics
 
Tracing Microservices with Zipkin
Tracing Microservices with ZipkinTracing Microservices with Zipkin
Tracing Microservices with Zipkin
 
High Performance Systems in Go - GopherCon 2014
High Performance Systems in Go - GopherCon 2014High Performance Systems in Go - GopherCon 2014
High Performance Systems in Go - GopherCon 2014
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
Hadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and Beyond
Hadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and BeyondHadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and Beyond
Hadoop Meetup Jan 2019 - TonY: TensorFlow on YARN and Beyond
 
Azure Functions - Get rid of your servers, use functions!
Azure Functions - Get rid of your servers, use functions!Azure Functions - Get rid of your servers, use functions!
Azure Functions - Get rid of your servers, use functions!
 
Riga dev day: Lambda architecture at AWS
Riga dev day: Lambda architecture at AWSRiga dev day: Lambda architecture at AWS
Riga dev day: Lambda architecture at AWS
 
Unbounded bounded-data-strangeloop-2016-monal-daxini
Unbounded bounded-data-strangeloop-2016-monal-daxiniUnbounded bounded-data-strangeloop-2016-monal-daxini
Unbounded bounded-data-strangeloop-2016-monal-daxini
 
Building a distributed Key-Value store with Cassandra
Building a distributed Key-Value store with CassandraBuilding a distributed Key-Value store with Cassandra
Building a distributed Key-Value store with Cassandra
 
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
 

Similaire à PyConIE 2017 Writing and deploying serverless python applications

AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...
Luciano Mammino
 
Introduction to amazon web services for developers
Introduction to amazon web services for developersIntroduction to amazon web services for developers
Introduction to amazon web services for developers
Ciklum Ukraine
 
AWS Summit Benelux 2013 - Enterprise Applications on AWS
AWS Summit Benelux 2013 - Enterprise Applications on AWSAWS Summit Benelux 2013 - Enterprise Applications on AWS
AWS Summit Benelux 2013 - Enterprise Applications on AWS
Amazon Web Services
 

Similaire à PyConIE 2017 Writing and deploying serverless python applications (20)

Low Cost AWS Services For Application Development in the Cloud
Low Cost AWS Services For Application Development in the CloudLow Cost AWS Services For Application Development in the Cloud
Low Cost AWS Services For Application Development in the Cloud
 
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
Skillenza Build with Serverless Challenge -  Advanced Serverless ConceptsSkillenza Build with Serverless Challenge -  Advanced Serverless Concepts
Skillenza Build with Serverless Challenge - Advanced Serverless Concepts
 
State of serverless
State of serverlessState of serverless
State of serverless
 
AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda and Serverless framework: lessons learned while building a serverl...
 
Automating using Ansible
Automating using AnsibleAutomating using Ansible
Automating using Ansible
 
Serverless
ServerlessServerless
Serverless
 
App Deployment on Cloud
App Deployment on CloudApp Deployment on Cloud
App Deployment on Cloud
 
NetflixOSS Meetup S6E1 - Titus & Containers
NetflixOSS Meetup S6E1 - Titus & ContainersNetflixOSS Meetup S6E1 - Titus & Containers
NetflixOSS Meetup S6E1 - Titus & Containers
 
Serverless Computing with AWS
Serverless Computing with AWSServerless Computing with AWS
Serverless Computing with AWS
 
Second Skin: Real-Time Retheming a Legacy Web Application with Diazo in the C...
Second Skin: Real-Time Retheming a Legacy Web Application with Diazo in the C...Second Skin: Real-Time Retheming a Legacy Web Application with Diazo in the C...
Second Skin: Real-Time Retheming a Legacy Web Application with Diazo in the C...
 
Write less (code) and build more with serverless
Write less (code) and build more with serverlessWrite less (code) and build more with serverless
Write less (code) and build more with serverless
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2
 
Introduction to amazon web services for developers
Introduction to amazon web services for developersIntroduction to amazon web services for developers
Introduction to amazon web services for developers
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShift
 
AWS Summit Benelux 2013 - Enterprise Applications on AWS
AWS Summit Benelux 2013 - Enterprise Applications on AWSAWS Summit Benelux 2013 - Enterprise Applications on AWS
AWS Summit Benelux 2013 - Enterprise Applications on AWS
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps WayDevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
 
Crio.do - Deployment on AWS Masterclass
Crio.do - Deployment on AWS MasterclassCrio.do - Deployment on AWS Masterclass
Crio.do - Deployment on AWS Masterclass
 
Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015
 
Windows Azure Platform + PHP - Jonathan Wong
Windows Azure Platform + PHP - Jonathan WongWindows Azure Platform + PHP - Jonathan Wong
Windows Azure Platform + PHP - Jonathan Wong
 

Plus de Cesar Cardenas Desales (7)

Migrate to Python 3 using the six library
Migrate to Python 3 using the six libraryMigrate to Python 3 using the six library
Migrate to Python 3 using the six library
 
Scalable Web applications with Elastic Beanstalk as your PAAS: a primer
Scalable Web applications with Elastic Beanstalk as your PAAS: a primerScalable Web applications with Elastic Beanstalk as your PAAS: a primer
Scalable Web applications with Elastic Beanstalk as your PAAS: a primer
 
Software maintenance PyConPL 2016
Software maintenance PyConPL 2016Software maintenance PyConPL 2016
Software maintenance PyConPL 2016
 
Unit Testing with Nose
Unit Testing with NoseUnit Testing with Nose
Unit Testing with Nose
 
Distributed Task Processing with Celery - PyZH
Distributed Task Processing with Celery - PyZHDistributed Task Processing with Celery - PyZH
Distributed Task Processing with Celery - PyZH
 
Software maintenance PyConUK 2016
Software maintenance PyConUK 2016Software maintenance PyConUK 2016
Software maintenance PyConUK 2016
 
Code Reviews in Python - PyZh
Code Reviews in Python - PyZhCode Reviews in Python - PyZh
Code Reviews in Python - PyZh
 

Dernier

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Dernier (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 

PyConIE 2017 Writing and deploying serverless python applications