SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
Continuous Delivery
with Docker
Tobias Schwab
Myself
• Tobias Schwab
• tobias.schwab@dynport.de
• www.dynport.de
• twitter.com/tobstarr
• github.com/tobstarr
Philosophie
• continuous delivery: deploy multiple times a day
• canary releases
• “never touch a running system”
• “Immutable Infrastructure and Disposable
Components"
• don’t fix it, if it can be replaced
Theory
• AWS
• AMI based deployments
• Elastic Load Balancer
• AutoScaling Groups
• S3, RDS, …
Reality
• privacy concerns: AWS not an option
• hoster we could not pick
• first no, then proprietary and unreliable API
• flash based infrastructure management
• limited capacity
• we were the biggest customer
Docker
• build, distribute and deploy container based
applications
• creator: dotcloud
• initial release: March 13, 2013
• license: Apache 2.0
• 11k stars on Github (top 50)
• golang client/server
Container Virtualization
• os level
• shared kernel
• cgroups: isolate CPU, Memory, Block IO, Network
• lxc: cgroups + application namespaces
• lightweight and fast
Images
• blueprints for containers
• tarball of os installation/packages
• read only
• stateless
• layered
Containers
• instances of images
• copy on write / union file system
• running or exited
• goal: stateless and immutable
• can be “saved” (docker commit) as images
• created to be thrown away
Containers and images
Source: http://docs.docker.io/en/latest/terms/container/
Demo
Build
• manual
• start and attach container
• install required packages
• checkout application code
• run build management tool
• bad: not reproducible
• bad: does not utilise caching
Build
• chef/puppet/…
• start an attach container
• run chef/puppet/… client
• good: automated and documented
• bad: does not utilise caching
Dockerfile
• simple, plain text script to create images
• commands:
• FROM: base image to use
• RUN: execute shell command
• ENV: set environment variable
• ADD: write local file to image
• ENTRYPOINT: start command for containers
• others: MAINTAINER, EXPOSE, CMD, USER, VOLUME, WORKDIR,
ONBUILD
Dockerfile
Dockerfile
Caching
• statement based: each step creates a new image
• existing steps (command tree exists) are re-used
• tricky: “non functional” commands (e.g. apt-get
update/upgrade)
• use ENV or comments to break caching of non
functional commands
Caching
Configuration Management
• “store config in the environment” (http://12factor.net/config)
• dependency injected with start of container
• same image for
• development
• testing
• staging
• production
Don’ts
• full blown VMs
• ssh daemon inside containers
• syslog daemon inside containers (sometimes
needed)
• user management: everything can run as root
• chef/puppet/… => makes caching useless
Build Management Tools
• candidates: bundler, pip, mvn, carton, composer, …
• problem with caching: bmt are slow when started with “clean slate”
• option 1: add bmt manifest before code
• bmt needs to run only when manifest changes
• option 2: use pre-bundled base images
• bmt only needs to work the delta
• re-build base images from time to time
• option 3: combine option 1 and option 2
• Problems
• unicorn: Rack HTTP server for fast clients
• static assets
• logging: default ruby syslog library uses syscall (needs local syslog daemon)
• Solution
• run 3 daemons in 1 container: unicorn, nginx and rsyslogd
• upstart
• ENTRYPOINT [“/sbin/init”]
• load ENV from /proc/1/environ
• foreman
Use Case: Ruby on Rails
Multi-Host
• image distribution via docker registry
• weighted load balancing via HAProxy
• SSL termination via nginx in front of HAProxy
Registry
• push and pull images
• public
• private
• backends: local, S3, Elliptics, Google Cloud
Storage, hosted
Load Balancing
• HAProxy
• license: GPL v2
• pool configuration stored in redis/etcd
• config update
• compile config files from stored configuration
• upload via ssh
• verify on remote hosts
• replace current config with verified one
• reload
HAProxy
HAProxy
Deployment Pipeline
• commit triggers new image build
• build suite executed with image
• image is pushed to registry if tests passed
• optional: start image with staging ENV settings for manual testing
• start image with production ENV for last pre-flight tests
• deploy image to more hosts
• update load balancer (canary or green/blue)
• monitor new containers/image
Deployment Pipeline
Nginx
HAProxy
Nginx
HAProxy
Docker
Container
Container
Container
Docker
Container
Container
Container
Docker
Container
Container
Container
Docker
Container
Container
Container
Docker Registry
Docker Build
2 push
3 pull + run
1 build
4 update4 update
Route 53
Logging
• host: docker host, container_id
• code: image_id, revision
• request: request_id, action, status_code, etag, times, calls
• NOT inside containers
• remote syslog (when possible)
• alternative: local syslog relay inside container
Metrics
• OpenTSDB
• “distributed, scalable Time Series Database”
• license: LGPLv2.1+
• HBase
• Tags / Dimensions
• from syslog via udp (StatsD “like”)
• rickshaw.js for graphs
• compare status codes, counts and times between actions of two revisions
OpenTSDB
Metrics
Metrics
request counts by revision
Metrics
Metrics
Metrics
Docker reduces
• external dependencies (“rubygems/github slow/unreliable/down”)
after image is built
• “did work on my machine/staging”: same OS package versions,
configuration and code in all stages
• unused CPU cycles
• number of hosts
• feedback times
• time to get new host online
• bottlenecks: hosts are more flexible
VS. AWS
• HAProxy much more flexible
• multiple containers per host
• balancing weights
• faster build process
• faster deployments
• instance flexibility
Resources
• docker.io
• opentsdb.net
• haproxy.1wt.eu
• continuousdelivery.com
• chadfowler.com/blog/2013/06/23/immutable-
deployments/
• 12factor.net
Questions?!?
Thank you!

Weitere ähnliche Inhalte

Was ist angesagt?

Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)Eric Smalling
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionPeng Xiao
 
