SlideShare a Scribd company logo
1 of 53
Codifying the Build and Release Process with a
Jenkins Pipeline Shared Library
Alvin Huang
Codifying the Build and Release
Process with a Jenkins Pipeline
Shared Library
Alvin Huang
DevOps Engineer, FireEye
Who Am I
• DevOps Engineer, GSI @ FireEye
• Twitter: @RealAlvinHuang, IRC: ahuang
• alvin.huang@fireeye.com
Agenda
• Overview of GSI
• The Great Migration
• Why Pipeline?
• Why Docker?
• Shared Library Examples
• How we did this
• Lessons Learned
• Benefits for the Future
Overview of GSI
• Unified global organization combining Mandiant, FireEye
iSIGHT Intelligence, and FireEye as a Service operations
• DevOps Goal: Make the feedback loop between
intelligence on the front lines to capabilities in software,
smaller
What We Build
How We Build
Code TestBuild Deliver Deploy
The Great Migration
Scenario
• Consolidate datacenters
• Migrate Jenkins off a shared instance
• ~60 days
• ~150 Freestyle jobs
• ~20 different build agents
• Upgrade from 1.x to 2.x
Legacy Jenkins Jobs
• Jenkins primarily used to run tests and build RPMs
• SCP to publish RPMs to yum server
• Ad-hoc Github triggers
• No owner/SME for Jenkins
Goals
• Standardize and make consistent CI pipelines
• Jenkins SME = DevOps team
• Make new app onboarding easy
– Build abstraction that covers ~90% of jobs
• Jenkins jobs tracked in git
• Decouple tools from Jenkins/shell => Docker
Migration Strategies
Migration Strategy LOE Advantages Disadvantages
Copy XMLs from old
server to new server
Minimal - Easy, no extra work - Tech debt
- Global changes are hard
- Job config not in SCM
Create Freestyle
Jenkins job templates
Moderate - Global changes are easier
- Hide much of the configuration from
end users
- Make Freestyle jobs DRY
- Tech debt
- Debugging a job is hard
- Job config not in SCM
- Global changes can break all builds
Convert Freestyle jobs
to Pipeline jobs
Significant - Job configuration in SCM - Learn pipeline syntax
- Large job footprint
- Global changes are hard
- Too complex for many users
- Subject to repetition and tech
debt
Create a Jenkins Shared
Library for Pipeline jobs
Moderate - Jobs in SCM
- Standardized and consistent
- Easy on-boarding, just needs parameters
- Job configuration hidden from user
- Learn pipeline syntax
- Need owner for library
- Global changes can break all builds
Why Pipeline and Shared Libraries?
Problem Solution
Overhead with Freestyle Jobs
Jobs were not DRY
Solution: Build Wrapper
Solution: Use Github Organizations
• Index every branch of every repo that has a Jenkinsfile
• Configure one Github hook on the organization level
Why Pipeline and Shared Libraries?
Problem Solution
Overhead with Freestyle jobs Use a pipeline library wrapper;
Github Organizations
Jobs were not DRY Use a pipeline library wrapper
Why Pipeline and Shared Libraries?
Problem Solution
Overhead with Freestyle jobs Use a pipeline library wrapper;
Github Organizations
Jobs were not DRY Use a pipeline library wrapper
Job configuration drift
Why Pipeline and Shared Libraries?
Problem Solution
Overhead with Freestyle jobs Use a pipeline library wrapper;
Github Organizations
Jobs were not DRY Use a pipeline library wrapper
Job configuration drift Jenkinsfiles in SCM
Why Pipeline and Shared Libraries?
Problem Solution
Overhead with Freestyle jobs Use a pipeline library wrapper;
Github Organizations
Jobs were not DRY Use a pipeline library wrapper
Job configuration drift Jenkinsfiles in SCM
Difficult to view job configurations
and build steps
Solution
Why Pipeline and Shared Libraries?
Problem Solution
Overhead with Freestyle jobs Use a pipeline library wrapper;
Github Organizations
Jobs were not DRY Use a pipeline library wrapper
Job configuration drift Jenkinsfiles in SCM
Difficult to view job configurations
and build steps
Jenkinsfiles + Stage View
Why Pipeline and Shared Libraries?
Problem Solution
Overhead with Freestyle jobs Use a pipeline library wrapper;
Github Organizations
Jobs were not DRY Use a pipeline library wrapper
Job configuration drift Jenkinsfiles in SCM
Difficult to view job configurations
and build steps
Jenkinsfiles + Stage View
Very difficult to make global
changes
Solution
yourBuildWrapper.groovy
Why Pipeline and Shared Libraries?
Problem Solution
Overhead with Freestyle jobs Use a pipeline library wrapper;
Github Organizations
Jobs were not DRY Use a pipeline library wrapper
Job configuration drift Jenkinsfiles in SCM
Difficult to view job configurations
and build steps
Jenkinsfiles + Stage View
Very difficult to make global
changes
*Library changes have an effect on
all builds
Why Pipeline and Shared Libraries?
Problem Solution
Overhead with Freestyle jobs Use a pipeline library wrapper;
Github Organizations
Jobs were not DRY Use a pipeline library wrapper
Job configuration drift Jenkinsfiles in SCM
Difficult to view job configurations
and build steps
Jenkinsfiles + Stage View
Very difficult to make global
changes
*Library changes have an effect on
all builds
Monolithic build servers
Migrating Monolithic Build Agents
• No configuration management
• What packages and versions were installed?
• Who runs on what agent?
• Changes on a node may affect another team sharing that
same agent
Solution to Monolithic Build Agents
Sample Dockerfile
Why Pipeline and Shared Libraries?
Problem Solution
Overhead with Freestyle jobs Use a pipeline library wrapper;
Github Organizations
Jobs were not DRY Use a pipeline library wrapper
Job configuration drift Jenkinsfiles in SCM
Difficult to view job configurations
and build steps
Jenkinsfiles + Stage View
Very difficult to make global
changes
*Library changes have an effect on
all builds
Monolithic build servers Use Docker
What about…
• Jenkins Job Builder
– Simple jobs defined by relatively complex YAML
– Verbose
– Needs abstraction for novice users
• Job DSL Plugin
– Programmatically seeds/creates Jenkins jobs
– Jenkins Pipeline + Github Organizations can be used instead
– No logic between jobs (ie: no Pipeline ‘input’ step)
Starting Point
• New Jenkins 2.x instance
• Stable build nodes built with Puppet
– CentOS 6/7 hosts
• Working Docker integration
Before Pipeline
Phase 1 (Pre-migration)
Phase 2 (Pre-migration)
Visualization
The NEW World
Inspiration
• https://github.com/jenkinsci/simple-build-for-pipeline-
plugin -michaelneale
• Build a wrapper called simpleBuild that takes in
parameters as a closure and runs logic
Jenkins Pipeline Workflow
Example Jenkinsfile
Example Dockerfile
Resulting Pipeline
Demo
How do we do this?
• Find a *passionate* liaison from each team
• Learn their workflow
– There’s probably a freestyle job already
• Start pipelining their workflow in modular pieces:
– Checkout code
– Run build script
– Archive artifacts
– Publish to Artifactory
– Promote artifact
– Send email
• Build a wrapper to call those functions
• Repeat for another team/app, reusing what you just made
Reap the Benefits
• Give Devs/QA their time back
• Standardization of jobs and workflows
• Standardization of build and test environments
• Jenkins maintenance and resilience made easy by
decoupling tools
Lessons Learned
Use Github Organizations
• Index every branch of every repo that has a Jenkinsfile
• Configure one Github hook on the organization level
Make Steps Modular
• What does this step do?
– Does A ‘AND’ B; break it apart
• Namespace them
Leverage the Snippet Generator
Benefits of Shared Libraries For Our Future
• Migration of Github
• Upgrade to Puppet 5
• Consolidation of Artifactory
• Application stacks in Openshift
• Deployments through Rundeck, Ansible or Fabric
• Scripts in ‘vars’ can be called in Declarative Pipeline
Upgrade to Puppet 5
Dockerfile Jenkinsfile
Go Forth and Pipeline!
Thanks!
• alvin.huang@fireeye.com | @RealAlvinHuang | ahuang
Codifying the Build and Release Process with a Jenkins Pipeline Shared Library

