Florian Dambrine - Senior Devops Engineer @GumGum
Offers innovative advertising and visual intelligence solutions for brands and publishers
Invented In-Image
advertising in 2008
Time
Infrastructure size
Ops team size
Build | gradle build | yarn build | pip install |
Package Artifact | myapp.jar | tar -czf myapp.tgz \ myapp/dist/ | tar -cf myapp.tgz \ myapp/ venv/ |
Add Runtime | java / tomcat | nginx / nodejs | python / uwsgi |
Application projects
Deploy containers on clusters
Templates:
Source code
Build container
Artifact
Production container
?
How do I reuse my Ansible roles with Docker ?
Ansible Container is an open source project that aims to enable the automation of the entire container build, deployment and management process. Best of all, [...] it uses Ansible automation language [...].
$ ansible-container init
# Create an Ansible container project
$ ansible-container build
# Build the containers with ansible roles
$ ansible-container run [--production]
# Run the application for dev or production mode
$ ansible-container push
# Publish images to the registry
$ ansible-container deploy
# Generate an Ansible playbook that can be used to deploy
# the application to a cloud platform
Conductor container:
# myapp/container.yml
version: "2"
settings:
conductor:
base: "centos:7"
services:
web:
from: "centos:7"
roles:
- common
- apache
ports:
- "80:80"
command: ["/usr/bin/dumb-init",
"/usr/sbin/apache2ctl",
"-D", "FOREGROUND"]
dev_overrides:
environment:
- "DEBUG=1"
myapp/
├── ansible.cfg
├── ansible-requirements.txt
├── container.yml
├── meta.yml
├── requirements.yml
└── roles/
$ ansible-container init
Conductor container
workspace/myapp/
├── app/
├── test.py
├── README.md
└── requirements.txt
/myapp
Laptop environment
Container environment
python-builder container
python container
1 - Fetch the code from the conductor
2 - Install, build and run tests
3 - Copy a zipped archive of the app
/artifact.tgz
4 - Copy and unzip the app
$ ansible-container build --with-volumes \
workspace/myapp
: /myapp
Demo
baseline
python
java
nodejs
tomcat
Build tools | |
Inherits from |
python
Jenkins pipelines continuously integrate different versions of ansible container projects to deploy base images to ECR (Docker registry)
2
python
3
push
push
### Application Builder Image
FROM <image>-builder:latest
MAINTAINER team-name <team-name@gumgum.com>
# Your App builds here
...
##################################################
### Production Application
FROM <image>:latest
MAINTAINER team-name <team-name@gumgum.com>
# /!\ App deps if needed but no Build tools /!\
...
# Copy previously built code
COPY --from=0 /code /app
# Copy previously installed deps
COPY --from=0 /venv /venv
ECS Cluster
<feature-1>
<feature-2>
<dev>
<stage>
<master>
app.gumgum.com
stage.va.ggops.com
dev.va.ggops.com
feature-2.dev.va.ggops.com
feature-1.dev.va.ggops.com
commit > build > test > release > deploy
app/
├── ...
├── Dockerfile
└── Jenkinsfile
Slides: http://bit.ly/2AYvWN9