Docker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registryDocker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registrydotCloud
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsElasTest Project
 
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12dotCloud
 
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconfContinuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconfJulia Mateo
 
Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To RunningGiacomo Vacca
 
DCA. certificate slide Session 1
DCA. certificate slide Session 1DCA. certificate slide Session 1
DCA. certificate slide Session 1Hadi Tayanloo
 
The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...Sébastien Portebois
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewiredotCloud
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsBen Hall
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An IntroductionPOSSCON
 
Containers and docker
Containers and dockerContainers and docker
Containers and dockerSUDIP GHOSH
 

Was ist angesagt? (20)

Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Docker & ci
Docker & ciDocker & ci
Docker & ci
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registryDocker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registry
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
 
Docker From Scratch
Docker From ScratchDocker From Scratch
Docker From Scratch
 
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
 
Docker in real life
Docker in real lifeDocker in real life
Docker in real life
 
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconfContinuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
 
Docker
DockerDocker
Docker
 
Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To Running
 
DCA. certificate slide Session 1
DCA. certificate slide Session 1DCA. certificate slide Session 1
DCA. certificate slide Session 1
 
The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...
 
Intro To Docker
Intro To DockerIntro To Docker
Intro To Docker
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
 
Docker
DockerDocker
Docker
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An Introduction
 
Containers and docker
Containers and dockerContainers and docker
Containers and docker
 

Ähnlich wie OSDC 2014: Tobias Schwab - Continuous Delivery with Docker

Docker crash course
Docker crash courseDocker crash course
Docker crash coursenispas
 
Virtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management servicesVirtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management servicesabhishek chawla
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...E. Camden Fisher
 
Overcoming 5 Common Docker Challenges: How We Do It at RightScale
Overcoming 5 Common Docker Challenges: How We Do It at RightScaleOvercoming 5 Common Docker Challenges: How We Do It at RightScale
Overcoming 5 Common Docker Challenges: How We Do It at RightScaleRightScale
 
Preparing your dockerised application for production deployment
Preparing your dockerised application for production deploymentPreparing your dockerised application for production deployment
Preparing your dockerised application for production deploymentDave Ward
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionSparkbit
 
Docker introduction
Docker introductionDocker introduction
Docker introductionWalter Liu
 
