Cloud Docker – 12 Dockers of Docker



Cloud Docker – 12 Dockers of Docker

0 0


presentation-drone-deis-integration

presentation for Cloud Austin on building a CI/CD workflow with Drone and Deis

On Github paulczar / presentation-drone-deis-integration

Cloud Docker

12 Dockers of Docker

Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Rocket Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker Docker

Created by Paul Czarkowski / @pczarkowski

Cloud Austin

12 Clouds of Christmas

Private CI/CD using Docker, Deis, and Drone

Created by Paul Czarkowski / @pczarkowski

Deis

  • Platform as a Service
  • Think private Heroku
  • CoreOS + Docker
  • 12 factor

Deis Architecture

  • 3+ CoreOS Servers
  • etcd / fleet
  • `deisctl` for operations
  • `deis` for users

Installing Deis

Excellent tooling/documentation for installing.

Installs on AWS as easily as:



$ ./provision-ec2-cluster.sh
{
    "StackId": "arn:aws:cloudformation:us-west-1:413516094235:stack/deis/9699ec20-c257-11e3-99eb-50fa01cd4496"
}
Your Deis cluster has successfully deployed.
Please wait for all instances to come up as "running" before continuing.
$ export DEISCTL_TUNNEL="deis-1.example.com"
$ deisctl install platform
● ▴ ■
■ ● ▴ Installing Deis...
▴ ■ ●

Scheduling data containers...
...
Deis installed.
Please run `deisctl start platform` to boot up Deis.

Using Deis

$ git clone https://github.com/paulczar/example-python-flask.git
$ cd example-python-flask
$ deis create
$ git push deis master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 287 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
-----> Python app detected
...
...
-----> Launching...
       done, gifted-hardtack:v11 deployed to Deis

       http://gifted-hardtack.173.247.105.8.xip.io
$ curl http://gifted-hardtack.173.247.105.8.xip.io
POWERED By Deis

Drone

  • Automated Tests / Builds.
  • Very similar to TravisCI.
  • Available as both SaaS and OpenSource.
  • Tests/Builds run in Docker containers.
  • Installable from a .deb on Ubuntu.
  • Oauth integration - github, gitlab, bitbucket
  • Poor performance unless AUFS.

.drone.yml

Very similar to .travis.yml

image: python:2
script:
  - pip install tox
  - tox
notify:
  slack:
    username: devop
    token: {{ slack_token }}
    team: cloud_austin
deploy:
  git:
    target: ssh://git@deis.173.247.105.8.xip.io:2222/gifted-hardtack.git
    branch: master
    force: false
          

Drone Simple Architecture

+---------------------------------+
|                                 |
|       +----------------+        |
|       |                |        |
|       |     SQLite     |        |
|       |                |        |
|       +----------------+        |
|                                 |
|       +----------------+        |
|       |                |        |
|       |     Droned     |        |
|       |                |        |
|       +----------------+        |
|                                 |
|       +----------------+        |
|       |                |        |
|       |     Docker     |        |
|       |                |        |
|       +----------------+        |
|                                 |
|                                 |
|            Ubuntu               |
|                                 |
+---------------------------------+

        

Drone Complex Architecture

                   +---------------------------------+
                   |                                 |
                   |              Amazon ELB         |
                   |                                 |
                   +------------------+--------------+
                                      |
                          +----------------------+        +--------------------+
+---------------+         |           |          |        |                    |
|               |         |  +--------+-------+  |        |  +--------------+  |
|     Amazon    | <--------+ |                |  |        |  |              |  |
|      RDS      |         |  |     Droned     | +----------> |    Docker    |  |
|               |         |  |                |  |        |  |              |  |
+---------------+         |  +-------++-------+  |        |  +--------------+  |
                          |          ||          |        |                    |
                          |  +-------++-------+  |        |                    |
                          |  |                |  |        |       CoreOS       |
                          |  |     Docker     |  |        |                    |
                          |  |                |  |        +--------------------+
                          |  +----------------+  |
                          |                      |
                          |                      |
                          |       CoreOS         |
                          |                      |
                          +----------------------+


        

Installing Drone

Quick and Easy:



$ curl -Ssl http://get.docker.com | bash
$ wget downloads.drone.io/master/drone.deb
$ sudo dpkg -i drone.deb


DevOpsy:

  • https://github.com/justincampbell/chef-drone

Using Drone

from the CLI


$ git clone https://github.com/paulczar/example-python-flask.git
$ cd example-python-flask
$ drone build .
[DRONE] creating build image
[DRONE] copying repository to /var/cache/drone/src/example-python-flask
[DRONE] starting build
[DRONE] temp directory is /tmp/drone
$ pip install tox
Downloading/unpacking tox
  Running setup.py egg_info for package tox

Downloading/unpacking virtualenv>=1.11.2 (from tox)
  Running setup.py egg_info for package virtualenv
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in /home/ubuntu/virtualenv/python2.7/lib/python2.7/site-packages (from tox)
...
...
$ tox
pep8 create: /var/cache/drone/src/example-python-flask/.tox/pep8
pep8 installdeps: -r/var/cache/drone/src/example-python-flask/requirements.txt, -r/var/cache/drone/src/example-python-flask/test-requirements.txt
pep8 runtests: PYTHONHASHSEED='187694681'
pep8 runtests: commands[0] | pep8 --show-source --show-pep8 .
___________________________________ summary ____________________________________
  pep8: commands succeeded
  congratulations :)
$ exit 0
[DRONE] removing build container
[DRONE] removing build image

Drone Build Results (/tmp/example-python-flask)
 ✓  (15 seconds)

Demo

FIN

Links