SlideShare a Scribd company logo
Jenkins User Conference    New York, May 17 2012   #jenkinsconf


       Best Practices for a Mission-
       Critical Jenkins


                     Mike Rooney
                     Consultant/Jenkins Connoisseur

                           http://linkedin.com/in/mcrooney
Jenkins User Conference    New York, May 17 2012   #jenkinsconf



   Jenkins Uses

     Genius.com
      – staging deployment, code reviews,
        automated branching and merging, monitors
     Canv.as
      – continuous deployment, scoring, monitoring,
        newsletter mailing
     Conductor
      – environment creation, staging / prod
        deployment, selenium monitoring
Jenkins User Conference   New York, May 17 2012   #jenkinsconf


   Hand-check: How critical is your Jenkins?
Jenkins User Conference   New York, May 17 2012   #jenkinsconf



   What problems have you faced?
Jenkins User Conference   New York, May 17 2012   #jenkinsconf



   Problems
     disk failure / data loss
     hardware failure / downtime
     load / latency
Jenkins User Conference    New York, May 17 2012   #jenkinsconf



   Solution
     make Jenkins instance trivial to respin
      – ideally a one-liner that even handles DNS
      – “create.sh jenkins”
Jenkins User Conference      New York, May 17 2012   #jenkinsconf



   Persistence
     $JENKINS_HOME
      – plugins, users, jobs, builds, configuration
Jenkins User Conference    New York, May 17 2012   #jenkinsconf



   Persistence
     git / svn
      – make $JENKINS_HOME a checkout
      – have a Jenkins job that commits daily
      – examples: http://jenkins-
        ci.org/content/keeping-your-configuration-
        and-data-subversion
Jenkins User Conference     New York, May 17 2012   #jenkinsconf



   Persistence
     EBS on AWS
      – put $JENKINS_HOME on an EBS volume
      – snapshot nightly via a Jenkins job
      – trivial to attach to a new host, restore snapshot


     a NAS + RAID / backups works similarly
Jenkins User Conference       New York, May 17 2012   #jenkinsconf



   Environment
     Jenkins is more than $JENKINS_HOME
      –   specific Jenkins .war / .deb / .rpm version
      –   startup options
      –   dependent packages: git, ruby gems, pip
      –   ssh keys, m2 settings
      –   swap, tmpfs, system configuration
Jenkins User Conference       New York, May 17 2012     #jenkinsconf



   Environment
     configuration
     management:Puppet/Chef*




                    * https://wiki.jenkins-ci.org/display/JENKINS/Puppet
Jenkins User Conference   New York, May 17 2012   #jenkinsconf



   Environment
     standalone
      – puppet apply path/to/your/manifest.pp
     puppetmaster
      – set up /etc/puppet.conf, run puppet agent
Jenkins User Conference    New York, May 17 2012   #jenkinsconf



   Putting it Together
     have manifest handle $JENKINS_HOME
      – clone git repo, mount EBS volume, etc
Jenkins User Conference     New York, May 17 2012   #jenkinsconf



   Putting it Together…on AWS
     upload manifests to S3 on check-in
      – a Jenkins SCM job using S3 plugin
     use cloud-init to install puppet, download
     manifests, and run puppet
      – a custom AMI with an rc.local script also works
     when it dies: “create.sh jenkins”
      – ec2-launch-instance config user-data
Jenkins User Conference    New York, May 17 2012   #jenkinsconf



   Monitoring
     … but how do you know when it’s down?
     check out services like Pingdom
      – notifies you when a URL does give HTTP 200 OK
Jenkins User Conference       New York, May 17 2012   #jenkinsconf



   Going further: Elastic Beanstalk
     handles provisioning simply from a .war
     pros
      –   just give it a war
      –   automatically replaces unhealthy instances
      –   behind a load-balancer (consistent URL)
      –   normally hard AWS changes like AMI, Security
          Groups, or Key Pairs are now trivial to make
     cons
      –   behind a load-balancer (cost overhead)
      –   no UI option (yet) for controlling AZ
      –   no great way to pass data to instances for puppet
      –   locked in to Amazon Linux AMI (CentOS)