Using Docker in production: Get started today!
Using Docker in production: Get started today!Using Docker in production: Get started today!
Using Docker in production: Get started today!Clarence Bakirtzidis
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsRamit Surana
 
Dockerize the World
Dockerize the WorldDockerize the World
Dockerize the Worlddamovsky
 
Lightweight Virtualization Docker in Practice
Lightweight Virtualization Docker in PracticeLightweight Virtualization Docker in Practice
Lightweight Virtualization Docker in PracticeDocker, Inc.
 
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container ServicePlay Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container ServiceJosh Padnick
 
Containers and security
Containers and securityContainers and security
Containers and securitysriram_rajan
 
Docker in pratice -chenyifei
Docker in pratice -chenyifeiDocker in pratice -chenyifei
Docker in pratice -chenyifeidotCloud
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationGiacomo Vacca
 
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...Lucas Jellema
 
Docker Containers Deep Dive
Docker Containers Deep DiveDocker Containers Deep Dive
Docker Containers Deep DiveWill Kinard
 

Ähnlich wie OSDC 2014: Tobias Schwab - Continuous Delivery with Docker (20)

Django and Docker
Django and DockerDjango and Docker
Django and Docker
 
Docker crash course
Docker crash courseDocker crash course
Docker crash course
 
Virtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management servicesVirtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management services
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
 
Overcoming 5 Common Docker Challenges: How We Do It at RightScale
Overcoming 5 Common Docker Challenges: How We Do It at RightScaleOvercoming 5 Common Docker Challenges: How We Do It at RightScale
Overcoming 5 Common Docker Challenges: How We Do It at RightScale
 
Preparing your dockerised application for production deployment
Preparing your dockerised application for production deploymentPreparing your dockerised application for production deployment
Preparing your dockerised application for production deployment
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Using Docker in production: Get started today!
Using Docker in production: Get started today!Using Docker in production: Get started today!
Using Docker in production: Get started today!
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and tools
 
Dockerize the World
Dockerize the WorldDockerize the World
Dockerize the World
 
Lightweight Virtualization Docker in Practice
Lightweight Virtualization Docker in PracticeLightweight Virtualization Docker in Practice
Lightweight Virtualization Docker in Practice
 
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container ServicePlay Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
 
Containers and security
Containers and securityContainers and security
Containers and security
 
Docker in pratice -chenyifei
Docker in pratice -chenyifeiDocker in pratice -chenyifei
Docker in pratice -chenyifei
 
Java developer intro to environment management with vagrant puppet and docker
Java developer intro to environment management with vagrant puppet and dockerJava developer intro to environment management with vagrant puppet and docker
Java developer intro to environment management with vagrant puppet and docker
 
ExpoQA 2017 Docker and CI
ExpoQA 2017 Docker and CIExpoQA 2017 Docker and CI
ExpoQA 2017 Docker and CI
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
 
Docker Containers Deep Dive
Docker Containers Deep DiveDocker Containers Deep Dive
Docker Containers Deep Dive
 

Kürzlich hochgeladen

UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profileakrivarotava
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 

Kürzlich hochgeladen (20)

UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 

