SlideShare a Scribd company logo
Continuous Delivery with
AWS ECS and Jenkins
Tracy Kennedy - 5/12/2016
February 23, 2016
Email: tkennedy@cloudbees.com
Git|Docker Hub: lavaliere
Twitter: @Tracy_Kennedy
Who am I?
What is continuous delivery?
Development Production
Commit Build Test Stage Deploy
Feedback Loop
What is Jenkins?
What is Jenkins?
Over
1000 Jenkins
Plugins
Integration
with over 100
DevOps Tools
Orchestration
of the DevOps
Toolchain
End-to-End
CD Pipeline
Management
Code & Commit Build & Config Scan & Test Release Deploy
What does CloudBees do?
What does CloudBees do?
What is Amazon Elastic Container Service
(ECS)?
Using Docker with Jenkins
+
Jenkins Pipeline
TEST
STAGE
PRODUCTION
App
<code>
(git, etc.)
Gold
Docker
Image
(~per app)
<OS config>
Certified
Docker
Images
(Ubuntu, etc.)
<OS config>
Jenkins and container management
Jenkins and container management
Target deployment environment in
ECS
ECS Cluster Management
Engine
Task Task
Agent
Communication
Service
ECS
Agent
Target development pipeline
Setting up Jenkins in AWS
Master spec:
T2.medium - 2 vCPU, 4 GB memory
Amazon Linux
Jenkins 2.1 RPM
Tools installed:
Git - 2.7.4-1.47.amzn1
Credentials set up:
Github - Username with password
Plugins Used
CloudBees Docker Pipeline Plugin
CloudBees Docker Build and Publish Plugin
CloudBees AWS CLI Plugin*
Pipeline Plugin
Docker Plugin
Pipeline Stage View Plugin
Git Plugin
Docker Hub Plugin
Setting up Jenkins in AWS
Agent spec:
AMI ID: ami-07b3b36d
T2.medium - 2 vCPU, 4 GB memory
Ubuntu
Installed tools:
Docker - 1.10.3 Ubuntu package
Maven - 3.0.5 Ubuntu package
Git - 2.7.3 Ubuntu package
Java 8 - OpenJDK 1.8.0_72-internal
The Jenkinsfile
● Kept in GitHub project’s root directory, Jenkins executes
● Scripts out the target deployment pipeline
● Triggered by pipeline job
The Dockerfile
● Kept in GitHub project’s root directory - copied into the Jenkins workspace
● Copies built artifact into a Docker container running Tomcat 8
● Triggered by pipeline step
Target Docker registry - Docker Hub
● Docker pipeline step “withRegistry” specifies target registry for push
● “push” step sends built image to target registry, tagged “docker-demo”
Target flow in ECS
● ECS steps run in an agent container (cloudbees/java-build-tools:0.0.7.1) with
AWS CLI
○ AWS credentials in Jenkins
○ Wraps AWS-related services
○ Calls ECS agent to trigger task that pulls the newly built app image
○ Checks ECS service status
○ “update-service” = “docker stop”
○ Manually gated deployment
Target environments in ECS
● 2 clusters: “production” and “staging” for the webapp
○ Service per cluster
■ Task definitions for pulling the app image
○ EC2 instance per cluster
■ “ECS-optimized”
■ IAM roles
Demo time!
ECS: https://console.aws.amazon.com/ecs/home?region=us-east-1#/clusters
Jenkins: http://52.72.46.249:8080/job/game-pipeline/
Github: https://github.com/lavaliere/game-of-life
Docker Hub: https://hub.docker.com/r/lavaliere/game-of-life/
Staging: http://52.200.92.100/
Challenges and blockers
Usability and troubleshooting
Learning curve
Autoscaling
“Point of no return” configs
Silent failures
Additional reading
Jenkins Pipeline
How to point Jenkins to a custom registry (e.g. local)
Setting up Jenkins slaves on AWS
Game of Life pipeline deployment to ECS
AWS’s alternative approach to building a pipeline with Jenkins and ECS
Creating an ECS cluster with ELB and autoscaling
Building multiple containers with Docker Compose and pipeline
Blue-green ECS deployments
Jenkins goodies
Join our meetup group(s)!
Jenkins http://www.meetup.com/San-Francisco-Jenkins-Area-Meetup/
Product management http://www.meetup.com/San-Jose-Product-
Management-Meetup/
Upcoming area events
Jenkins World - Sept 13-15 in Santa Clara
Jenkins 2.0 Webcast - May 17 online
JFrog swampUp - May 23 in Napa