More Related Content

What's hot

An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersKostas Saidis
 
CI-Jenkins.pptx
CI-Jenkins.pptxCI-Jenkins.pptx
CI-Jenkins.pptxMEDOBEST1
 
Hashicorp-Certified-Terraform-Associate-v3-edited.pptx
Hashicorp-Certified-Terraform-Associate-v3-edited.pptxHashicorp-Certified-Terraform-Associate-v3-edited.pptx
Hashicorp-Certified-Terraform-Associate-v3-edited.pptxssuser0d6c88
 
[AWS Community Day 2021] AWS와 함께하는 무중단 배포 파이프라인 개선기
[AWS Community Day 2021] AWS와 함께하는 무중단 배포 파이프라인 개선기[AWS Community Day 2021] AWS와 함께하는 무중단 배포 파이프라인 개선기
[AWS Community Day 2021] AWS와 함께하는 무중단 배포 파이프라인 개선기SungChanHwang
 
Learning Docker from Square One
Learning Docker from Square OneLearning Docker from Square One
Learning Docker from Square OneDocker, Inc.
 
Dependency injection in Java, from naive to functional
Dependency injection in Java, from naive to functionalDependency injection in Java, from naive to functional
Dependency injection in Java, from naive to functionalMarian Wamsiedel
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with MavenSid Anand
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to MavenVadym Lotar
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introductionejlp12
 
