Giter Site home page Giter Site logo

zodiac's Introduction

Zodiac

A lightweight tool, built on top of Docker Compose, for easy deployment and rollback of dockerized applications.

Zodiac allows you to deploy Docker Compose applications while maintaining a history of all deployments. Among other things, this allows you to rollback to a previous, known-good deployment in the event that there are issues with your current build.

Imagine you have the following docker-compose.yml file

web:
  image: centurylink/simple-server
  ports:
    - "8888:8888"

Using Zodiac to deploy this application:

$ zodiac deploy
Deploying your application...
Creating zodiac_web_1
Successfully deployed 1 container(s)

View your deployment using the list command:

$ zodiac list
ACTIVE ID      DEPLOY DATE             SERVICES        MESSAGE
*      1       2015-06-30 00:40:27     zodiac_web_1

You changed your image and deploy again. The first deployment is retained:

$ zodiac list
ACTIVE ID      DEPLOY DATE             SERVICES        MESSAGE
*      2       2015-06-30 00:55:12     zodiac_web_1
       1       2015-06-30 00:40:27     zodiac_web_1

Rollback to the first deployment if needed:

$ zodiac rollback 1
Rolling back your application...
Creating zodiac_web_1
Successfully rolled back to deployment: 1
$ zodiac list
ACTIVE ID      DEPLOY DATE             SERVICES        MESSAGE
*      3       2015-06-30 00:56:09     zodiac_web_1    Rollback to: #1
       2       2015-06-30 00:55:12     zodiac_web_1
       1       2015-06-30 00:40:27     zodiac_web_1

NOTE

This repo is no longer being maintained. Users are welcome to fork it, but we make no warranty of its functionality.

Installation

Readying the remote environment

While Zodiac can be used just locally, we recommend pointing it at a remote environment. In that case Zodiac needs to be able to communicate with the docker daemon on that remote host. We strongly encourage the use of Docker Machine for provisioning and installing Docker on the remote host. Zodiac is designed to work out of the box with a Machine-provisioned endpoint. However, one can also set DOCKER_OPTS manually on the remote host. Instructions for setting DOCKER_OPTS at runtime will vary by OS.

TLS

If you are going to use Zodiac to deploy to remote hosts you will want to ensure that your remote Docker daemon is protected with TLS security. Zodiac ships with TLS support out of the box. Both host verification and client authentication are done via TLS. TLS is enabled by default, though it may be disabled for debugging purposes, when using private networks, etc.

Configuring TLS

NOTE: We assume you're using TLS by default, if not using TLS (strongly discouraged), you'll need to set --tls=false, or set the DOCKER_TLS envirnoment variable to false.

Let Docker Machine do all the heavy lifting

If you used Docker machine to provision Docker on the remote Host, it will have generated TLS certificates and keys for you on both the client and host machine.

You can use the docker-machine env command to automatically set-up the environment variables necessary for Zodiac to communicate with the remote host via TLS:

eval "$(docker-machine env your_remote_name)"

If you do this, you should not need to use the --endpoint flag or any of the --tls* flags when running the Zodiac client.

OR Set up the certificates manually

If you choose to generate the TLS certificates manually, you'll want to genrate a certificate (be it self-signed or CA signed) for the host. You'll also want to generate a client certificate for authentication purposes. Consult the Docker docs for securing the Docker daemon.

Use the zodiac help command to see the options for passing in the necassary certificate files.

Install the local Zodiac client

or if you're a risk taker:

curl -sSL https://raw.githubusercontent.com/CenturyLinkLabs/zodiac/master/install.sh | bash

Usage

The zodiac client supports the following commands:

  • verify - verify that the target Docker endpoint is reachable and running a compatible version of the API.
  • deploy - deploy the Docker Compose-defined application to the target Docker endpoint.
  • rollback - roll to a previous Zodiac deployment.
  • list - list all previous application deployments.
  • teardown - remove running services and deployment history for the application.

NOTE: Zodiac stores all deployment history on the containers, so manually removing containers can destroy all Zodiac history.

Global Options

The following flags apply to all of the Zodiac commands:

  • --endpoint - Host and port for the target Docker endpoint. Should be in the form "tcp://hostname:port". Can optionally be provided by setting the DOCKER_HOST environment variable.
  • --tls - Flag indicating whether or not to use TLS/SSL to communicate with the Docker daemon endpoint (defaults to true).
  • --tlsverify - Flag indicating whether or not to perform TLS certificate authentication on the remote server's certificate (defaults to true).
  • --tlscacert - Path to the CA certificate which should be used to authenticate the remote server's certificate (defaults to ~/.docker/ca.pem).
  • --tlscert - Path to the certificate which should be used for client certificate authentication (defaults to ~/.docker/cert.pem).
  • --tlskey - Path to the private key which should be used for client certificate authentication (defaults to ~/.docker/key.pem).
  • --debug - Run the client in debug mode with verbose output.
  • --version - Display version information for the Zodiac client.
  • --help - Display the Zodiac client help text.

For more information about the various TLS flags, see the TLS section below.

Remote Target Configuration

The remote Docker host must be exposed over a TCP port to enable remote communication from the local Zodiac CLI. This is typically done by setting DOCKER_OPTS to something like: DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock". It's worth noting that Docker Machine will do this for you.

Desired features / fixes

  • Support for compose's build option
  • Support for compose's volumes_from option
  • Support for private repos on the Docker hub
  • Compose scale support

zodiac's People

Contributors

alexwelch avatar bdehamer avatar dpetersen avatar patocox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zodiac's Issues

docker-compose scale