More Related Content

PPTX
Continuous Delivery with Jenkins and Wildfly (2014)
PDF
Continuous Delivery with Jenkins Workflow
PDF
Building a Service Delivery Platform - JCICPH 2014
PDF
Jenkins Workflow Webinar - Dec 10, 2014
PPTX
2016 - Continuously Delivering Microservices in Kubernetes using Jenkins
PDF
Rundeck + Nexus (from Nexus Live on June 5, 2014)
PDF
Analyze This! CloudBees Jenkins Cluster Operations and Analytics
PPTX
Continuous Delivery with Jenkins & Kubernetes @ Sky
Continuous Delivery with Jenkins and Wildfly (2014)
Continuous Delivery with Jenkins Workflow
Building a Service Delivery Platform - JCICPH 2014
Jenkins Workflow Webinar - Dec 10, 2014
2016 - Continuously Delivering Microservices in Kubernetes using Jenkins
Rundeck + Nexus (from Nexus Live on June 5, 2014)
Analyze This! CloudBees Jenkins Cluster Operations and Analytics
Continuous Delivery with Jenkins & Kubernetes @ Sky

What's hot (20)

PDF
Docker Enables DevOps
PDF
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
PPTX
Managing Docker Containers In A Cluster - Introducing Kubernetes
PDF
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
PPTX
Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
PDF
KubeCon EU 2016 Keynote: Kubernetes State of the Union
PPTX
Devoxx 2015 - Web Application Development using Grails and Docker
PPTX
JavaOne 2014: Next Step in Automation: Elastic Build Environment
PDF
OpenStack Preso: DevOps on Hybrid Infrastructure
PDF
Predicting Space Weather with Docker
PDF
Continuous Delivery Pipeline with Docker and Jenkins
PPTX
On sharing ideas & sharing code
PDF
Testing with Docker
PDF
Continuous Delivery to Kubernetes with Jenkins and Helm
PDF
Node.js Rocks in Docker for Dev and Ops
PDF
Exploring Docker in CI/CD
PDF
VM vs Docker-Based Pipelines
PDF
Distributed Docker Pipeline Architecture with CloudBees Jenkins Enterprise
PDF
Continuous Deployment with Jenkins on Kubernetes
PDF
Build & Deploy Multi-Container Applications to AWS
Docker Enables DevOps
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
Managing Docker Containers In A Cluster - Introducing Kubernetes
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
KubeCon EU 2016 Keynote: Kubernetes State of the Union
Devoxx 2015 - Web Application Development using Grails and Docker
JavaOne 2014: Next Step in Automation: Elastic Build Environment
OpenStack Preso: DevOps on Hybrid Infrastructure
Predicting Space Weather with Docker
Continuous Delivery Pipeline with Docker and Jenkins
On sharing ideas & sharing code
Testing with Docker
Continuous Delivery to Kubernetes with Jenkins and Helm
Node.js Rocks in Docker for Dev and Ops
Exploring Docker in CI/CD
VM vs Docker-Based Pipelines
Distributed Docker Pipeline Architecture with CloudBees Jenkins Enterprise
Continuous Deployment with Jenkins on Kubernetes
Build & Deploy Multi-Container Applications to AWS
Ad

Similar to 2016 Docker Palo Alto - CD with ECS and Jenkins (20)

