Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Joomla Continuous Delivery with Docker

6,438 views

Published on

Joomla Continuous Delivery with Docker on Joomla Day Bangkok 2014.

I did demo to show how it looks like on that session too. In case of anyone interested on how I did it. Please check README.md on my repository here https://git.winginfotech.net/continuous-delivery/cd-joomla/tree/master

For whoever wants to see the real demo. Please see it here https://www.youtube.com/watch?v=nFzulhEt3As at the minute around after 19.30. Demo session in Thai and hope there will be a chance that I can do presentation in English soon :)

Published in: Technology

Joomla Continuous Delivery with Docker

  1. 1. Joomla Continuous Delivery with Docker Jirayut Nimsaeng (Dear) Joomla Day Bangkok, Thailand 2014 December 14, 2014 @ C.P. Tower Release Build Deploy Test
  2. 2. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower #whoami ● Jirayut Nimsaeng (Dear) ● Infrastructure Team Lead at Proteus Technologies ● ScrumMaster ● Interested in Cloud and Open Source Technology ● Working with Docker since version 0.6
  3. 3. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Experienced? ● Develop and test on AppServ or XAMPP ● Deploy with FileZilla ● Git ● Vagrant ● Docker ● Testing ● Automated test ● Automated deploy
  4. 4. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Why Continuous Delivery?
  5. 5. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Classic Release Requirement Design Implementation Testing Release Waterfall
  6. 6. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Risk
  7. 7. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Release Frequently Split your product Optimize business value $$$ $ Split time January April
  8. 8. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Why Docker?
  9. 9. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Developer Problems Developer Local Test QA Production
  10. 10. What Developer needs Production-like Quick Repeatable Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower
  11. 11. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Docker can ● Deploy reliably & consistently ● Everything will be exactly the same – Distros – Software versions – Library dependencies ● If it works locally, it will work everywhere
  12. 12. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Docker can ● Deploy efficiently – Laptop can run 10-100 containers easily – Server can run 10-1000 containers ● Containers can run at native speeds – http://www.slideshare.net/BodenRussell/kvm-and-docker- lxc-benchmarking-with-openstack
  13. 13. Docker CPU benchmark Docker / KVM: Compute Node Steady-State CPU (Segment Overlay) Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower 14 12 10 8 6 4 2 0 docker-usr docker-sys kvm-usr kvm-sys Time: KVM(95s - 307s) Docker(31s – 243s) CPU Usage In Percent Docker Averages – 0.2 – 0.03 KVM Averages – 1.91 – 0.36
  14. 14. Docker Memory benchmark Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower 7.00E+09 6.00E+09 5.00E+09 4.00E+09 3.00E+09 2.00E+09 1.00E+09 0.00E+00 Docker / KVM: Compute Node Used Memory (Overlay) kvm docker Axis Title Memory Used
  15. 15. Docker Memory benchmark Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower MEMCPY DUMB MCBLOCK 14000 12000 10000 8000 6000 4000 2000 0 3823.3 4393.3 12881.61 3813.38 4395.92 12905.68 3428.95 3461.59 7223.23 Memory Benchmark Performance Bare Metal (MiB/s) docker (MiB/s) KVM (MiB/s) Memory Test MiB/s
  16. 16. Docker I/O benchmark Sysbench Synchronous File I/O Random Read/Write @ R/W Ratio of 1.50 1 2 4 8 16 32 64 Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower 1600 1400 1200 1000 800 600 400 200 0 docker KVM Threads Total Transferred In Kb/sec
  17. 17. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower What is Docker? ● Platform to help code, test and deploy applications ● Combine with – Lightweight container virtualization – Work flows – Tooling
  18. 18. App B1 Jirayut Nimsaeng Containers are isolated, but share OS and, where appropriate, bins/libraries Bins/Libs Bins/Libs Host OS Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Containers vs. VMs App A2 Hypervisor Host OS Server App A1 Guest OS Guest OS Guest OS Bins/ Libs Bins/ Libs Bins/ Libs VM Server App A1 App A2 App B1 App B2 App B3 Docker daemon Container
  19. 19. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Dockerfile ● Dockerfile is instructions to build Docker image – How to run commands – Add files or directories – Create environment variables – What process to run when launching container
  20. 20. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Sample Dockerfile FROM ubuntu:14.04 MAINTAINER Jirayut Nimsaeng <w [at] winginfotech.net> ADD build-files /build-files RUN apt-get update RUN apt-get install -y openssh-server vim tmux rsync byobu RUN mkdir /var/run/sshd RUN sed -i 's/required pam_loginuid.so/optional pam_loginuid.so/g' /etc/pam.d/sshd CMD /start.sh EXPOSE 22
  21. 21. Commit Change Jirayut Nimsaeng App A2 Container App A App A Image Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Docker life cycle App A Docker Container Docker Registry Commit Push Host App A1 Container Pull Docker Engine Ubuntu Base Docker Apache Docker Container Apache Bins/Libs Apache + PHP Docker Image Bins/Libs Apache App A ΔΔ Change App A Apache Bins/Libs App A Docker image
  22. 22. App A Image App A Docker Engine Jirayut Nimsaeng Image App A Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Docker workflows Dockerfile For App A Host 1 (Dev/Build Server) Docker Registry Host 2 (Container Server) 1.Build 2.Push 3.Pull 4.Run Docker Engine Container App A Production
  23. 23. 2022 2035 2035 Jirayut Nimsaeng 80 Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Docker Use Cases ● Docker as Development Environment Host Virtualbox VM 22 SSH Docker Daemon Web Server boot2docker-vm 80 1024+ Docker Containers Database Host-only 80
  24. 24. Jirayut Nimsaeng Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower Docker Use Cases ● Docker for Continuous Delivery
  25. 25. Continuous Delivery with Docker Jirayut Nimsaeng Docker Registry Docker Engine Joomla Continuous Delivery with Docker December 14, 2014 @ C.P. Tower DB Backup Server Gitlab Server Gitlab CI Server Docker Engine Gitlab CI Runner Test/Prod Server MySQL Dockerfile Joomla Dockerfile Image MySQL Image Joomla Image Joomla Image Joomla Container MySQL Container 1. Push Code 2. Trigger 3. Trigger 4. Get 5. Build 5.1. Get 6. Push Joomla Docker Image 7. Build 7.1. Import 8. Push MySQL Docker Image 9. Trigger 10. Pull Docker Image 12. Acceptance Test 3.5. Unit Test 11. Deploy

×