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

The journey to GitOps
The journey to GitOpsThe journey to GitOps
The journey to GitOpsNicola Baldi
 
Robot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationRobot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationSauce Labs
 
Java Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQubeJava Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQubeAngelin R
 
API_Testing_with_Postman
API_Testing_with_PostmanAPI_Testing_with_Postman
API_Testing_with_PostmanMithilesh Singh
 
Modern CI/CD Pipeline Using Azure DevOps
Modern CI/CD Pipeline Using Azure DevOpsModern CI/CD Pipeline Using Azure DevOps
Modern CI/CD Pipeline Using Azure DevOpsGlobalLogic Ukraine
 
Space Camp - API Contract Testing
Space Camp - API Contract TestingSpace Camp - API Contract Testing
Space Camp - API Contract TestingPostman
 
Speeding up your team with GitOps
Speeding up your team with GitOpsSpeeding up your team with GitOps
Speeding up your team with GitOpsBrice Fernandes
 
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Edureka!
 
Git Lab Introduction
Git Lab IntroductionGit Lab Introduction
Git Lab IntroductionKrunal Doshi
 
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaEdureka!
 
Postman Webinar: “Continuous Testing with Postman”
Postman Webinar: “Continuous Testing with Postman”Postman Webinar: “Continuous Testing with Postman”
Postman Webinar: “Continuous Testing with Postman”Postman
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins PipelinesSteffen Gebert
 

What's hot (20)

LambdaTest
LambdaTestLambdaTest
LambdaTest
 
The journey to GitOps
The journey to GitOpsThe journey to GitOps
The journey to GitOps
 
CI/CD
CI/CDCI/CD
CI/CD
 
Robot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs IntegrationRobot Framework Introduction & Sauce Labs Integration
Robot Framework Introduction & Sauce Labs Integration
 
Java Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQubeJava Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQube
 
API_Testing_with_Postman
API_Testing_with_PostmanAPI_Testing_with_Postman
API_Testing_with_Postman
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Modern CI/CD Pipeline Using Azure DevOps
Modern CI/CD Pipeline Using Azure DevOpsModern CI/CD Pipeline Using Azure DevOps
Modern CI/CD Pipeline Using Azure DevOps
 
Gitlab CI/CD
Gitlab CI/CDGitlab CI/CD
Gitlab CI/CD
 
DevOps culture
DevOps cultureDevOps culture
DevOps culture
 
Space Camp - API Contract Testing
Space Camp - API Contract TestingSpace Camp - API Contract Testing
Space Camp - API Contract Testing
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
CI CD Basics
CI CD BasicsCI CD Basics
CI CD Basics
 
Speeding up your team with GitOps
Speeding up your team with GitOpsSpeeding up your team with GitOps
Speeding up your team with GitOps
 
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
 
Git Lab Introduction
Git Lab IntroductionGit Lab Introduction
Git Lab Introduction
 
Introduction to robot framework
Introduction to robot frameworkIntroduction to robot framework
Introduction to robot framework
 
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
 
Postman Webinar: “Continuous Testing with Postman”
Postman Webinar: “Continuous Testing with Postman”Postman Webinar: “Continuous Testing with Postman”
Postman Webinar: “Continuous Testing with Postman”
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 

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

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Recently uploaded (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

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