New Relic Open Sources their Docker Deployment Tool Centurion
New Relic open sourced Centurion, a deployment tool for Docker used internally to run their production infrastructure. Centurion takes containers from a Docker registry and runs them on a fleet of hosts with the correct environment variables, host volume mappings, and port mappings, supporting rolling deployments out of the box.
Karl Matthias, site engineering manager at New Relic, announced during DockerCon the public availability of Centurion under a MIT license. The project is distributed as a Ruby gem and reads a configuration file using Rake task syntax with a built-in DSL, although soon it will support reading the configuration from etcd. The DSL includes instructions to define the image to deploy, Docker servers to deploy to, environment variables, volumes and ports for each container, and it supports defining multiple environments like staging and production.
Centurion includes a number of tasks to work with distributed containers:
Rolling deployment to a fleet of Docker servers rolling_deploy: stops and starts each container one at a time to make sure that the application stays available from the viewpoint of the load balancer. As the deploy runs, a health check will hit each container to ensure that the application booted correctly. By default it will issue a GET request to the root path of the application, and expects the endpoint to issue with a valid response in the 200 status range.
Deploy to a fleet of Docker servers deploy: hard stops, then starts containers on all the specified hosts. Not recommended for apps where one endpoint needs to be available at all times.
Deploy a bash console on a host deploy_console: starts a command line shell with the existing environment passed to the container. The CMD from the Dockerfile will be replaced with /bin/bash, using the first host from the host list.
List all the tags running on servers for a particular project list:running_container_tags: returns a list of all the current tags and which machines they are running on. Gives a unique list of tags across all hosts as well, useful for validating the state of the deployment in the case where something goes wrong mid-deploy.
List all the containers currently running for this project list:running_containers: returns a list of all the containers for a project on each of the Docker servers from the config.
List registry images list: returns a list of all the images in the registry for the project.
The project is looking to add some more features, such as etcd integration for configs and discovery, certificate authentication or dynamic host allocation to a pool of servers.
Ben Melbourne Jul 04, 2015
Randy Shoup Jul 03, 2015