13
Build & test once, deploy anywhere Vday 2016 Zsolt Molnar

Build & test once, deploy anywhere - Vday.hu 2016

Embed Size (px)

Citation preview

Page 1: Build & test once, deploy anywhere - Vday.hu 2016

Build & test once, deploy anywhere

Vday 2016Zsolt Molnar

Page 2: Build & test once, deploy anywhere - Vday.hu 2016

Introduction / Use-case

• Myself: 12 sysadmin + 3 years DevOps XP• Software development company needs to ship

code to customers• Requirements: – Provide OVA/OVF images for Vmware ESXi/KVM– Provide AMI images for AWS– Build a CI/CD pipeline for both– Enable easy updates without full image re-import

Page 3: Build & test once, deploy anywhere - Vday.hu 2016

Quick intro

Page 4: Build & test once, deploy anywhere - Vday.hu 2016

Basic build & test pipeline

Build Test Release

Page 5: Build & test once, deploy anywhere - Vday.hu 2016

Inefficient pipeline

IntegrationTest

Build OVF

IntegrationTest

Build AMI

App code

Config mgmt

Release

Release

Page 6: Build & test once, deploy anywhere - Vday.hu 2016

DISCLAMER – Adults only

1. The aim of the presentation is mainly to show how can you stitch together different tools to get an automated build and test pipeline

2. The presentation at some places may not follow general Docker recommendation/guidelines for simplification

Page 7: Build & test once, deploy anywhere - Vday.hu 2016

Improved pipeline

Build OVF

IntegrationTest

Build App code

Config mgmt

Build AMI

Simple test

Simple test

Page 8: Build & test once, deploy anywhere - Vday.hu 2016

...to the rescue!

Page 9: Build & test once, deploy anywhere - Vday.hu 2016

Abstracting the application environment

Drupalmysql

PHP-FPMNGINX

OS

OS

Drupalmysql

PHP-FPMNGINX

Full stack bundled to the Host OS

Separated application environment(App bundled to a docker container)

Thin Host OS (For VM / AWS)

VM /EC2

VM / EC2

Page 10: Build & test once, deploy anywhere - Vday.hu 2016

Improved pipeline

Build VM

IntegrationTest

Build Docker img

App code

Config mgmt

Build AMI

Publish to local

repo

Simple test

Simple test

Publish to ECR

Publish to S3

https://github.com/ysolt/vday2016-demo

Page 11: Build & test once, deploy anywhere - Vday.hu 2016

Example application container

Systemd

MySQL

NGINX

PHP-FPM Drupal

Drupal Container

https://github.com/ysolt/vday2016-demo

Etc… Cron?

Page 12: Build & test once, deploy anywhere - Vday.hu 2016

Tools

• Jenkins – CI “orchestration”• VirtualBox – VM on local machine• Vagrant – build OVA/OVF• Docker-mac • Docker distribution (v2 registry) – local builds• Packer – build AMI• ECR – container registry for AMI build• S3 – store container bundles for rolling updates

https://github.com/ysolt/vday2016-demo

Page 13: Build & test once, deploy anywhere - Vday.hu 2016

Thanks for your attention

Q & Ahttps://github.com/ysolt/vday2016-demo