Jenkins User Conference      New York, May 17 2012   #jenkinsconf



   Going further: Elastic Beanstalk
     set min/max instances to 1
      – ignore scaling triggers, irrelevant in this case
     use beanstalk CLI to set desired AZ (if EBS)
      – https://forums.aws.amazon.com/thread.jspa?t
        hreadID=61409
     puppet
      – use a custom AMI that specifically runs Jenkins
        manifests
      – but this requires a specific AMI for each
        Beanstalk application.
      – let’s get creative…
Jenkins User Conference   New York, May 17 2012   #jenkinsconf



   Going further: Elastic Beanstalk
     passing data to instances




     PARAM1..5 meant as args to .war
     end up in /etc/sysconfig/tomcat7
     JAVA_OPTS
     parse out and:
      – puppet apply –certname=$PARSED_ROLE
Jenkins User Conference   New York, May 17 2012   #jenkinsconf



   Questions?
Jenkins User Conference    New York, May 17 2012   #jenkinsconf



   High Availability Artifacts
     protect: artifacts, reports, userContent
     from:
      – planned downtime:
        Jenkins restarts/upgrades, server upgrades
      – unplanned downtime:
        software/hardware failure
      – unresponsive Jenkins:
        very high load
Jenkins User Conference       New York, May 17 2012   #jenkinsconf



   High(er) Availability Artifacts
     easy mode:
      – put Jenkins behind nginx/apache, shadow
        userContent and relevant directories
      – still available during Jenkins restarts, or very
        high Jenkins load/latency
      – not safe from server downtime
Jenkins User Conference          New York, May 17 2012   #jenkinsconf



     High Availability Artifacts
        advanced mode: S3
        – 99.99% availability, 99.999999999% durability*
            • if you store 10K objects, expect to lose one every 10
              million years
        – use Jenkins S3 plugin to upload artifacts to S3




* http://aws.amazon.com/s3/faqs
Jenkins User Conference     New York, May 17 2012   #jenkinsconf



   Fault-tolerant Jobs
     design with possible downtime in mind
      – SCM triggering is great, but keep polling too
Jenkins User Conference   New York, May 17 2012   #jenkinsconf



   Fault-tolerant Jobs
     */15 * * * *
      – BAD:
          update users where join_time < 15m ago
      – GOOD:
          update users where id > last_id_updated
Jenkins User Conference     New York, May 17 2012   #jenkinsconf



   Error handling
     for non-critical jobs, use email / IM post-
     build notifiers
      – but be careful of creating too much noise,
        people will ignore or filter it out
     for critical jobs, integrate Jenkins with a
     service like PagerDuty
      – Jenkins emails myalert@pagerduty.com
      – PagerDuty texts / calls the people on-call until
        resolved
      – a failing build will wake you up at 4AM
Jenkins User Conference   New York, May 17 2012   #jenkinsconf



   Questions?
Jenkins User Conference   New York, May 17 2012   #jenkinsconf



   Security: Authentication
     read-only
     matrix-based
     HTTP basic auth
Jenkins User Conference   New York, May 17 2012   #jenkinsconf



   Security: Authentication
     but what about traffic sniffing?
Jenkins User Conference      New York, May 17 2012   #jenkinsconf



   Security: HTTPS
     throw nginx/apache in front of Jenkins
      – proxy mode
      – ssl (self-signed or just buy one)
Jenkins User Conference     New York, May 17 2012   #jenkinsconf



   Security: Authorization
     use project-based matrix authentication
     give anonymous/authenticated readonly
     use it if you’ve got it:
     LDAP, Active Directory, UNIX
     Jenkin’s own database also works fine
     ensure each user has their own account
      – each build will have an audit trail
Jenkins User Conference   New York, May 17 2012   #jenkinsconf



   Security: Authorization (AWS)
     when interfacing with AWS API/CLI, use
     IAM so Jenkins can only access what it
     needs
Jenkins User Conference   New York, May 17 2012   #jenkinsconf



   Questions?
Jenkins User Conference   New York, May 17 2012   #jenkinsconf



   Thank You To Our Sponsors
   Platinum
   Sponsor


   Gold
   Sponsors



   Silver
   Sponsors




   Bronze
   Sponsors

More Related Content

PPT
Jenkins Overview
Ahmed M. Gomaa
 
PDF
Securing jenkins
CloudBees
 
ODP
7 Habits of Highly Effective Jenkins Users
Andrew Bayer
 
PDF
Who *is* Jenkins?
Andrew Bayer
 
