Build & test once, deploy anywhere - Vday.hu 2016
-
Upload
zsolt-molnar -
Category
Engineering
-
view
20 -
download
1
Transcript of Build & test once, deploy anywhere - Vday.hu 2016
![Page 1: Build & test once, deploy anywhere - Vday.hu 2016](https://reader036.fdocuments.us/reader036/viewer/2022062503/587bdf0c1a28ab834d8b71dd/html5/thumbnails/1.jpg)
Build & test once, deploy anywhere
Vday 2016Zsolt Molnar
![Page 2: Build & test once, deploy anywhere - Vday.hu 2016](https://reader036.fdocuments.us/reader036/viewer/2022062503/587bdf0c1a28ab834d8b71dd/html5/thumbnails/2.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062503/587bdf0c1a28ab834d8b71dd/html5/thumbnails/3.jpg)
Quick intro
![Page 4: Build & test once, deploy anywhere - Vday.hu 2016](https://reader036.fdocuments.us/reader036/viewer/2022062503/587bdf0c1a28ab834d8b71dd/html5/thumbnails/4.jpg)
Basic build & test pipeline
Build Test Release
![Page 5: Build & test once, deploy anywhere - Vday.hu 2016](https://reader036.fdocuments.us/reader036/viewer/2022062503/587bdf0c1a28ab834d8b71dd/html5/thumbnails/5.jpg)
Inefficient pipeline
IntegrationTest
Build OVF
IntegrationTest
Build AMI
App code
Config mgmt
Release
Release
![Page 6: Build & test once, deploy anywhere - Vday.hu 2016](https://reader036.fdocuments.us/reader036/viewer/2022062503/587bdf0c1a28ab834d8b71dd/html5/thumbnails/6.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062503/587bdf0c1a28ab834d8b71dd/html5/thumbnails/7.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062503/587bdf0c1a28ab834d8b71dd/html5/thumbnails/8.jpg)
...to the rescue!
![Page 9: Build & test once, deploy anywhere - Vday.hu 2016](https://reader036.fdocuments.us/reader036/viewer/2022062503/587bdf0c1a28ab834d8b71dd/html5/thumbnails/9.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062503/587bdf0c1a28ab834d8b71dd/html5/thumbnails/10.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062503/587bdf0c1a28ab834d8b71dd/html5/thumbnails/11.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062503/587bdf0c1a28ab834d8b71dd/html5/thumbnails/12.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022062503/587bdf0c1a28ab834d8b71dd/html5/thumbnails/13.jpg)
Thanks for your attention
Q & Ahttps://github.com/ysolt/vday2016-demo