5 Best Practices DevOps Culture
5 Best Practices DevOps Culture5 Best Practices DevOps Culture
5 Best Practices DevOps CultureEdureka!
 
Terraform GitOps on Codefresh
Terraform GitOps on CodefreshTerraform GitOps on Codefresh
Terraform GitOps on CodefreshCodefresh
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins worldBrent Laster
 
API Asynchrones en Java 8
API Asynchrones en Java 8API Asynchrones en Java 8
API Asynchrones en Java 8José Paumard
 
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...Edureka!
 
Docker Basic to Advance
Docker Basic to AdvanceDocker Basic to Advance
Docker Basic to AdvanceParas Jain
 
Default GitLab CI Pipeline - Auto DevOps
Default GitLab CI Pipeline - Auto DevOpsDefault GitLab CI Pipeline - Auto DevOps
Default GitLab CI Pipeline - Auto DevOpsRajith Bhanuka Mahanama
 

What's hot (20)

An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
 
DevOps explained
DevOps explainedDevOps explained
DevOps explained
 
Gitlab CI/CD
Gitlab CI/CDGitlab CI/CD
Gitlab CI/CD
 
CI-Jenkins.pptx
CI-Jenkins.pptxCI-Jenkins.pptx
CI-Jenkins.pptx
 
Hashicorp-Certified-Terraform-Associate-v3-edited.pptx
Hashicorp-Certified-Terraform-Associate-v3-edited.pptxHashicorp-Certified-Terraform-Associate-v3-edited.pptx
Hashicorp-Certified-Terraform-Associate-v3-edited.pptx
 
[AWS Community Day 2021] AWS와 함께하는 무중단 배포 파이프라인 개선기
[AWS Community Day 2021] AWS와 함께하는 무중단 배포 파이프라인 개선기[AWS Community Day 2021] AWS와 함께하는 무중단 배포 파이프라인 개선기
[AWS Community Day 2021] AWS와 함께하는 무중단 배포 파이프라인 개선기
 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
 
Learning Docker from Square One
Learning Docker from Square OneLearning Docker from Square One
Learning Docker from Square One
 
Dependency injection in Java, from naive to functional
Dependency injection in Java, from naive to functionalDependency injection in Java, from naive to functional
Dependency injection in Java, from naive to functional
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introduction
 
5 Best Practices DevOps Culture
5 Best Practices DevOps Culture5 Best Practices DevOps Culture
5 Best Practices DevOps Culture
 
Terraform GitOps on Codefresh
Terraform GitOps on CodefreshTerraform GitOps on Codefresh
Terraform GitOps on Codefresh
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins world
 
API Asynchrones en Java 8
API Asynchrones en Java 8API Asynchrones en Java 8
API Asynchrones en Java 8
 
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
 