Great work on Zodiac! Feature request: support docker-compose scale functionality (and superhero points for automatic load balancing)

Missing image library/zodiac_server

When I run zodiac deploy after verifying my endpoint, I get :

Deploying your application...
Error: Error: image library/zodiac_server: not found  

Am I missing something? Searched for that image on Dockerhub but to no avail..

Feature request: ability to specific a message

When performing a "zodiac list", one of the columns specifies "MESSAGE", which looks to be used for rollbacks. It would be useful to have the ability to specify a message when performing a deploy, i.e.:

zodiac deploy -m "Update to version 3.10"

zero downtime?

if I deploy with zodiac, does it cause downtime on my server or are old containers kept alive until the new ones are fully spun up?

Support private Docker Registry

First of all this is a great project, thanks for this!
I have a question about the Support for a private Docker Registry, do you looking forward to support this in future. Because I ran in an issue with this and saw that you will support private repos on the Docker hub.
So would it be possible to use zodiac with an private docker registry???

Error 409 Name Conflict

Hi

I tried out Zodiac today and received the following error:

zodiac --debug deploy --name "atestapp" -m "Message"
Deploying your application...
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Datestapp%22%2C+%22com.docker.compose.service%3Ddata%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&size=0 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&size=0 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Datestapp%22%2C+%22com.docker.compose.service%3Ddb%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&size=0 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&size=0 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Datestapp%22%2C+%22com.docker.compose.service%3Dwebapp%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&size=0 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&size=0 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Datestapp%22%2C+%22com.docker.compose.service%3Ddata%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&size=0 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&size=0 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Datestapp%22%2C+%22com.docker.compose.service%3Ddb%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&size=0 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&size=0 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Datestapp%22%2C+%22com.docker.compose.service%3Dwebapp%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&size=0 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&size=0 
INFO[0000] IMAGE INSPECT request to /v1.19/images/busybox/json 
INFO[0000] IMAGE CREATE REQUEST to /v1.19/images/create?tag=latest&fromImage=busybox 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Datestapp%22%2C+%22com.docker.compose.service%3Ddata%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&size=0 
INFO[0000] IMAGE INSPECT request to /v1.19/images/busybox/json 
INFO[0000] CREATE request to /v1.19/containers/create?name=atestapp_data_1 
INFO[0000] INSPECT request to /v1.19/containers/doesnt_matter/json 
INFO[0000] START request to /v1.19/containers/id_doesnt_matter/start 
INFO[0000] IMAGE INSPECT request to /v1.19/images/mysql/json 
INFO[0000] IMAGE CREATE REQUEST to /v1.19/images/create?tag=latest&fromImage=mysql 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Datestapp%22%2C+%22com.docker.compose.service%3Ddb%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&size=0 
INFO[0000] IMAGE INSPECT request to /v1.19/images/mysql/json 
INFO[0000] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Datestapp%22%2C+%22com.docker.compose.service%3Ddata%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&size=0 
INFO[0000] CREATE request to /v1.19/containers/create?name=atestapp_db_1 
INFO[0000] INSPECT request to /v1.19/containers/doesnt_matter/json 
INFO[0000] START request to /v1.19/containers/id_doesnt_matter/start 
INFO[0000] IMAGE INSPECT request to /v1.19/images/atestapp_webapp/json 
INFO[0000] BUILD REQUEST to /v1.19/build?pull=False&nocache=False&q=False&t=atestapp_webapp&forcerm=False&rm=True 
INFO[0001] LIST ALL request to /v1.19/containers/json?all=1&limit=-1&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Datestapp%22%2C+%22com.docker.compose.service%3Dwebapp%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&size=0 
INFO[0001] IMAGE INSPECT request to /v1.19/images/atestapp_webapp/json 
INFO[0001] LIST ALL request to /v1.19/containers/json?all=0&limit=-1&trunc_cmd=0&filters=%7B%22label%22%3A+%5B%22com.docker.compose.project%3Datestapp%22%2C+%22com.docker.compose.service%3Ddb%22%2C+%22com.docker.compose.oneoff%3DFalse%22%5D%7D&size=0 
INFO[0001] INSPECT request to /v1.19/containers/abc123/json 
INFO[0001] CREATE request to /v1.19/containers/create?name=atestapp_webapp_1 
INFO[0001] INSPECT request to /v1.19/containers/doesnt_matter/json 
INFO[0001] START request to /v1.19/containers/id_doesnt_matter/start 
INFO[0001] docker-compose stdout: 

Successfully built abc123

Creating atestapp_data_1
INFO[0001] atestapp_data_1 created as 1827da761e82f4b1c3d540726b41ff282f0db0ffa91fea6f94b11938f7035d08 
Creating atestapp_db_1
INFO[0001] Problem creating container: %!(EXTRA *errors.errorString=Not found) 
INFO[0001] Retrying create...                           
INFO[0006] Problem creating container: %!(EXTRA dockerclient.Error=409 Conflict: Conflict. The name "atestapp_db_1" is already in use by container a83e05777f66. You have to delete (or rename) that container to be able to reuse that name.
) 
INFO[0006] Retrying create...                           
INFO[0011] Problem creating container: %!(EXTRA dockerclient.Error=409 Conflict: Conflict. The name "atestapp_db_1" is already in use by container a83e05777f66. You have to delete (or rename) that container to be able to reuse that name.
) 

I have a rails app with a linked mysql container and it seems from the errors above, there may be an issue with the sequence the linked containers are started up?

I'm running docker 1.7.1, zodiac 0.3 on os x.

Any help much appreciated.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.