PPTX
Transforming Organizations with CI/CD
PDF
Run Jenkins as Managed Product on ECS - AWS Meetup
PDF
Pipeline: Continuous Delivery as Code in Jenkins 2.0
PDF
7 Habits of Highly Effective Jenkins Users
PDF
Building and Deploying a Static Application using Jenkins and Docker in AWS
PPTX
Jenkins as a Service - Code all the way down
PDF
JUC Europe 2015: Bringing CD at Cloud-Scale with Jenkins, Docker and "Tiger"
PPTX
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
PPTX
Into the cloud
PDF
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
PDF
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
PDF
Running CI/CD with VMWare Cloud PKS and Jenkins X
PPTX
Docker session I: Continuous integration, delivery and deployment
PDF
Journée DevOps : De l'intégration continue au déploiement continu avec Jenkins
PDF
Building a CI/CD Pipeline for PHP apps
PDF
Continuous Integration using Docker & Jenkins
PDF
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
PDF
EC2 Container Service
PPTX
Jenkins days workshop pipelines - Eric Long
PDF
Build in continuous integration, delivery and deploy
Transforming Organizations with CI/CD
Run Jenkins as Managed Product on ECS - AWS Meetup
Pipeline: Continuous Delivery as Code in Jenkins 2.0
7 Habits of Highly Effective Jenkins Users
Building and Deploying a Static Application using Jenkins and Docker in AWS
Jenkins as a Service - Code all the way down
JUC Europe 2015: Bringing CD at Cloud-Scale with Jenkins, Docker and "Tiger"
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Into the cloud
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Running CI/CD with VMWare Cloud PKS and Jenkins X
Docker session I: Continuous integration, delivery and deployment
Journée DevOps : De l'intégration continue au déploiement continu avec Jenkins
Building a CI/CD Pipeline for PHP apps
Continuous Integration using Docker & Jenkins
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
EC2 Container Service
Jenkins days workshop pipelines - Eric Long
Build in continuous integration, delivery and deploy
Ad

Recently uploaded (20)

PDF
Hybrid model detection and classification of lung cancer
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
Architecture types and enterprise applications.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PDF
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
WOOl fibre morphology and structure.pdf for textiles
PPT
What is a Computer? Input Devices /output devices
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PPTX
TLE Review Electricity (Electricity).pptx
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
OMC Textile Division Presentation 2021.pptx
Hybrid model detection and classification of lung cancer
Getting started with AI Agents and Multi-Agent Systems
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
NewMind AI Weekly Chronicles - August'25-Week II
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Architecture types and enterprise applications.pdf
Chapter 5: Probability Theory and Statistics
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
A comparative study of natural language inference in Swahili using monolingua...
WOOl fibre morphology and structure.pdf for textiles
What is a Computer? Input Devices /output devices
O2C Customer Invoices to Receipt V15A.pptx
TLE Review Electricity (Electricity).pptx
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
A novel scalable deep ensemble learning framework for big data classification...
Hindi spoken digit analysis for native and non-native speakers
OMC Textile Division Presentation 2021.pptx