Docker Basic to Advance
Docker Basic to AdvanceDocker Basic to Advance
Docker Basic to Advance
 
Default GitLab CI Pipeline - Auto DevOps
Default GitLab CI Pipeline - Auto DevOpsDefault GitLab CI Pipeline - Auto DevOps
Default GitLab CI Pipeline - Auto DevOps
 

Similar to Codifying the Build and Release Process with a Jenkins Pipeline Shared Library

DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...Simplilearn
 
Next generation pipelines
Next generation pipelinesNext generation pipelines
Next generation pipelinesAlex Landa
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Andrew Bayer
 
Pipeline 101 Lorelei Mccollum
Pipeline 101 Lorelei MccollumPipeline 101 Lorelei Mccollum
Pipeline 101 Lorelei MccollumLorelei McCollum
 
Continuous delivery with jenkins pipelines @ devdays
Continuous delivery with jenkins pipelines  @ devdaysContinuous delivery with jenkins pipelines  @ devdays
Continuous delivery with jenkins pipelines @ devdaysRoman Pickl
 
Continuous Deployment to the cloud
Continuous Deployment to the cloudContinuous Deployment to the cloud
Continuous Deployment to the cloudVMware Tanzu
 
Continuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOneContinuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOneciberkleid
 
Make It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version ControlMake It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version Controlindiver
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworksKirk Madera
 
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesAn Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesSteffen Gebert
 
Configuration As Code: The Job DSL Plugin
Configuration As Code: The Job DSL PluginConfiguration As Code: The Job DSL Plugin
Configuration As Code: The Job DSL PluginDaniel Spilker
 
CIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops betterCIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops betterAndrii Podanenko
 
Docs at Weaveworks: DX from open source to SaaS and beyond
Docs at Weaveworks: DX from open source to SaaS and beyondDocs at Weaveworks: DX from open source to SaaS and beyond
Docs at Weaveworks: DX from open source to SaaS and beyondLuke Marsden
 
CI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure DatabricksCI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure DatabricksGoDataDriven
 
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
 
Introduction to Git for Network Engineers
Introduction to Git for Network EngineersIntroduction to Git for Network Engineers
Introduction to Git for Network EngineersJoel W. King
 

Similar to Codifying the Build and Release Process with a Jenkins Pipeline Shared Library (20)

DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
 
Juc boston2014.pptx
Juc boston2014.pptxJuc boston2014.pptx
Juc boston2014.pptx
 
Next generation pipelines
Next generation pipelinesNext generation pipelines
Next generation pipelines
 
Jenkins as a Service
Jenkins as a ServiceJenkins as a Service
Jenkins as a Service
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
 
Pipeline 101 Lorelei Mccollum
Pipeline 101 Lorelei MccollumPipeline 101 Lorelei Mccollum
Pipeline 101 Lorelei Mccollum
 
Basic Jenkins Guide.pptx
Basic Jenkins Guide.pptxBasic Jenkins Guide.pptx
Basic Jenkins Guide.pptx
 
Continuous delivery with jenkins pipelines @ devdays
Continuous delivery with jenkins pipelines  @ devdaysContinuous delivery with jenkins pipelines  @ devdays
Continuous delivery with jenkins pipelines @ devdays
 
Continuous Deployment to the cloud
Continuous Deployment to the cloudContinuous Deployment to the cloud
Continuous Deployment to the cloud
 
Continuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOneContinuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOne
 
Make It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version ControlMake It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version Control
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworks
 
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesAn Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
 
GitLab - Java User Group
GitLab - Java User GroupGitLab - Java User Group
GitLab - Java User Group
 
Configuration As Code: The Job DSL Plugin
Configuration As Code: The Job DSL PluginConfiguration As Code: The Job DSL Plugin
Configuration As Code: The Job DSL Plugin
 
CIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops betterCIbox - OpenSource solution for making your #devops better
CIbox - OpenSource solution for making your #devops better
 
Docs at Weaveworks: DX from open source to SaaS and beyond
Docs at Weaveworks: DX from open source to SaaS and beyondDocs at Weaveworks: DX from open source to SaaS and beyond
Docs at Weaveworks: DX from open source to SaaS and beyond
 
