over time allowing you to recall specific versions later. • You should keep a version of every change you make in your code. • This allows you to revert your web app to a previous mistake you made earlier if you make a mistake. • See how people are making changes to the project over time. • Generally makes collaboration easier when working as a team. • No modern web deployment can happen without version control. • Most popular version control tool is git. Some people also use mercurial.
web dev. Code is considered good if it has good tests written as well. • Testing helps ensure you don’t break existing code when you introduce features. • If you test that new feature properly you won’t likely break existing functionality which makes deployment easier. • Tests help improve documentation of your code since you are testing existing functionality. • Tests speed up web deployment because you have confidence your new changes do not break existing functionality. • A test unit should focus on one proving one bit of functionality. • Each test unit should be fully independent. Each test unit should be able to run independently regardless if when it’s called.
correctness of an individual functionality in a large codebase. • A unit test should work as expected in isolation from other tests • Almost all languages have unit testing framework. • Integration testing tests the system as whole.
repository continuously. • CI automates the building, testing and deployment of the code. • Automatically run unit tests as code is checked in to detect problems early • CI dramatically reduces deployment time • Helps prevent deploying broken code into production.
tool written in Java. Has plenty of plugins • Go - CD tool built by thoughtworks • Strider - Open Source CI tool written in Nodejs • BuildBot - Open Source Python CI • TeamCity - Another free self-hosted CD platform by JetBrains
build • Always run tests locally before committing. • Wait for the build process to finish before moving on. • Always be ready to revert to previous version of your code if a build fails. • Take responsibility if you break something.
middleware and services. • Allows us to automate setup of web servers. • Automate modification of servers from an existing state to a desired state • Automate deployment of our web applications • Our infrastructure lives as part of our code • Will save your organisation time and money
infrastructure automation. • Written in Python. You can extend it using Python • You have a Salt-Master which hosts all the configurations policies • Salt-Minions are the nodes in your infrastructure that you want managed. • Salt uses ZeroMQ to push configs between Master and minions • https://docs.saltstack.com
community • Can be used with other languages as well • Organises operative directions in files known as recipes • Not just userful with deployment, you can use it to build servers, install applications, maintenance and monitoring • Great documentation at http://capistranorb.com/#
to programmatically control your infrastructure environment in a predictable manner • Also uses ruby and stores config details in files called recipes. • Chef Server: Central location for your configuration recipes, cookbooks, and node and workstation definitions. Other machines in your infrastructure use the chef server for deployment configuration. • Chef Nodes: Chef nodes are the deployment targets that are configured by Chef.
There is an enterprise versions as well • Describes machine configuration in a declarative language. • Config code is stored in files called resource declarations • Declarations are organised into manifests. • A collection of manifests and data are known as modules.
• Provide a host of operations for executing local and remote SSH commands. • You write your tasks as python functions. Store them in a fabfile.py file and fabric will execute them on demand. • It’s just a python library on top of ssh that allows you to store repetitive ssh tasks in python files. • Different from others in that it uses the push methodology while chef,ansible loads your configs and executes on the
way to automate apps and IT infrastructure • Uses YAML syntax. • Configuration details are organised in roles with each roles containing it’s own files, tasks, handlers, vars, templates. • Playbooks contain roles and target hosts. • Plenty of free tested roles available on https://galaxy. ansible.com • Recently acquired by Redhat
• A container contains isolated process running independently in the LInux OS. • You can have many isolated containers running on the same Linux kernel each behaving like a standalone Linux OS. • You can prioritize CPU, IO, Memory, Network to individual containers.
to easily run your apps inside Linux Containers • Dockerized apps are completely portable and can run anywhere; Linux, OSX, Windows. • Packaging your web app in Docker means it will always work the same in any environment.
all it’s software dependencies and the processes to run. • Docker Container - Instance of an image. We use a Docker image to create a Docker container. • Dockerfile - A file containing declarations on automating the image building process • Docker Compose - Organises your containers into logical units enabling them to communicate with each other. • Docker Hub - Docker container hosting
RUN apt-get update RUN apt-get install -y python-software-properties # + all other dependencies RUN pip install --upgrade pip RUN pip install --upgrade virtualenv RUN mkdir pombola_root && cd pombola_root RUN git clone https://github.com/mysociety/pombola.git
uses the standard Docker API Turns a groups of Docker containers into a single virtual Docker engine You have a Swarm Manager which acts as the Master with each host running the Swarm Agent. Can scale up to 1000 nodes running 50000
Google leveraging their internal experience using containers in production for the last decade. Containers are organised into logical units called pods. Kubernetes schedules your pods and grows them in your cluster
management service for running Docker containers on Amazon EC2 Lets you launch, stop, schedule, docker containers with simple API calls. Containers are grouped into clusters deployed on a fleet of EC2 instances.
run your Docker containers on Google Cloud • Powered by Kubernetes • Priced based on Compute Engine prices • Container engines schedules your containers onto clusters based on predefined rules that you set yourself. • You define containers requirements e.g CPU, Memory in a simple json config file
deploy docker containers on arbitrary hosts on a cluster. Built on top of Systemd Whereas Systemd is a system and service for a single linux host, fleet extends this to a cluster of machines. Allows you to treat your cluster of machines as a single host.
Designed to scale to very large clusters running on thousands of hosts with high availability and resilience. Used by large companies with like Twitter, eBay, Airbnb.
infrastructure. Monitoring helps ensure there is uptime, load times, fast response time... Monitoring ensures your app delivers functionality as expected. Good monitoring tools will alert you when there is a problem somewhere in your app or infrastructure. Monitoring will help you improve your apps performance.
for webapps. Started in the Django community. Now a paid service. • LogStash - Collect and analyze logs from various sources. • Kibana - Collect, analyze, visualize, search your logs. • Datadog - Collect and visualize various performance metrics from your apps.
build in one step? Do you make daily builds? Do you use configuration management tools to automate infrastructure? Is the development setup documented and automated? Can you rollout and rollback deployments in one step? Can applications be deployed to a new server setup without changes to the code? Can you tell the health status of your server(s) at glance.
logging, metrics • Monitor GCP and AWS platforms. • Provides a wide variety of metrics; alerts, log monitoring, dashboards, health reporting, tracing capabilities. • Easily find and fix issues in your cloud infrastructure • Integrates easily with all Cloud services