PDF
Let’s start Continuous Integration with jenkins
Tomohide Kakeya
 
PPTX
Jenkins for java world
Ashok Kumar
 
PPTX
Jenkins CI
Viyaan Jhiingade
 
PPT
Continuous Integration (Jenkins/Hudson)
Dennys Hsieh
 
Jenkins Overview
Ahmed M. Gomaa
 
Securing jenkins
CloudBees
 
7 Habits of Highly Effective Jenkins Users
Andrew Bayer
 
Who *is* Jenkins?
Andrew Bayer
 
Let’s start Continuous Integration with jenkins
Tomohide Kakeya
 
Jenkins for java world
Ashok Kumar
 
Jenkins CI
Viyaan Jhiingade
 
Continuous Integration (Jenkins/Hudson)
Dennys Hsieh
 

What's hot (20)

PPTX
Introduction to Continuous Integration with Jenkins
Brice Argenson
 
PPTX
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Andrew Bayer
 
PDF
Jenkins tutorial
HarikaReddy115
 
PPTX
Jenkins tutorial
Mamun Rashid, CCDH
 
PPTX
Jenkins CI presentation
Jonathan Holloway
 
PPTX
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-Code
Brian Dawson
 
PDF
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Troublemaker Khunpech
 
PDF
Jenkins-CI
Gong Haibing
 
PDF
OSDC 2017 - Julien Pivotto - Automating Jenkins
NETWAYS
 
PDF
Using Docker for Testing
Carlos Sanchez
 
PPTX
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Bamdad Dashtban
 
PPTX
Jenkins Introduction
Pavan Gupta
 
PDF
Yale Jenkins Show and Tell
E. Camden Fisher
 
ODP
An Introduction To Jenkins
Knoldus Inc.
 
PPTX
Large scale automation with jenkins
Kohsuke Kawaguchi
 
PDF
Hacking Jenkins
Miro Cupak
 
PDF
Continuous Integration/Deployment with Docker and Jenkins
Francesco Bruni
 
PDF
Jenkins
Roger Xia
 
PDF
How Nuxeo uses the open-source continuous integration server Jenkins
Nuxeo
 
PPT
Jenkins CI
Knoldus Inc.
 
Introduction to Continuous Integration with Jenkins
Brice Argenson
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Andrew Bayer
 
Jenkins tutorial
HarikaReddy115
 
Jenkins tutorial
Mamun Rashid, CCDH
 
Jenkins CI presentation
Jonathan Holloway
 
SD DevOps Meet-up - Jenkins 2.0 and Pipeline-as-Code
Brian Dawson
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Troublemaker Khunpech
 
Jenkins-CI
Gong Haibing
 
OSDC 2017 - Julien Pivotto - Automating Jenkins
NETWAYS
 
Using Docker for Testing
Carlos Sanchez
 
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Bamdad Dashtban
 
Jenkins Introduction
Pavan Gupta
 
Yale Jenkins Show and Tell
E. Camden Fisher
 
An Introduction To Jenkins
Knoldus Inc.
 
Large scale automation with jenkins
Kohsuke Kawaguchi
 
Hacking Jenkins
Miro Cupak
 
Continuous Integration/Deployment with Docker and Jenkins
Francesco Bruni
 
Jenkins
Roger Xia
 
How Nuxeo uses the open-source continuous integration server Jenkins
Nuxeo
 
Jenkins CI
Knoldus Inc.
 
Ad

Viewers also liked (20)

PPTX
Jenkins project based authorization
Paul Blundell
 
PDF
Continuous Delivery Pipeline - Patterns and Anti-patterns
Sonatype
 
PPTX
Continous Integration and Deployment
Károly Nagy
 
ODP
Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Ohad Basan
 
PDF
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
CloudBees
 
PDF
Jenkins Best Practices
Gergely Brautigam
 
PDF
Implementing High Availability Caching with Memcached
Gear6
 
PPTX
神戸大学講演
Mf Takatsuka
 
PDF
Demystifying the Recruiting Funnel
Human Capital Media
 
PPT
Junin así te vemos
bicifanatica
 
PPT
Please join in if you know the song
haywardsprimary
 
PPSX
The wall (v.m.) 2
Valeriu Margescu
 
PDF
Christine Davies - Joe Public
christine strydom
 