CI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure DatabricksCI/CD with Azure DevOps and Azure Databricks
CI/CD with Azure DevOps and Azure Databricks
 
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 ...
 
Introduction to Git for Network Engineers
Introduction to Git for Network EngineersIntroduction to Git for Network Engineers
Introduction to Git for Network Engineers
 

Recently uploaded

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 

Recently uploaded (20)

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

Codifying the Build and Release Process with a Jenkins Pipeline Shared Library

  • 1. Codifying the Build and Release Process with a Jenkins Pipeline Shared Library Alvin Huang
  • 2. Codifying the Build and Release Process with a Jenkins Pipeline Shared Library Alvin Huang DevOps Engineer, FireEye
  • 3. Who Am I • DevOps Engineer, GSI @ FireEye • Twitter: @RealAlvinHuang, IRC: ahuang • alvin.huang@fireeye.com
  • 4. Agenda • Overview of GSI • The Great Migration • Why Pipeline? • Why Docker? • Shared Library Examples • How we did this • Lessons Learned • Benefits for the Future
  • 5. Overview of GSI • Unified global organization combining Mandiant, FireEye iSIGHT Intelligence, and FireEye as a Service operations • DevOps Goal: Make the feedback loop between intelligence on the front lines to capabilities in software, smaller
  • 7. How We Build Code TestBuild Deliver Deploy
  • 9. Scenario • Consolidate datacenters • Migrate Jenkins off a shared instance • ~60 days • ~150 Freestyle jobs • ~20 different build agents • Upgrade from 1.x to 2.x
  • 10. Legacy Jenkins Jobs • Jenkins primarily used to run tests and build RPMs • SCP to publish RPMs to yum server • Ad-hoc Github triggers • No owner/SME for Jenkins
  • 11. Goals • Standardize and make consistent CI pipelines • Jenkins SME = DevOps team • Make new app onboarding easy – Build abstraction that covers ~90% of jobs • Jenkins jobs tracked in git • Decouple tools from Jenkins/shell => Docker
  • 12. Migration Strategies Migration Strategy LOE Advantages Disadvantages Copy XMLs from old server to new server Minimal - Easy, no extra work - Tech debt - Global changes are hard - Job config not in SCM Create Freestyle Jenkins job templates Moderate - Global changes are easier - Hide much of the configuration from end users - Make Freestyle jobs DRY - Tech debt - Debugging a job is hard - Job config not in SCM - Global changes can break all builds Convert Freestyle jobs to Pipeline jobs Significant - Job configuration in SCM - Learn pipeline syntax - Large job footprint - Global changes are hard - Too complex for many users - Subject to repetition and tech debt Create a Jenkins Shared Library for Pipeline jobs Moderate - Jobs in SCM - Standardized and consistent - Easy on-boarding, just needs parameters - Job configuration hidden from user - Learn pipeline syntax - Need owner for library - Global changes can break all builds
  • 13. Why Pipeline and Shared Libraries? Problem Solution Overhead with Freestyle Jobs Jobs were not DRY
  • 15. Solution: Use Github Organizations • Index every branch of every repo that has a Jenkinsfile • Configure one Github hook on the organization level
  • 16. Why Pipeline and Shared Libraries? Problem Solution Overhead with Freestyle jobs Use a pipeline library wrapper; Github Organizations Jobs were not DRY Use a pipeline library wrapper
  • 17. Why Pipeline and Shared Libraries? Problem Solution Overhead with Freestyle jobs Use a pipeline library wrapper; Github Organizations Jobs were not DRY Use a pipeline library wrapper Job configuration drift
  • 18. Why Pipeline and Shared Libraries? Problem Solution Overhead with Freestyle jobs Use a pipeline library wrapper; Github Organizations Jobs were not DRY Use a pipeline library wrapper Job configuration drift Jenkinsfiles in SCM
  • 19. Why Pipeline and Shared Libraries? Problem Solution Overhead with Freestyle jobs Use a pipeline library wrapper; Github Organizations Jobs were not DRY Use a pipeline library wrapper Job configuration drift Jenkinsfiles in SCM Difficult to view job configurations and build steps
  • 21. Why Pipeline and Shared Libraries? Problem Solution Overhead with Freestyle jobs Use a pipeline library wrapper; Github Organizations Jobs were not DRY Use a pipeline library wrapper Job configuration drift Jenkinsfiles in SCM Difficult to view job configurations and build steps Jenkinsfiles + Stage View
  • 22. Why Pipeline and Shared Libraries? Problem Solution Overhead with Freestyle jobs Use a pipeline library wrapper; Github Organizations Jobs were not DRY Use a pipeline library wrapper Job configuration drift Jenkinsfiles in SCM Difficult to view job configurations and build steps Jenkinsfiles + Stage View Very difficult to make global changes
  • 24. Why Pipeline and Shared Libraries? Problem Solution Overhead with Freestyle jobs Use a pipeline library wrapper; Github Organizations Jobs were not DRY Use a pipeline library wrapper Job configuration drift Jenkinsfiles in SCM Difficult to view job configurations and build steps Jenkinsfiles + Stage View Very difficult to make global changes *Library changes have an effect on all builds
  • 25. Why Pipeline and Shared Libraries? Problem Solution Overhead with Freestyle jobs Use a pipeline library wrapper; Github Organizations Jobs were not DRY Use a pipeline library wrapper Job configuration drift Jenkinsfiles in SCM Difficult to view job configurations and build steps Jenkinsfiles + Stage View Very difficult to make global changes *Library changes have an effect on all builds Monolithic build servers
  • 26. Migrating Monolithic Build Agents • No configuration management • What packages and versions were installed? • Who runs on what agent? • Changes on a node may affect another team sharing that same agent
  • 27. Solution to Monolithic Build Agents
  • 29. Why Pipeline and Shared Libraries? Problem Solution Overhead with Freestyle jobs Use a pipeline library wrapper; Github Organizations Jobs were not DRY Use a pipeline library wrapper Job configuration drift Jenkinsfiles in SCM Difficult to view job configurations and build steps Jenkinsfiles + Stage View Very difficult to make global changes *Library changes have an effect on all builds Monolithic build servers Use Docker
  • 30. What about… • Jenkins Job Builder – Simple jobs defined by relatively complex YAML – Verbose – Needs abstraction for novice users • Job DSL Plugin – Programmatically seeds/creates Jenkins jobs – Jenkins Pipeline + Github Organizations can be used instead – No logic between jobs (ie: no Pipeline ‘input’ step)
  • 31. Starting Point • New Jenkins 2.x instance • Stable build nodes built with Puppet – CentOS 6/7 hosts • Working Docker integration
  • 37. Inspiration • https://github.com/jenkinsci/simple-build-for-pipeline- plugin -michaelneale • Build a wrapper called simpleBuild that takes in parameters as a closure and runs logic
  • 42. Demo
  • 43. How do we do this? • Find a *passionate* liaison from each team • Learn their workflow – There’s probably a freestyle job already • Start pipelining their workflow in modular pieces: – Checkout code – Run build script – Archive artifacts – Publish to Artifactory – Promote artifact – Send email • Build a wrapper to call those functions • Repeat for another team/app, reusing what you just made
  • 44. Reap the Benefits • Give Devs/QA their time back • Standardization of jobs and workflows • Standardization of build and test environments • Jenkins maintenance and resilience made easy by decoupling tools
  • 46. Use Github Organizations • Index every branch of every repo that has a Jenkinsfile • Configure one Github hook on the organization level
  • 47. Make Steps Modular • What does this step do? – Does A ‘AND’ B; break it apart • Namespace them
  • 48. Leverage the Snippet Generator
  • 49. Benefits of Shared Libraries For Our Future • Migration of Github • Upgrade to Puppet 5 • Consolidation of Artifactory • Application stacks in Openshift • Deployments through Rundeck, Ansible or Fabric • Scripts in ‘vars’ can be called in Declarative Pipeline
  • 50. Upgrade to Puppet 5 Dockerfile Jenkinsfile
  • 51. Go Forth and Pipeline!
  • 52. Thanks! • alvin.huang@fireeye.com | @RealAlvinHuang | ahuang