2016 Docker Palo Alto - CD with ECS and Jenkins

  • 1. Continuous Delivery with AWS ECS and Jenkins Tracy Kennedy - 5/12/2016
  • 2. February 23, 2016 Email: tkennedy@cloudbees.com Git|Docker Hub: lavaliere Twitter: @Tracy_Kennedy Who am I?
  • 3. What is continuous delivery? Development Production Commit Build Test Stage Deploy Feedback Loop
  • 5. What is Jenkins? Over 1000 Jenkins Plugins Integration with over 100 DevOps Tools Orchestration of the DevOps Toolchain End-to-End CD Pipeline Management Code & Commit Build & Config Scan & Test Release Deploy
  • 6. What does CloudBees do? What does CloudBees do?
  • 7. What is Amazon Elastic Container Service (ECS)?
  • 8. Using Docker with Jenkins + Jenkins Pipeline TEST STAGE PRODUCTION App <code> (git, etc.) Gold Docker Image (~per app) <OS config> Certified Docker Images (Ubuntu, etc.) <OS config>
  • 10. Jenkins and container management
  • 11. Target deployment environment in ECS ECS Cluster Management Engine Task Task Agent Communication Service ECS Agent
  • 13. Setting up Jenkins in AWS Master spec: T2.medium - 2 vCPU, 4 GB memory Amazon Linux Jenkins 2.1 RPM Tools installed: Git - 2.7.4-1.47.amzn1 Credentials set up: Github - Username with password
  • 14. Plugins Used CloudBees Docker Pipeline Plugin CloudBees Docker Build and Publish Plugin CloudBees AWS CLI Plugin* Pipeline Plugin Docker Plugin Pipeline Stage View Plugin Git Plugin Docker Hub Plugin
  • 15. Setting up Jenkins in AWS Agent spec: AMI ID: ami-07b3b36d T2.medium - 2 vCPU, 4 GB memory Ubuntu Installed tools: Docker - 1.10.3 Ubuntu package Maven - 3.0.5 Ubuntu package Git - 2.7.3 Ubuntu package Java 8 - OpenJDK 1.8.0_72-internal
  • 16. The Jenkinsfile ● Kept in GitHub project’s root directory, Jenkins executes ● Scripts out the target deployment pipeline ● Triggered by pipeline job
  • 17. The Dockerfile ● Kept in GitHub project’s root directory - copied into the Jenkins workspace ● Copies built artifact into a Docker container running Tomcat 8 ● Triggered by pipeline step
  • 18. Target Docker registry - Docker Hub ● Docker pipeline step “withRegistry” specifies target registry for push ● “push” step sends built image to target registry, tagged “docker-demo”
  • 19. Target flow in ECS ● ECS steps run in an agent container (cloudbees/java-build-tools:0.0.7.1) with AWS CLI ○ AWS credentials in Jenkins ○ Wraps AWS-related services ○ Calls ECS agent to trigger task that pulls the newly built app image ○ Checks ECS service status ○ “update-service” = “docker stop” ○ Manually gated deployment
  • 20. Target environments in ECS ● 2 clusters: “production” and “staging” for the webapp ○ Service per cluster ■ Task definitions for pulling the app image ○ EC2 instance per cluster ■ “ECS-optimized” ■ IAM roles
  • 21. Demo time! ECS: https://console.aws.amazon.com/ecs/home?region=us-east-1#/clusters Jenkins: http://52.72.46.249:8080/job/game-pipeline/ Github: https://github.com/lavaliere/game-of-life Docker Hub: https://hub.docker.com/r/lavaliere/game-of-life/ Staging: http://52.200.92.100/
  • 22. Challenges and blockers Usability and troubleshooting Learning curve Autoscaling “Point of no return” configs Silent failures
  • 23. Additional reading Jenkins Pipeline How to point Jenkins to a custom registry (e.g. local) Setting up Jenkins slaves on AWS Game of Life pipeline deployment to ECS AWS’s alternative approach to building a pipeline with Jenkins and ECS Creating an ECS cluster with ELB and autoscaling Building multiple containers with Docker Compose and pipeline Blue-green ECS deployments
  • 24. Jenkins goodies Join our meetup group(s)! Jenkins http://www.meetup.com/San-Francisco-Jenkins-Area-Meetup/ Product management http://www.meetup.com/San-Jose-Product- Management-Meetup/ Upcoming area events Jenkins World - Sept 13-15 in Santa Clara Jenkins 2.0 Webcast - May 17 online JFrog swampUp - May 23 in Napa

Editor's Notes

  • #13: Build a Github-based project : https://github.com/lavaliere/couchbase-javaee Any push to the source code should Build the workspace Run the tests Build Docker image using Dockerfile Deploy it to a Docker registry Kill previously running container Start a new container using this image
  • #17: Build a Github-based project https://github.com/lavaliere/couchbase-javaee/blob/master/Docker-Pipeline.md Any push to the source code should Build the workspace Run the tests Build Docker image using Dockerfile Deploy it to a local Docker registry Kill previously running container Start a new container using this image
  • #18: Build a Github-based project : https://github.com/lavaliere/couchbase-javaee Any push to the source code should Build the workspace Run the tests Build Docker image using Dockerfile Deploy it to a local Docker registry Kill previously running container Start a new container using this image
  • #19: Build a Github-based project : https://github.com/lavaliere/couchbase-javaee Any push to the source code should Build the workspace Run the tests Build Docker image using Dockerfile Deploy it to a local Docker registry Kill previously running container Start a new container using this image
  • #20: Any push to the source code should Build the workspace Run the tests Build Docker image using Dockerfile Deploy it to a local Docker registry Kill previously running container Start a new container using this image
  • #21: Build a Github-based project : https://github.com/lavaliere/couchbase-javaee Any push to the source code should Build the workspace Run the tests Build Docker image using Dockerfile Deploy it to a local Docker registry Kill previously running container Start a new container using this image