PPTX
Moises zapata hi_bernardo
RedvolucionCesarNorte
 
PDF
MusicTT IP Valuation - Conducting the Audit
TrinidadandTobagoCreativeIndustries
 
PPSX
Nuevas Tecnologías - Contexto
Paula Gentile
 
PPTX
Accelerating the Recruiting Funnel
Human Capital Media
 
PDF
LinkedIn_2
thehub_smma
 
PPTX
The New Admissions Funnel
Joe Szejk
 
PDF
Curation by Question
경만 고
 
Jenkins project based authorization
Paul Blundell
 
Continuous Delivery Pipeline - Patterns and Anti-patterns
Sonatype
 
Continous Integration and Deployment
Károly Nagy
 
Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Ohad Basan
 
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
CloudBees
 
Jenkins Best Practices
Gergely Brautigam
 
Implementing High Availability Caching with Memcached
Gear6
 
神戸大学講演
Mf Takatsuka
 
Demystifying the Recruiting Funnel
Human Capital Media
 
Junin así te vemos
bicifanatica
 
Please join in if you know the song
haywardsprimary
 
The wall (v.m.) 2
Valeriu Margescu
 
Christine Davies - Joe Public
christine strydom
 
Moises zapata hi_bernardo
RedvolucionCesarNorte
 
MusicTT IP Valuation - Conducting the Audit
TrinidadandTobagoCreativeIndustries
 
Nuevas Tecnologías - Contexto
Paula Gentile
 
Accelerating the Recruiting Funnel
Human Capital Media
 
LinkedIn_2
thehub_smma
 
The New Admissions Funnel
Joe Szejk
 
Curation by Question
경만 고
 
Ad

Similar to Best Practices for Mission-Critical Jenkins (20)

PDF
JUC NY - Advanced Continuous Deployment with Jenkins
XebiaLabs
 
PDF
The challenge - testing the oVirt project
Eyal Edri
 
PDF
JUC NYC 2012: Yale Build and Deployment with Jenkins
E. Camden Fisher
 
PPTX
Jenkins User Conference 2013: Literate, multi-branch, mobile and more
Kohsuke Kawaguchi
 
PDF
Jenkins data mining on the command line - Jenkins User Conference NYC 2012
Noah Sussman
 
PPTX
Jenkins User Conference 2012 San Francisco
Kohsuke Kawaguchi
 
PPTX
Jenkins user conference 2011
Kohsuke Kawaguchi
 
PDF
Juc boston2014.pptx
Brandon Mueller
 
PDF
Jenkins User Conference 2014
Dan Cundiff
 
PPTX
Jenkins User Conference 2013 Palo Alto: Keynote
Kohsuke Kawaguchi
 
PDF
Graduating to Jenkins CI for Ruby(-on-Rails) Teams
Daniel Doubrovkine
 
PPTX
Jenkins 1
Elad Hirsch
 
PPTX
How to train your Jenkins?
Manivannan Selvaraj
 
PDF
From Virtual Machines to Containers
camunda services GmbH
 
PDF
JUC Europe 2015: From Virtual Machines to Containers: Achieving Continuous In...
CloudBees
 
PPTX
Running productioninstance 1-localcopy
CloudBees
 
PDF
Jenkins CI
haochenglee
 
PPTX
Jenkins workflows and Best Practices
Kenichi Shibata
 
PPTX
Beyond Continuous Delivery - Jenkins User Conference - 23 Oct 2014
Chris Hilton
 
PDF
DevOps World | Jenkins World 2018 and The Future of Jenkins
Nigel Charman
 
JUC NY - Advanced Continuous Deployment with Jenkins
XebiaLabs
 
The challenge - testing the oVirt project
Eyal Edri
 
JUC NYC 2012: Yale Build and Deployment with Jenkins
E. Camden Fisher
 
Jenkins User Conference 2013: Literate, multi-branch, mobile and more
Kohsuke Kawaguchi
 
Jenkins data mining on the command line - Jenkins User Conference NYC 2012
Noah Sussman
 
Jenkins User Conference 2012 San Francisco
Kohsuke Kawaguchi
 
Jenkins user conference 2011
Kohsuke Kawaguchi
 
Juc boston2014.pptx
Brandon Mueller
 
Jenkins User Conference 2014
Dan Cundiff
 