OSDC 2014: Tobias Schwab - Continuous Delivery with Docker

  • 2. Myself • Tobias Schwab • tobias.schwab@dynport.de • www.dynport.de • twitter.com/tobstarr • github.com/tobstarr
  • 3. Philosophie • continuous delivery: deploy multiple times a day • canary releases • “never touch a running system” • “Immutable Infrastructure and Disposable Components" • don’t fix it, if it can be replaced
  • 4. Theory • AWS • AMI based deployments • Elastic Load Balancer • AutoScaling Groups • S3, RDS, …
  • 5. Reality • privacy concerns: AWS not an option • hoster we could not pick • first no, then proprietary and unreliable API • flash based infrastructure management • limited capacity • we were the biggest customer
  • 6. Docker • build, distribute and deploy container based applications • creator: dotcloud • initial release: March 13, 2013 • license: Apache 2.0 • 11k stars on Github (top 50) • golang client/server
  • 7. Container Virtualization • os level • shared kernel • cgroups: isolate CPU, Memory, Block IO, Network • lxc: cgroups + application namespaces • lightweight and fast
  • 8. Images • blueprints for containers • tarball of os installation/packages • read only • stateless • layered
  • 9. Containers • instances of images • copy on write / union file system • running or exited • goal: stateless and immutable • can be “saved” (docker commit) as images • created to be thrown away
  • 10. Containers and images Source: http://docs.docker.io/en/latest/terms/container/
  • 11. Demo
  • 12. Build • manual • start and attach container • install required packages • checkout application code • run build management tool • bad: not reproducible • bad: does not utilise caching
  • 13. Build • chef/puppet/… • start an attach container • run chef/puppet/… client • good: automated and documented • bad: does not utilise caching
  • 14. Dockerfile • simple, plain text script to create images • commands: • FROM: base image to use • RUN: execute shell command • ENV: set environment variable • ADD: write local file to image • ENTRYPOINT: start command for containers • others: MAINTAINER, EXPOSE, CMD, USER, VOLUME, WORKDIR, ONBUILD
  • 17. Caching • statement based: each step creates a new image • existing steps (command tree exists) are re-used • tricky: “non functional” commands (e.g. apt-get update/upgrade) • use ENV or comments to break caching of non functional commands
  • 19. Configuration Management • “store config in the environment” (http://12factor.net/config) • dependency injected with start of container • same image for • development • testing • staging • production
  • 20. Don’ts • full blown VMs • ssh daemon inside containers • syslog daemon inside containers (sometimes needed) • user management: everything can run as root • chef/puppet/… => makes caching useless
  • 21. Build Management Tools • candidates: bundler, pip, mvn, carton, composer, … • problem with caching: bmt are slow when started with “clean slate” • option 1: add bmt manifest before code • bmt needs to run only when manifest changes • option 2: use pre-bundled base images • bmt only needs to work the delta • re-build base images from time to time • option 3: combine option 1 and option 2
  • 22. • Problems • unicorn: Rack HTTP server for fast clients • static assets • logging: default ruby syslog library uses syscall (needs local syslog daemon) • Solution • run 3 daemons in 1 container: unicorn, nginx and rsyslogd • upstart • ENTRYPOINT [“/sbin/init”] • load ENV from /proc/1/environ • foreman Use Case: Ruby on Rails
  • 23. Multi-Host • image distribution via docker registry • weighted load balancing via HAProxy • SSL termination via nginx in front of HAProxy
  • 24. Registry • push and pull images • public • private • backends: local, S3, Elliptics, Google Cloud Storage, hosted
  • 25. Load Balancing • HAProxy • license: GPL v2 • pool configuration stored in redis/etcd • config update • compile config files from stored configuration • upload via ssh • verify on remote hosts • replace current config with verified one • reload
  • 28. Deployment Pipeline • commit triggers new image build • build suite executed with image • image is pushed to registry if tests passed • optional: start image with staging ENV settings for manual testing • start image with production ENV for last pre-flight tests • deploy image to more hosts • update load balancer (canary or green/blue) • monitor new containers/image
  • 30. Logging • host: docker host, container_id • code: image_id, revision • request: request_id, action, status_code, etag, times, calls • NOT inside containers • remote syslog (when possible) • alternative: local syslog relay inside container
  • 31. Metrics • OpenTSDB • “distributed, scalable Time Series Database” • license: LGPLv2.1+ • HBase • Tags / Dimensions • from syslog via udp (StatsD “like”) • rickshaw.js for graphs • compare status codes, counts and times between actions of two revisions
  • 38. Docker reduces • external dependencies (“rubygems/github slow/unreliable/down”) after image is built • “did work on my machine/staging”: same OS package versions, configuration and code in all stages • unused CPU cycles • number of hosts • feedback times • time to get new host online • bottlenecks: hosts are more flexible
  • 39. VS. AWS • HAProxy much more flexible • multiple containers per host • balancing weights • faster build process • faster deployments • instance flexibility
  • 40. Resources • docker.io • opentsdb.net • haproxy.1wt.eu • continuousdelivery.com • chadfowler.com/blog/2013/06/23/immutable- deployments/ • 12factor.net