Skip to content

Latest commit

 

History

History
107 lines (89 loc) · 4.27 KB

File metadata and controls

107 lines (89 loc) · 4.27 KB
title:Concepts
description:Concepts of the Deis application platform, which deploys and scales twelve factor apps. Learn about formations, layers, build, release, run & backing services.
keywords:deis, formations, layers, build, release, run, backing services

Concepts

Deis is an application platform that deploys and scales Twelve Factor apps using a formation of Chef nodes, Docker containers and Nginx proxies.

Formations

A :ref:`formation` is a set of infrastructure used to host applications. Each formation includes :ref:`Layers <layer>` of :ref:`Nodes <node>` that provide different services to the formation.

Layers

:ref:`Layers <layer>` are homogeneous groups of :ref:`Nodes <node>` that perform work on behalf of a formation. Each node in a layer has the same :ref:`Flavor` and configuration, allowing them to be scaled easily. Formations have two primary types of layers.

Runtime Layers

Runtime layers service requests and run background tasks for the formation. Nodes in a runtime layer use a Chef Databag to deploy :ref:`Containers <container>` running a specific :ref:`Release`.

Proxy Layers

Proxy layers expose the formation to the outside world. Nodes in a proxy layer use a Chef Databag to configure routing of inbound requests to :ref:`Containers <container>` hosted on runtime layers.

Applications

An :ref:`application` lives on a :ref:`formation` where it services requests and runs background jobs for a deployed git repository. Each application includes :ref:`Containers <container>` used to run isolated processes, and a :ref:`Release` that defines the current :ref:`Build` and :ref:`config` deployed by containers.

Developers can use :ref:`Applications <application>` to push builds, change config and scale containers without worrying about the formation's underlying infrastructure.

Build, Release, Run

Deis enforces strict separation between Build, Release and Run stages following the Twelve Factor model.

Build Stage

The :ref:`Controller` includes a Gitosis Server that receives incoming git push requests over SSH and builds applications inside ephemeral Docker containers. Tarballs of the /app directory are extracted into a slug and exposed on the Controller using an Nginx static file server. The slug is later downloaded by the runtime layer and bind-mounted into a Docker container for execution.

Release Stage

During the release stage, a :ref:`build` is combined with :ref:`config` to create a new numbered :ref:`release`. The release stage is triggered any time a new build is created or config is changed, making it easy to rollback code and configuration.

Run Stage

The run stage updates Chef databags and converges all nodes in the formation. The databag specifies the current release, the placement of containers across the runtime layer, and the configuration of the proxy layer. SSH is used to converge all of the nodes in the runtime layer followed by all of the nodes in the proxy layer, making zero downtime deployment possible.

Backing Services

In keeping with Twelve Factor methodology, backing services like databases, queues and storage are decoupled and attached using environment variables. This allows formations to use backing services provided via different formations (through their proxy layer), or external/third-party services accessible over the network. The use of environment variables also allows formations to easily swap backing services when necessary.

See Also