Jenkins User Conference 2013 Palo Alto: Keynote
Kohsuke Kawaguchi
 
Graduating to Jenkins CI for Ruby(-on-Rails) Teams
Daniel Doubrovkine
 
Jenkins 1
Elad Hirsch
 
How to train your Jenkins?
Manivannan Selvaraj
 
From Virtual Machines to Containers
camunda services GmbH
 
JUC Europe 2015: From Virtual Machines to Containers: Achieving Continuous In...
CloudBees
 
Running productioninstance 1-localcopy
CloudBees
 
Jenkins CI
haochenglee
 
Jenkins workflows and Best Practices
Kenichi Shibata
 
Beyond Continuous Delivery - Jenkins User Conference - 23 Oct 2014
Chris Hilton
 
DevOps World | Jenkins World 2018 and The Future of Jenkins
Nigel Charman
 

Recently uploaded (20)

PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Software Development Methodologies in 2025
KodekX
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 

Best Practices for Mission-Critical Jenkins

  • 1. Jenkins User Conference New York, May 17 2012 #jenkinsconf Best Practices for a Mission- Critical Jenkins Mike Rooney Consultant/Jenkins Connoisseur http://linkedin.com/in/mcrooney
  • 2. Jenkins User Conference New York, May 17 2012 #jenkinsconf Jenkins Uses Genius.com – staging deployment, code reviews, automated branching and merging, monitors Canv.as – continuous deployment, scoring, monitoring, newsletter mailing Conductor – environment creation, staging / prod deployment, selenium monitoring
  • 3. Jenkins User Conference New York, May 17 2012 #jenkinsconf Hand-check: How critical is your Jenkins?
  • 4. Jenkins User Conference New York, May 17 2012 #jenkinsconf What problems have you faced?
  • 5. Jenkins User Conference New York, May 17 2012 #jenkinsconf Problems disk failure / data loss hardware failure / downtime load / latency
  • 6. Jenkins User Conference New York, May 17 2012 #jenkinsconf Solution make Jenkins instance trivial to respin – ideally a one-liner that even handles DNS – “create.sh jenkins”
  • 7. Jenkins User Conference New York, May 17 2012 #jenkinsconf Persistence $JENKINS_HOME – plugins, users, jobs, builds, configuration
  • 8. Jenkins User Conference New York, May 17 2012 #jenkinsconf Persistence git / svn – make $JENKINS_HOME a checkout – have a Jenkins job that commits daily – examples: http://jenkins- ci.org/content/keeping-your-configuration- and-data-subversion
  • 9. Jenkins User Conference New York, May 17 2012 #jenkinsconf Persistence EBS on AWS – put $JENKINS_HOME on an EBS volume – snapshot nightly via a Jenkins job – trivial to attach to a new host, restore snapshot a NAS + RAID / backups works similarly
  • 10. Jenkins User Conference New York, May 17 2012 #jenkinsconf Environment Jenkins is more than $JENKINS_HOME – specific Jenkins .war / .deb / .rpm version – startup options – dependent packages: git, ruby gems, pip – ssh keys, m2 settings – swap, tmpfs, system configuration
  • 11. Jenkins User Conference New York, May 17 2012 #jenkinsconf Environment configuration management:Puppet/Chef* * https://wiki.jenkins-ci.org/display/JENKINS/Puppet
  • 12. Jenkins User Conference New York, May 17 2012 #jenkinsconf Environment standalone – puppet apply path/to/your/manifest.pp puppetmaster – set up /etc/puppet.conf, run puppet agent
  • 13. Jenkins User Conference New York, May 17 2012 #jenkinsconf Putting it Together have manifest handle $JENKINS_HOME – clone git repo, mount EBS volume, etc
  • 14. Jenkins User Conference New York, May 17 2012 #jenkinsconf Putting it Together…on AWS upload manifests to S3 on check-in – a Jenkins SCM job using S3 plugin use cloud-init to install puppet, download manifests, and run puppet – a custom AMI with an rc.local script also works when it dies: “create.sh jenkins” – ec2-launch-instance config user-data
  • 15. Jenkins User Conference New York, May 17 2012 #jenkinsconf Monitoring … but how do you know when it’s down? check out services like Pingdom – notifies you when a URL does give HTTP 200 OK
  • 16. Jenkins User Conference New York, May 17 2012 #jenkinsconf Going further: Elastic Beanstalk handles provisioning simply from a .war pros – just give it a war – automatically replaces unhealthy instances – behind a load-balancer (consistent URL) – normally hard AWS changes like AMI, Security Groups, or Key Pairs are now trivial to make cons – behind a load-balancer (cost overhead) – no UI option (yet) for controlling AZ – no great way to pass data to instances for puppet – locked in to Amazon Linux AMI (CentOS)
  • 17. Jenkins User Conference New York, May 17 2012 #jenkinsconf Going further: Elastic Beanstalk set min/max instances to 1 – ignore scaling triggers, irrelevant in this case use beanstalk CLI to set desired AZ (if EBS) – https://forums.aws.amazon.com/thread.jspa?t hreadID=61409 puppet – use a custom AMI that specifically runs Jenkins manifests – but this requires a specific AMI for each Beanstalk application. – let’s get creative…
  • 18. Jenkins User Conference New York, May 17 2012 #jenkinsconf Going further: Elastic Beanstalk passing data to instances PARAM1..5 meant as args to .war end up in /etc/sysconfig/tomcat7 JAVA_OPTS parse out and: – puppet apply –certname=$PARSED_ROLE
  • 19. Jenkins User Conference New York, May 17 2012 #jenkinsconf Questions?
  • 20. Jenkins User Conference New York, May 17 2012 #jenkinsconf High Availability Artifacts protect: artifacts, reports, userContent from: – planned downtime: Jenkins restarts/upgrades, server upgrades – unplanned downtime: software/hardware failure – unresponsive Jenkins: very high load
  • 21. Jenkins User Conference New York, May 17 2012 #jenkinsconf High(er) Availability Artifacts easy mode: – put Jenkins behind nginx/apache, shadow userContent and relevant directories – still available during Jenkins restarts, or very high Jenkins load/latency – not safe from server downtime
  • 22. Jenkins User Conference New York, May 17 2012 #jenkinsconf High Availability Artifacts advanced mode: S3 – 99.99% availability, 99.999999999% durability* • if you store 10K objects, expect to lose one every 10 million years – use Jenkins S3 plugin to upload artifacts to S3 * http://aws.amazon.com/s3/faqs
  • 23. Jenkins User Conference New York, May 17 2012 #jenkinsconf Fault-tolerant Jobs design with possible downtime in mind – SCM triggering is great, but keep polling too
  • 24. Jenkins User Conference New York, May 17 2012 #jenkinsconf Fault-tolerant Jobs */15 * * * * – BAD: update users where join_time < 15m ago – GOOD: update users where id > last_id_updated
  • 25. Jenkins User Conference New York, May 17 2012 #jenkinsconf Error handling for non-critical jobs, use email / IM post- build notifiers – but be careful of creating too much noise, people will ignore or filter it out for critical jobs, integrate Jenkins with a service like PagerDuty – Jenkins emails [email protected] – PagerDuty texts / calls the people on-call until resolved – a failing build will wake you up at 4AM
  • 26. Jenkins User Conference New York, May 17 2012 #jenkinsconf Questions?
  • 27. Jenkins User Conference New York, May 17 2012 #jenkinsconf Security: Authentication read-only matrix-based HTTP basic auth
  • 28. Jenkins User Conference New York, May 17 2012 #jenkinsconf Security: Authentication but what about traffic sniffing?
  • 29. Jenkins User Conference New York, May 17 2012 #jenkinsconf Security: HTTPS throw nginx/apache in front of Jenkins – proxy mode – ssl (self-signed or just buy one)
  • 30. Jenkins User Conference New York, May 17 2012 #jenkinsconf Security: Authorization use project-based matrix authentication give anonymous/authenticated readonly use it if you’ve got it: LDAP, Active Directory, UNIX Jenkin’s own database also works fine ensure each user has their own account – each build will have an audit trail
  • 31. Jenkins User Conference New York, May 17 2012 #jenkinsconf Security: Authorization (AWS) when interfacing with AWS API/CLI, use IAM so Jenkins can only access what it needs
  • 32. Jenkins User Conference New York, May 17 2012 #jenkinsconf Questions?
  • 33. Jenkins User Conference New York, May 17 2012 #jenkinsconf Thank You To Our Sponsors Platinum Sponsor Gold Sponsors Silver Sponsors Bronze Sponsors