19deploying Python Code
19deploying Python Code
2
Aspect of code deployment
What are the main challenges in deploying the code to
remote environments?
How to build applications in Python that are easily
deployable
How to reload web services without downtime
How to leverage a Python packaging ecosystem in code
deployment
How to properly monitor and instrument code that runs
remotely
3
The twelve-factor app
Website: https://12factor.net/
Software is commonly delivered as a service: called web
apps, or software-as-a-service.
The twelve-factor app is a methodology for building
software-as-a-service, see introduction: https://12factor.net/
The twelve-factor methodology can be applied to apps
written in any programming language, and which use any
combination of backing services (database, queue, memory
cache, etc).
4
The twelve-factor app https://12factor.net/
5
The twelve-factor app https://12factor.net/
6
Deployment automation
Application containerization (Docker and similar
technologies)
Modern software provisioning tools (for example, Puppet,
Chef, Ansible, and Salt)
Infrastructure management systems (for example, Terraform
and SaltStack)
Container orchestrations systems in the style of Kubernetes
that allow you to leverage Docker containers for fast,
maintainable, scalable, and reproducible environments
Fabric is simple and easy to grasp, so it is a great tool to
introduce someone to the concept of automation
7
Things to Remember
Programs often need to run in multiple deployment
environments that each have unique assumptions and
configurations.
You can tailor a module’s contents to different deployment
environments by using normal Python statements in module
scope.
Module contents can be the product of any external
condition, including host introspection through the sys and
os modules.