Pipeline as code for your infrastructure as Code

Kris Buytaert
Kris BuytaertDevops, Linux and Open Source Expert at Inuits
Pipeline as CodePipeline as Code
for yourfor your
IACIAC
Kris Buytaert
@krisbuytaert
Kris BuytaertKris Buytaert
● I used to be a Dev,I used to be a Dev,
● Then Became an OpThen Became an Op
● Chief Trolling Officer and Open SourceChief Trolling Officer and Open Source
Consultant @inuits.euConsultant @inuits.eu
● Everything is an effing DNS ProblemEverything is an effing DNS Problem
● Building Clouds since before the bookstoreBuilding Clouds since before the bookstore
● Some books, some papers, some blogsSome books, some papers, some blogs
● Evangelizing devopsEvangelizing devops
Todays GoalsTodays Goals
● Infrastructure as CodeInfrastructure as Code
● A reproducable way to deploy and upgradeA reproducable way to deploy and upgrade
/etc/puppet/etc/puppet
● With 10+ environments inWith 10+ environments in
/etc/puppet/environments/etc/puppet/environments
● AutomaticallyAutomatically
● FastFast
● ConsistentConsistent
● ContinuouslyContinuously
What's this devops thingWhat's this devops thing
anyhow ?anyhow ?
C(L)AMSC(L)AMS
● CultureCulture
● (Lean)(Lean)
● AutomationAutomation
● MeasurementMeasurement
● SharingSharing
Damon Edwards and John WillisDamon Edwards and John Willis
Gene KimGene Kim
devops (<)> continuous deliverydevops (<)> continuous delivery
NirvanaNirvana
An “ecosystem” that supports continuous delivery, fromAn “ecosystem” that supports continuous delivery, from
infrastructure, data and configuration management toinfrastructure, data and configuration management to
business.business.
Through automation of the build, deployment, and testingThrough automation of the build, deployment, and testing
process, and improved collaboration between developers,process, and improved collaboration between developers,
testers, and operations, delivery teams can get changestesters, and operations, delivery teams can get changes
released in a matter of hours — sometimes even minutes–noreleased in a matter of hours — sometimes even minutes–no
matter what the size of a project or the complexity of its codematter what the size of a project or the complexity of its code
base.base.
Continuous Delivery , Jez HumbleContinuous Delivery , Jez Humble
Pipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as Code
How many times a day ?How many times a day ?
● 10 @ Flickr10 @ Flickr
● Deployments used to be painDeployments used to be pain
● Nobody dared to deploy a siteNobody dared to deploy a site
● Practice makes perfectPractice makes perfect
● Knowing you can vs constantly doing itKnowing you can vs constantly doing it
" Our job as engineers (and ops, dev-ops, QA," Our job as engineers (and ops, dev-ops, QA,
support, everyone in the company actually) is tosupport, everyone in the company actually) is to
enable the business goals. We strongly feel thatenable the business goals. We strongly feel that
in order to do that you must havein order to do that you must have the ability tothe ability to
deploy code quickly and safelydeploy code quickly and safely. Even if the. Even if the
business goals are to deploy strongly QA’d codebusiness goals are to deploy strongly QA’d code
once a month at 3am (it’s not for us, we push allonce a month at 3am (it’s not for us, we push all
the time), having a reliable and easythe time), having a reliable and easy
deployment should bedeployment should be non-negotiablenon-negotiable."."
Etsy Blog upon releasing DeployinatorEtsy Blog upon releasing Deployinator
http://codeascraft.etsy.com/2010/05/20/quantum-of-deployment/http://codeascraft.etsy.com/2010/05/20/quantum-of-deployment/
For years we've tolerated humans to makeFor years we've tolerated humans to make
structural manual changes to the infrastructurestructural manual changes to the infrastructure
our critical applications are running on.our critical applications are running on.
Whilst at the same time demanding those criticalWhilst at the same time demanding those critical
applications to go through rigid test scenarios.applications to go through rigid test scenarios.
Who let this happen ?Who let this happen ?
Infrastructure as CodeInfrastructure as Code
● Treat configuration automation as codeTreat configuration automation as code
● Development best practicesDevelopment best practices
•
Model your infrastructureModel your infrastructure
•
Version your cookbooks / manifestsVersion your cookbooks / manifests
•
Test your cookbooks/ manifestsTest your cookbooks/ manifests
•
Dev/ test /uat / prod for your infraDev/ test /uat / prod for your infra
● Model your infrastructureModel your infrastructure
● A working service = automated ( Application Code +A working service = automated ( Application Code +
Infrastructure Code + Security + Monitoring )Infrastructure Code + Security + Monitoring )
● PS. Converting Bash to Yaml != IACPS. Converting Bash to Yaml != IAC
Version all the thingsVersion all the things
No more excuses !No more excuses !• Source code ApplicationSource code Application
• Source code InfrastructureSource code Infrastructure
• BuildsBuilds
• TestsTests
• PipelinesPipelines
• ScriptsScripts
• DocumentationDocumentation
• Monitoring scriptsMonitoring scripts
PuppetPuppet
● Open Source Config ManagementOpen Source Config Management ToolTool EcosystemEcosystem
● 10y old ; very mature10y old ; very mature
● Ruby, Clojure, Jruby, C++, ...Ruby, Clojure, Jruby, C++, ...
● Large communityLarge community
● Lots of open source modules (code shared byLots of open source modules (code shared by
other people to automate things)other people to automate things)
Puppet in shortPuppet in short
● You define the desired state of your infraYou define the desired state of your infra
● Puppet looks at the current state and takesPuppet looks at the current state and takes
actions to get to the final stateactions to get to the final state
● You have the report of what has beenYou have the report of what has been
changed/errored/…changed/errored/…
● It is declarativeIt is declarative
How Puppet WorksHow Puppet Works
● Puppet works by default on a server/agentPuppet works by default on a server/agent
modelmodel
● Agents fetch their “catalog” (= final desiredAgents fetch their “catalog” (= final desired
state) from the master and apply that locallystate) from the master and apply that locally
● Then they report back to the serverThen they report back to the server
● The catalog is computed depending on “facts”The catalog is computed depending on “facts”
the machine sends to the server, user inputthe machine sends to the server, user input
(parameters) and modules (source code)(parameters) and modules (source code)
A random projectA random project
[sdog@mine vagrant-graphite]$ ls
manifests modules README TODO Vagrantfile
[sdog@mine vagrant-graphite]$ tree -dL 2
.
├── manifests
│   └── hosts
└── modules
├── apache
├── collectd
├── graphite
├── jmxtrans
├── logster
├── statsd
└── tattle
10 directories
Manage the modulesManage the modules
● Insert ugly shell scriptInsert ugly shell script
● Librarian PuppetLibrarian Puppet
● R10kR10k
● ........
Librarian Puppet / R10kLibrarian Puppet / R10k
● Hides complexity of submodulesHides complexity of submodules
● Easy if you use Forge ModulesEasy if you use Forge Modules
•
Does anyone ?Does anyone ?
•
Do you trust the internet to be around ?Do you trust the internet to be around ?
● Branching is considered the antipattern in aBranching is considered the antipattern in a
CI/CD EnvironmentCI/CD Environment
● Librarian = Old English for “can't useLibrarian = Old English for “can't use
submodules”submodules”
● And hmm... which customer uses which patched version again ?And hmm... which customer uses which patched version again ?
Pipeline as code for your infrastructure as Code
Software ReleaseSoftware Release
management is not amanagement is not a
solved problemsolved problem
Unless you understandUnless you understand
Git SubmodulesGit Submodules
● Basic git,Basic git,
● No extra tools requiredNo extra tools required
Integrates with other projects too.Integrates with other projects too.
(No need for *-librarian etc ..)(No need for *-librarian etc ..)
Continuous IntegrationContinuous Integration
Continuous integration (CI) is the practice, in software engineering, ofContinuous integration (CI) is the practice, in software engineering, of
merging all developer working copies with a shared mainline several times amerging all developer working copies with a shared mainline several times a
day. It was first named and proposed as part of extreme programming (XP). Itsday. It was first named and proposed as part of extreme programming (XP). Its
main aim is to prevent integration problems, referred to as "integration hell"main aim is to prevent integration problems, referred to as "integration hell"
(WikiPedia)(WikiPedia)
Does the app you are deploying still work ?Does the app you are deploying still work ?
Did you break your puppet / chef code ?Did you break your puppet / chef code ?
JenkinsJenkins
● Open Source Continuous Integration ServerOpen Source Continuous Integration Server
● A zillion plugins (400)A zillion plugins (400)
● Have developers build stable and deployableHave developers build stable and deployable
codecode
● Test Infra codeTest Infra code
Jenkins PipelineJenkins Pipeline
What's in your Pipeline ?What's in your Pipeline ?
A pipelineA pipeline
● Checkout codeCheckout code
● SyntaxSyntax
● StyleStyle
● Code CoverageCode Coverage
● TestsTests
● BuildBuild
● More TestsMore Tests
● PackagePackage
Syntax and StyleSyntax and Style
● Initially ,Initially ,
all code, all the timeall code, all the time
● Now,Now,
only the changed codeonly the changed code
● Why not in post Commit Hooks ?Why not in post Commit Hooks ?
Package all the thingsPackage all the things
Artifacts:Artifacts:
● Tested artifacts that go through a pipelineTested artifacts that go through a pipeline
application code,application code,
Infra codeInfra code
metadatametadata
teststests
Why ops like to packageWhy ops like to package
● Packages give you featuresPackages give you features
• Consistency, security, dependenciesConsistency, security, dependencies
● Uniquely identify where files come fromUniquely identify where files come from
•Package or cfg-mgmtPackage or cfg-mgmt
● Source repo not always availableSource repo not always available
•Firewall / Cloud etc ..Firewall / Cloud etc ..
● Weird deployment locations , no easy accessWeird deployment locations , no easy access
● Little overhead when you automateLittle overhead when you automate
Jordan Sissel is a Hero !Jordan Sissel is a Hero !
#packaginlove#packaginlove
It's not really packagingIt's not really packaging
•
It's an immutable branchIt's an immutable branch
•
It's a tracable release artefactIt's a tracable release artefact
A pipelineA pipeline
● Checkout codeCheckout code
● SyntaxSyntax
● StyleStyle
● Code CoverageCode Coverage
● TestsTests
● BuildBuild
● More TestsMore Tests
● PackagePackage
● Upload to RepoUpload to Repo
Repository ManagementRepository Management
● PulpPulp
•
Pro : MirroringLovePro : MirroringLove
•
Con : Mongo, Stability, .debCon : Mongo, Stability, .deb
● Aptly (deb only)Aptly (deb only)
● Prm (missing snapshot features for .rpm)Prm (missing snapshot features for .rpm)
Repository ManagementRepository Management
A pipelineA pipeline
● Checkout codeCheckout code
● SyntaxSyntax
● StyleStyle
● Code CoverageCode Coverage
● TestsTests
● BuildBuild
● More TestsMore Tests
● PackagePackage
● Upload to RepoUpload to Repo
● Deploy on TestDeploy on Test
Repos are SLOWRepos are SLOW
● Createrepo is slow.Createrepo is slow.
● Pulp is slowPulp is slow
● Bypass repos , upload straight to appropriateBypass repos , upload straight to appropriate
PuppetMasterPuppetMaster
● Upload to repo for rebootstrappingUpload to repo for rebootstrapping
A pipelineA pipeline
● Checkout codeCheckout code
● SyntaxSyntax
● StyleStyle
● Code CoverageCode Coverage
● TestsTests
● BuildBuild
● More TestsMore Tests
● PackagePackage
● Upload to RepoUpload to Repo
● Deploy on TestDeploy on Test
● Check PuppetrunsCheck Puppetruns
● Check MonitoringCheck Monitoring
Testing = MonitoringTesting = Monitoring
● Deploy a host,Deploy a host,
● Add it to the monitoring frameworkAdd it to the monitoring framework
● Add collection toolsAdd collection tools
● Add check definitionsAdd check definitions
● Update the monitoring tool configUpdate the monitoring tool config
FULLY AUTOMATEDFULLY AUTOMATED
e.g. Stored Configse.g. Stored Configs
A pipelineA pipeline
● Checkout codeCheckout code
● SyntaxSyntax
● StyleStyle
● Code CoverageCode Coverage
● TestsTests
● BuildBuild
● More TestsMore Tests
● PackagePackage
● Upload to RepoUpload to Repo
● Deploy on TestDeploy on Test
● Check PuppetrunsCheck Puppetruns
● Check MonitoringCheck Monitoring
● Promote to UATPromote to UAT
Jenkins PromotionJenkins Promotion
PipelinesPipelines
● Lots of themLots of them
● Similar ones, but not identical onesSimilar ones, but not identical ones
● One project = different deploymentOne project = different deployment
targetstargets
● People move teams expect samePeople move teams expect same
patternspatterns
● Mostly unmaintanedMostly unmaintaned
Dirty ClickersDirty Clickers
Complex PipelinesComplex Pipelines
Scaling PipelinesScaling Pipelines
● Create a Pipeline,Create a Pipeline,
● For job in PipelineFor job in Pipeline
•
Create new Job Based on OldJobCreate new Job Based on OldJob
● Update One JobUpdate One Job
● Never refactor the restNever refactor the rest
Generating Jenkins PipelinesGenerating Jenkins Pipelines
● Template the XMLTemplate the XML
● Put it in PuppetPut it in Puppet
•
Worked for stable pipelinesWorked for stable pipelines
•
KindaKinda
● XML gets rewritten on the flyXML gets rewritten on the fly
JenkinsJobBuilderJenkinsJobBuilder
● First Usable AttemptFirst Usable Attempt
● Python BasedPython Based
● Openstack CommunityOpenstack Community
● Limited FunctionalityLimited Functionality
● Little Adoption / OpenstackLittle Adoption / Openstack
Abandonned itAbandonned it
PipelineDSLPipelineDSL
● JenkinsfileJenkinsfile
● Inside a repoInside a repo
● GroovyGroovy
● Limited functionalityLimited functionality
● Initially buggyInitially buggy
● Popular for Easy tasksPopular for Easy tasks
•
(straight, no splits etc)(straight, no splits etc)
Jenkins Job DSLJenkins Job DSL
● GroovyGroovy
● FlexibleFlexible
● Well SupportedWell Supported
● Suitable for more complex PipelinesSuitable for more complex Pipelines
https://jenkinsci.github.io/job-dsl-https://jenkinsci.github.io/job-dsl-
plugin/plugin/
SeedjobsSeedjobs
● GroovyGroovy
● GitGit
● Rebuild jobs on commitRebuild jobs on commit
● Projects in foldersProjects in folders
Larger CI StacksLarger CI Stacks
● Generate Pipelines / Jobs based on config files ,Generate Pipelines / Jobs based on config files ,
● Build librariesBuild libraries
•
CheckoutJobCheckoutJob
•
DeployJobDeployJob
•
PackageJobPackageJob
● Use Groovy / JobDSL to generate PipelineDSLUse Groovy / JobDSL to generate PipelineDSL
Testing Multiple VersionsTesting Multiple Versions
● Initial stage tests code on multipleInitial stage tests code on multiple
versionsversions
•
e.g current puppet versione.g current puppet version
•
Next puppet versionNext puppet version
•
Bleeding Edge versionBleeding Edge version
● Only current version breaks buildOnly current version breaks build
● Goal = get all versions greenGoal = get all versions green
Problems solvedProblems solved
● One job per task, no reuse of jobs with differentOne job per task, no reuse of jobs with different
parametersparameters
● All Jobs are in sync, update one = update allAll Jobs are in sync, update one = update all
● Centrally managed jobs (git)Centrally managed jobs (git)
Stop Clicking , Write CodeStop Clicking , Write Code
ContactContact
Kris Buytaert kris.buytaert@inuits.euKris Buytaert kris.buytaert@inuits.eu
Further ReadingFurther Reading
@krisbuytaert@krisbuytaert
http://www.krisbuytaert.be/blog/http://www.krisbuytaert.be/blog/
https://inuits.eu/https://inuits.eu/
InuitsInuits
Essensteenweg 31Essensteenweg 31
BrasschaatBrasschaat
BelgiumBelgium
891.514.231891.514.231
+32 475 961221+32 475 961221
1 of 59

Recommended

Deploying your SaaS stack OnPrem by
Deploying your SaaS stack OnPremDeploying your SaaS stack OnPrem
Deploying your SaaS stack OnPremKris Buytaert
681 views38 slides
Pipeline as Code by
Pipeline as CodePipeline as Code
Pipeline as CodeKris Buytaert
982 views20 slides
Moby is killing your devops efforts by
Moby is killing your devops effortsMoby is killing your devops efforts
Moby is killing your devops effortsKris Buytaert
2.7K views43 slides
Is there a future for devops ? by
Is there a future for devops ?Is there a future for devops ?
Is there a future for devops ?Kris Buytaert
3.5K views49 slides
Automating MySQL operations with Puppet by
Automating MySQL operations with PuppetAutomating MySQL operations with Puppet
Automating MySQL operations with PuppetKris Buytaert
1.8K views51 slides
Repositories as Code by
Repositories as CodeRepositories as Code
Repositories as CodeKris Buytaert
642 views34 slides

More Related Content

What's hot

Docker is killing your #devops Efforts by
Docker is killing your #devops EffortsDocker is killing your #devops Efforts
Docker is killing your #devops EffortsKris Buytaert
2.6K views26 slides
Open Source Monitoring in 2019 by
Open Source Monitoring in 2019 Open Source Monitoring in 2019
Open Source Monitoring in 2019 Kris Buytaert
1.5K views56 slides
Nightmare on Docker street by
Nightmare on Docker streetNightmare on Docker street
Nightmare on Docker streetKris Buytaert
4K views20 slides
The Return of the Dull Stack Engineer by
The Return of the Dull Stack EngineerThe Return of the Dull Stack Engineer
The Return of the Dull Stack EngineerKris Buytaert
2.4K views51 slides
Continuous Infrastructure First by
Continuous Infrastructure FirstContinuous Infrastructure First
Continuous Infrastructure FirstKris Buytaert
568 views52 slides
From MonitoringSucks to Monitoring Love , 2016 Edition by
From MonitoringSucks to Monitoring Love , 2016 EditionFrom MonitoringSucks to Monitoring Love , 2016 Edition
From MonitoringSucks to Monitoring Love , 2016 EditionKris Buytaert
29.4K views51 slides

What's hot(20)

Docker is killing your #devops Efforts by Kris Buytaert
Docker is killing your #devops EffortsDocker is killing your #devops Efforts
Docker is killing your #devops Efforts
Kris Buytaert2.6K views
Open Source Monitoring in 2019 by Kris Buytaert
Open Source Monitoring in 2019 Open Source Monitoring in 2019
Open Source Monitoring in 2019
Kris Buytaert1.5K views
The Return of the Dull Stack Engineer by Kris Buytaert
The Return of the Dull Stack EngineerThe Return of the Dull Stack Engineer
The Return of the Dull Stack Engineer
Kris Buytaert2.4K views
Continuous Infrastructure First by Kris Buytaert
Continuous Infrastructure FirstContinuous Infrastructure First
Continuous Infrastructure First
Kris Buytaert568 views
From MonitoringSucks to Monitoring Love , 2016 Edition by Kris Buytaert
From MonitoringSucks to Monitoring Love , 2016 EditionFrom MonitoringSucks to Monitoring Love , 2016 Edition
From MonitoringSucks to Monitoring Love , 2016 Edition
Kris Buytaert29.4K views
Devops is a Security Requirement by Kris Buytaert
Devops is a Security RequirementDevops is a Security Requirement
Devops is a Security Requirement
Kris Buytaert699 views
Closing the gap between Distros(devs) and their Users(ops) by Kris Buytaert
Closing the gap between Distros(devs) and their Users(ops)Closing the gap between Distros(devs) and their Users(ops)
Closing the gap between Distros(devs) and their Users(ops)
Kris Buytaert15.9K views
Dev secops opsec, devsec, devops ? by Kris Buytaert
Dev secops opsec, devsec, devops ?Dev secops opsec, devsec, devops ?
Dev secops opsec, devsec, devops ?
Kris Buytaert17.4K views
Groovy there's a docker in my application pipeline by Kris Buytaert
Groovy there's a docker in my application pipelineGroovy there's a docker in my application pipeline
Groovy there's a docker in my application pipeline
Kris Buytaert1.3K views
The influence of "Distributed platforms" on #devops by Kris Buytaert
The influence of "Distributed platforms" on #devopsThe influence of "Distributed platforms" on #devops
The influence of "Distributed platforms" on #devops
Kris Buytaert1.3K views
On the Importance of Infrastructure as Code by Kris Buytaert
On the Importance of Infrastructure as CodeOn the Importance of Infrastructure as Code
On the Importance of Infrastructure as Code
Kris Buytaert1.8K views
Continous Delivery of your Infrastructure by Kris Buytaert
Continous Delivery of your InfrastructureContinous Delivery of your Infrastructure
Continous Delivery of your Infrastructure
Kris Buytaert857 views
No, we can't do continuous delivery by Kris Buytaert
No, we can't do continuous deliveryNo, we can't do continuous delivery
No, we can't do continuous delivery
Kris Buytaert1.8K views
Continuous Infrastructure First by Kris Buytaert
Continuous Infrastructure FirstContinuous Infrastructure First
Continuous Infrastructure First
Kris Buytaert521 views
Run stuff, Deploy Stuff, Jax London 2017 Edition by Kris Buytaert
Run stuff, Deploy Stuff, Jax London 2017 EditionRun stuff, Deploy Stuff, Jax London 2017 Edition
Run stuff, Deploy Stuff, Jax London 2017 Edition
Kris Buytaert2.2K views

Similar to Pipeline as code for your infrastructure as Code

Continuous Delivery of (y)our infrastructure. by
Continuous Delivery of (y)our infrastructure.Continuous Delivery of (y)our infrastructure.
Continuous Delivery of (y)our infrastructure.Kris Buytaert
3K views45 slides
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert by
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert NETWAYS
152 views45 slides
Icinga Camp Amsterdam - Infrastructure as Code by
Icinga Camp Amsterdam - Infrastructure as CodeIcinga Camp Amsterdam - Infrastructure as Code
Icinga Camp Amsterdam - Infrastructure as CodeIcinga
3.3K views37 slides
From Config Management Sucks to #cfgmgmtlove by
From Config Management Sucks to #cfgmgmtlove From Config Management Sucks to #cfgmgmtlove
From Config Management Sucks to #cfgmgmtlove Kris Buytaert
2K views42 slides
Consistent Development Environment with Vagrant and Chef by
Consistent Development Environment with Vagrant and ChefConsistent Development Environment with Vagrant and Chef
Consistent Development Environment with Vagrant and ChefGerald Villorente
1.5K views63 slides
Devops with Python by Yaniv Cohen DevopShift by
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftYaniv cohen
652 views122 slides

Similar to Pipeline as code for your infrastructure as Code(20)

Continuous Delivery of (y)our infrastructure. by Kris Buytaert
Continuous Delivery of (y)our infrastructure.Continuous Delivery of (y)our infrastructure.
Continuous Delivery of (y)our infrastructure.
Kris Buytaert3K views
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert by NETWAYS
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert
NETWAYS152 views
Icinga Camp Amsterdam - Infrastructure as Code by Icinga
Icinga Camp Amsterdam - Infrastructure as CodeIcinga Camp Amsterdam - Infrastructure as Code
Icinga Camp Amsterdam - Infrastructure as Code
Icinga3.3K views
From Config Management Sucks to #cfgmgmtlove by Kris Buytaert
From Config Management Sucks to #cfgmgmtlove From Config Management Sucks to #cfgmgmtlove
From Config Management Sucks to #cfgmgmtlove
Kris Buytaert2K views
Consistent Development Environment with Vagrant and Chef by Gerald Villorente
Consistent Development Environment with Vagrant and ChefConsistent Development Environment with Vagrant and Chef
Consistent Development Environment with Vagrant and Chef
Gerald Villorente1.5K views
Devops with Python by Yaniv Cohen DevopShift by Yaniv cohen
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShift
Yaniv cohen652 views
Deploying software at Scale by Kris Buytaert
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
Kris Buytaert2.5K views
Creating a reasonable project boilerplate by Stanislav Petrov
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
Stanislav Petrov104 views
When traditional configuration management is to slow for your needs by Kris Buytaert
When traditional configuration management is to slow for your needsWhen traditional configuration management is to slow for your needs
When traditional configuration management is to slow for your needs
Kris Buytaert1.4K views
Django dev-env-my-way by Robert Lujo
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
Robert Lujo941 views
Monitoring in an Infrastructure as Code Age by Puppet
Monitoring in an Infrastructure as Code AgeMonitoring in an Infrastructure as Code Age
Monitoring in an Infrastructure as Code Age
Puppet7.2K views
Building and Deploying MediaSalsa, a drupal-based DAM as a Service by Julien Pivotto
Building and Deploying MediaSalsa, a drupal-based DAM as a ServiceBuilding and Deploying MediaSalsa, a drupal-based DAM as a Service
Building and Deploying MediaSalsa, a drupal-based DAM as a Service
Julien Pivotto4.8K views
Monitoring in an Infrastructure as Code Age by Kris Buytaert
Monitoring in an Infrastructure as Code AgeMonitoring in an Infrastructure as Code Age
Monitoring in an Infrastructure as Code Age
Kris Buytaert12K views
Online gas booking project in java by s4al_com
Online gas booking project in javaOnline gas booking project in java
Online gas booking project in java
s4al_com8K views
OSDC 2015: Kris Buytaert | From ConfigManagementSucks to ConfigManagementLove by NETWAYS
OSDC 2015: Kris Buytaert | From ConfigManagementSucks to ConfigManagementLoveOSDC 2015: Kris Buytaert | From ConfigManagementSucks to ConfigManagementLove
OSDC 2015: Kris Buytaert | From ConfigManagementSucks to ConfigManagementLove
NETWAYS204 views
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ... by DynamicInfraDays
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
DynamicInfraDays784 views

More from Kris Buytaert

Years of (not) learning , from devops to devoops by
Years of (not) learning , from devops to devoopsYears of (not) learning , from devops to devoops
Years of (not) learning , from devops to devoopsKris Buytaert
65 views44 slides
Observability will not fix your Broken Monitoring ,Ignite by
Observability will not fix your Broken Monitoring ,IgniteObservability will not fix your Broken Monitoring ,Ignite
Observability will not fix your Broken Monitoring ,IgniteKris Buytaert
167 views20 slides
Infrastructure as Code Patterns by
Infrastructure as Code PatternsInfrastructure as Code Patterns
Infrastructure as Code PatternsKris Buytaert
117 views53 slides
From devoops to devops 13 years of (not) learning by
From devoops to devops 13 years of (not) learningFrom devoops to devops 13 years of (not) learning
From devoops to devops 13 years of (not) learningKris Buytaert
185 views40 slides
Pipeline all the Dashboards as Code by
Pipeline all the Dashboards as CodePipeline all the Dashboards as Code
Pipeline all the Dashboards as CodeKris Buytaert
644 views20 slides
Help , My Datacenter is on fire by
Help , My Datacenter is on fireHelp , My Datacenter is on fire
Help , My Datacenter is on fireKris Buytaert
542 views38 slides

More from Kris Buytaert(15)

Years of (not) learning , from devops to devoops by Kris Buytaert
Years of (not) learning , from devops to devoopsYears of (not) learning , from devops to devoops
Years of (not) learning , from devops to devoops
Kris Buytaert65 views
Observability will not fix your Broken Monitoring ,Ignite by Kris Buytaert
Observability will not fix your Broken Monitoring ,IgniteObservability will not fix your Broken Monitoring ,Ignite
Observability will not fix your Broken Monitoring ,Ignite
Kris Buytaert167 views
Infrastructure as Code Patterns by Kris Buytaert
Infrastructure as Code PatternsInfrastructure as Code Patterns
Infrastructure as Code Patterns
Kris Buytaert117 views
From devoops to devops 13 years of (not) learning by Kris Buytaert
From devoops to devops 13 years of (not) learningFrom devoops to devops 13 years of (not) learning
From devoops to devops 13 years of (not) learning
Kris Buytaert185 views
Pipeline all the Dashboards as Code by Kris Buytaert
Pipeline all the Dashboards as CodePipeline all the Dashboards as Code
Pipeline all the Dashboards as Code
Kris Buytaert644 views
Help , My Datacenter is on fire by Kris Buytaert
Help , My Datacenter is on fireHelp , My Datacenter is on fire
Help , My Datacenter is on fire
Kris Buytaert542 views
Devops is Dead, Long live Devops by Kris Buytaert
Devops is Dead, Long live DevopsDevops is Dead, Long live Devops
Devops is Dead, Long live Devops
Kris Buytaert289 views
10 years of #devopsdays, but what have we really learned ? by Kris Buytaert
10 years of #devopsdays, but what have we really learned ? 10 years of #devopsdays, but what have we really learned ?
10 years of #devopsdays, but what have we really learned ?
Kris Buytaert594 views
Is there a Future for devops ? by Kris Buytaert
Is there a Future for devops   ? Is there a Future for devops   ?
Is there a Future for devops ?
Kris Buytaert478 views
10 Years of #devopsdays weirdness by Kris Buytaert
10 Years of #devopsdays weirdness10 Years of #devopsdays weirdness
10 Years of #devopsdays weirdness
Kris Buytaert400 views
ADDO 2019: Looking back at over 10 years of Devops by Kris Buytaert
ADDO 2019:    Looking back at over 10 years of DevopsADDO 2019:    Looking back at over 10 years of Devops
ADDO 2019: Looking back at over 10 years of Devops
Kris Buytaert578 views
Continuous Infrastructure First Ignite Edition by Kris Buytaert
Continuous Infrastructure First  Ignite EditionContinuous Infrastructure First  Ignite Edition
Continuous Infrastructure First Ignite Edition
Kris Buytaert476 views
Looking back at 5 years of #cfgmgmtcamp by Kris Buytaert
Looking back at 5 years of #cfgmgmtcampLooking back at 5 years of #cfgmgmtcamp
Looking back at 5 years of #cfgmgmtcamp
Kris Buytaert625 views
Looking back at 7.5 years of Devopsdays , DOd PDX by Kris Buytaert
Looking back at 7.5 years of Devopsdays , DOd PDXLooking back at 7.5 years of Devopsdays , DOd PDX
Looking back at 7.5 years of Devopsdays , DOd PDX
Kris Buytaert463 views
Devopsdays Amsterdam 2017 Keynote, looking back at 5 years of AMS by Kris Buytaert
Devopsdays Amsterdam 2017 Keynote, looking back at 5 years of AMSDevopsdays Amsterdam 2017 Keynote, looking back at 5 years of AMS
Devopsdays Amsterdam 2017 Keynote, looking back at 5 years of AMS
Kris Buytaert772 views

Recently uploaded

Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze by
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng TszeDigital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng TszeNUS-ISS
19 views47 slides
Roadmap to Become Experts.pptx by
Roadmap to Become Experts.pptxRoadmap to Become Experts.pptx
Roadmap to Become Experts.pptxdscwidyatamanew
11 views45 slides
The Research Portal of Catalonia: Growing more (information) & more (services) by
The Research Portal of Catalonia: Growing more (information) & more (services)The Research Portal of Catalonia: Growing more (information) & more (services)
The Research Portal of Catalonia: Growing more (information) & more (services)CSUC - Consorci de Serveis Universitaris de Catalunya
73 views25 slides
Attacking IoT Devices from a Web Perspective - Linux Day by
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day Simone Onofri
15 views68 slides
The Importance of Cybersecurity for Digital Transformation by
The Importance of Cybersecurity for Digital TransformationThe Importance of Cybersecurity for Digital Transformation
The Importance of Cybersecurity for Digital TransformationNUS-ISS
27 views26 slides
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor... by
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...Vadym Kazulkin
75 views64 slides

Recently uploaded(20)

Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze by NUS-ISS
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng TszeDigital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze
NUS-ISS19 views
Attacking IoT Devices from a Web Perspective - Linux Day by Simone Onofri
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
Simone Onofri15 views
The Importance of Cybersecurity for Digital Transformation by NUS-ISS
The Importance of Cybersecurity for Digital TransformationThe Importance of Cybersecurity for Digital Transformation
The Importance of Cybersecurity for Digital Transformation
NUS-ISS27 views
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor... by Vadym Kazulkin
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
Vadym Kazulkin75 views
Combining Orchestration and Choreography for a Clean Architecture by ThomasHeinrichs1
Combining Orchestration and Choreography for a Clean ArchitectureCombining Orchestration and Choreography for a Clean Architecture
Combining Orchestration and Choreography for a Clean Architecture
ThomasHeinrichs169 views
Perth MeetUp November 2023 by Michael Price
Perth MeetUp November 2023 Perth MeetUp November 2023
Perth MeetUp November 2023
Michael Price15 views
Data-centric AI and the convergence of data and model engineering: opportunit... by Paolo Missier
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...
Paolo Missier34 views
Transcript: The Details of Description Techniques tips and tangents on altern... by BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada130 views
Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst470 views
SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
.conf Go 2023 - Data analysis as a routine by Splunk
.conf Go 2023 - Data analysis as a routine.conf Go 2023 - Data analysis as a routine
.conf Go 2023 - Data analysis as a routine
Splunk93 views
Future of Learning - Yap Aye Wee.pdf by NUS-ISS
Future of Learning - Yap Aye Wee.pdfFuture of Learning - Yap Aye Wee.pdf
Future of Learning - Yap Aye Wee.pdf
NUS-ISS41 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi120 views
The details of description: Techniques, tips, and tangents on alternative tex... by BookNet Canada
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...
BookNet Canada121 views
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors by sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab15 views
Emerging & Future Technology - How to Prepare for the Next 10 Years of Radica... by NUS-ISS
Emerging & Future Technology - How to Prepare for the Next 10 Years of Radica...Emerging & Future Technology - How to Prepare for the Next 10 Years of Radica...
Emerging & Future Technology - How to Prepare for the Next 10 Years of Radica...
NUS-ISS16 views

Pipeline as code for your infrastructure as Code

  • 1. Pipeline as CodePipeline as Code for yourfor your IACIAC Kris Buytaert @krisbuytaert
  • 2. Kris BuytaertKris Buytaert ● I used to be a Dev,I used to be a Dev, ● Then Became an OpThen Became an Op ● Chief Trolling Officer and Open SourceChief Trolling Officer and Open Source Consultant @inuits.euConsultant @inuits.eu ● Everything is an effing DNS ProblemEverything is an effing DNS Problem ● Building Clouds since before the bookstoreBuilding Clouds since before the bookstore ● Some books, some papers, some blogsSome books, some papers, some blogs ● Evangelizing devopsEvangelizing devops
  • 3. Todays GoalsTodays Goals ● Infrastructure as CodeInfrastructure as Code ● A reproducable way to deploy and upgradeA reproducable way to deploy and upgrade /etc/puppet/etc/puppet ● With 10+ environments inWith 10+ environments in /etc/puppet/environments/etc/puppet/environments ● AutomaticallyAutomatically ● FastFast ● ConsistentConsistent ● ContinuouslyContinuously
  • 4. What's this devops thingWhat's this devops thing anyhow ?anyhow ?
  • 5. C(L)AMSC(L)AMS ● CultureCulture ● (Lean)(Lean) ● AutomationAutomation ● MeasurementMeasurement ● SharingSharing Damon Edwards and John WillisDamon Edwards and John Willis Gene KimGene Kim
  • 6. devops (<)> continuous deliverydevops (<)> continuous delivery
  • 7. NirvanaNirvana An “ecosystem” that supports continuous delivery, fromAn “ecosystem” that supports continuous delivery, from infrastructure, data and configuration management toinfrastructure, data and configuration management to business.business. Through automation of the build, deployment, and testingThrough automation of the build, deployment, and testing process, and improved collaboration between developers,process, and improved collaboration between developers, testers, and operations, delivery teams can get changestesters, and operations, delivery teams can get changes released in a matter of hours — sometimes even minutes–noreleased in a matter of hours — sometimes even minutes–no matter what the size of a project or the complexity of its codematter what the size of a project or the complexity of its code base.base. Continuous Delivery , Jez HumbleContinuous Delivery , Jez Humble
  • 10. How many times a day ?How many times a day ? ● 10 @ Flickr10 @ Flickr ● Deployments used to be painDeployments used to be pain ● Nobody dared to deploy a siteNobody dared to deploy a site ● Practice makes perfectPractice makes perfect ● Knowing you can vs constantly doing itKnowing you can vs constantly doing it
  • 11. " Our job as engineers (and ops, dev-ops, QA," Our job as engineers (and ops, dev-ops, QA, support, everyone in the company actually) is tosupport, everyone in the company actually) is to enable the business goals. We strongly feel thatenable the business goals. We strongly feel that in order to do that you must havein order to do that you must have the ability tothe ability to deploy code quickly and safelydeploy code quickly and safely. Even if the. Even if the business goals are to deploy strongly QA’d codebusiness goals are to deploy strongly QA’d code once a month at 3am (it’s not for us, we push allonce a month at 3am (it’s not for us, we push all the time), having a reliable and easythe time), having a reliable and easy deployment should bedeployment should be non-negotiablenon-negotiable."." Etsy Blog upon releasing DeployinatorEtsy Blog upon releasing Deployinator http://codeascraft.etsy.com/2010/05/20/quantum-of-deployment/http://codeascraft.etsy.com/2010/05/20/quantum-of-deployment/
  • 12. For years we've tolerated humans to makeFor years we've tolerated humans to make structural manual changes to the infrastructurestructural manual changes to the infrastructure our critical applications are running on.our critical applications are running on. Whilst at the same time demanding those criticalWhilst at the same time demanding those critical applications to go through rigid test scenarios.applications to go through rigid test scenarios. Who let this happen ?Who let this happen ?
  • 13. Infrastructure as CodeInfrastructure as Code ● Treat configuration automation as codeTreat configuration automation as code ● Development best practicesDevelopment best practices • Model your infrastructureModel your infrastructure • Version your cookbooks / manifestsVersion your cookbooks / manifests • Test your cookbooks/ manifestsTest your cookbooks/ manifests • Dev/ test /uat / prod for your infraDev/ test /uat / prod for your infra ● Model your infrastructureModel your infrastructure ● A working service = automated ( Application Code +A working service = automated ( Application Code + Infrastructure Code + Security + Monitoring )Infrastructure Code + Security + Monitoring ) ● PS. Converting Bash to Yaml != IACPS. Converting Bash to Yaml != IAC
  • 14. Version all the thingsVersion all the things No more excuses !No more excuses !• Source code ApplicationSource code Application • Source code InfrastructureSource code Infrastructure • BuildsBuilds • TestsTests • PipelinesPipelines • ScriptsScripts • DocumentationDocumentation • Monitoring scriptsMonitoring scripts
  • 15. PuppetPuppet ● Open Source Config ManagementOpen Source Config Management ToolTool EcosystemEcosystem ● 10y old ; very mature10y old ; very mature ● Ruby, Clojure, Jruby, C++, ...Ruby, Clojure, Jruby, C++, ... ● Large communityLarge community ● Lots of open source modules (code shared byLots of open source modules (code shared by other people to automate things)other people to automate things)
  • 16. Puppet in shortPuppet in short ● You define the desired state of your infraYou define the desired state of your infra ● Puppet looks at the current state and takesPuppet looks at the current state and takes actions to get to the final stateactions to get to the final state ● You have the report of what has beenYou have the report of what has been changed/errored/…changed/errored/… ● It is declarativeIt is declarative
  • 17. How Puppet WorksHow Puppet Works ● Puppet works by default on a server/agentPuppet works by default on a server/agent modelmodel ● Agents fetch their “catalog” (= final desiredAgents fetch their “catalog” (= final desired state) from the master and apply that locallystate) from the master and apply that locally ● Then they report back to the serverThen they report back to the server ● The catalog is computed depending on “facts”The catalog is computed depending on “facts” the machine sends to the server, user inputthe machine sends to the server, user input (parameters) and modules (source code)(parameters) and modules (source code)
  • 18. A random projectA random project [sdog@mine vagrant-graphite]$ ls manifests modules README TODO Vagrantfile [sdog@mine vagrant-graphite]$ tree -dL 2 . ├── manifests │   └── hosts └── modules ├── apache ├── collectd ├── graphite ├── jmxtrans ├── logster ├── statsd └── tattle 10 directories
  • 19. Manage the modulesManage the modules ● Insert ugly shell scriptInsert ugly shell script ● Librarian PuppetLibrarian Puppet ● R10kR10k ● ........
  • 20. Librarian Puppet / R10kLibrarian Puppet / R10k ● Hides complexity of submodulesHides complexity of submodules ● Easy if you use Forge ModulesEasy if you use Forge Modules • Does anyone ?Does anyone ? • Do you trust the internet to be around ?Do you trust the internet to be around ? ● Branching is considered the antipattern in aBranching is considered the antipattern in a CI/CD EnvironmentCI/CD Environment ● Librarian = Old English for “can't useLibrarian = Old English for “can't use submodules”submodules” ● And hmm... which customer uses which patched version again ?And hmm... which customer uses which patched version again ?
  • 22. Software ReleaseSoftware Release management is not amanagement is not a solved problemsolved problem
  • 23. Unless you understandUnless you understand Git SubmodulesGit Submodules ● Basic git,Basic git, ● No extra tools requiredNo extra tools required Integrates with other projects too.Integrates with other projects too. (No need for *-librarian etc ..)(No need for *-librarian etc ..)
  • 24. Continuous IntegrationContinuous Integration Continuous integration (CI) is the practice, in software engineering, ofContinuous integration (CI) is the practice, in software engineering, of merging all developer working copies with a shared mainline several times amerging all developer working copies with a shared mainline several times a day. It was first named and proposed as part of extreme programming (XP). Itsday. It was first named and proposed as part of extreme programming (XP). Its main aim is to prevent integration problems, referred to as "integration hell"main aim is to prevent integration problems, referred to as "integration hell" (WikiPedia)(WikiPedia) Does the app you are deploying still work ?Does the app you are deploying still work ? Did you break your puppet / chef code ?Did you break your puppet / chef code ?
  • 25. JenkinsJenkins ● Open Source Continuous Integration ServerOpen Source Continuous Integration Server ● A zillion plugins (400)A zillion plugins (400) ● Have developers build stable and deployableHave developers build stable and deployable codecode ● Test Infra codeTest Infra code
  • 27. What's in your Pipeline ?What's in your Pipeline ?
  • 28. A pipelineA pipeline ● Checkout codeCheckout code ● SyntaxSyntax ● StyleStyle ● Code CoverageCode Coverage ● TestsTests ● BuildBuild ● More TestsMore Tests ● PackagePackage
  • 29. Syntax and StyleSyntax and Style ● Initially ,Initially , all code, all the timeall code, all the time ● Now,Now, only the changed codeonly the changed code ● Why not in post Commit Hooks ?Why not in post Commit Hooks ?
  • 30. Package all the thingsPackage all the things
  • 31. Artifacts:Artifacts: ● Tested artifacts that go through a pipelineTested artifacts that go through a pipeline application code,application code, Infra codeInfra code metadatametadata teststests
  • 32. Why ops like to packageWhy ops like to package ● Packages give you featuresPackages give you features • Consistency, security, dependenciesConsistency, security, dependencies ● Uniquely identify where files come fromUniquely identify where files come from •Package or cfg-mgmtPackage or cfg-mgmt ● Source repo not always availableSource repo not always available •Firewall / Cloud etc ..Firewall / Cloud etc .. ● Weird deployment locations , no easy accessWeird deployment locations , no easy access ● Little overhead when you automateLittle overhead when you automate
  • 33. Jordan Sissel is a Hero !Jordan Sissel is a Hero !
  • 35. It's not really packagingIt's not really packaging • It's an immutable branchIt's an immutable branch • It's a tracable release artefactIt's a tracable release artefact
  • 36. A pipelineA pipeline ● Checkout codeCheckout code ● SyntaxSyntax ● StyleStyle ● Code CoverageCode Coverage ● TestsTests ● BuildBuild ● More TestsMore Tests ● PackagePackage ● Upload to RepoUpload to Repo
  • 37. Repository ManagementRepository Management ● PulpPulp • Pro : MirroringLovePro : MirroringLove • Con : Mongo, Stability, .debCon : Mongo, Stability, .deb ● Aptly (deb only)Aptly (deb only) ● Prm (missing snapshot features for .rpm)Prm (missing snapshot features for .rpm)
  • 39. A pipelineA pipeline ● Checkout codeCheckout code ● SyntaxSyntax ● StyleStyle ● Code CoverageCode Coverage ● TestsTests ● BuildBuild ● More TestsMore Tests ● PackagePackage ● Upload to RepoUpload to Repo ● Deploy on TestDeploy on Test
  • 40. Repos are SLOWRepos are SLOW ● Createrepo is slow.Createrepo is slow. ● Pulp is slowPulp is slow ● Bypass repos , upload straight to appropriateBypass repos , upload straight to appropriate PuppetMasterPuppetMaster ● Upload to repo for rebootstrappingUpload to repo for rebootstrapping
  • 41. A pipelineA pipeline ● Checkout codeCheckout code ● SyntaxSyntax ● StyleStyle ● Code CoverageCode Coverage ● TestsTests ● BuildBuild ● More TestsMore Tests ● PackagePackage ● Upload to RepoUpload to Repo ● Deploy on TestDeploy on Test ● Check PuppetrunsCheck Puppetruns ● Check MonitoringCheck Monitoring
  • 42. Testing = MonitoringTesting = Monitoring ● Deploy a host,Deploy a host, ● Add it to the monitoring frameworkAdd it to the monitoring framework ● Add collection toolsAdd collection tools ● Add check definitionsAdd check definitions ● Update the monitoring tool configUpdate the monitoring tool config FULLY AUTOMATEDFULLY AUTOMATED
  • 43. e.g. Stored Configse.g. Stored Configs
  • 44. A pipelineA pipeline ● Checkout codeCheckout code ● SyntaxSyntax ● StyleStyle ● Code CoverageCode Coverage ● TestsTests ● BuildBuild ● More TestsMore Tests ● PackagePackage ● Upload to RepoUpload to Repo ● Deploy on TestDeploy on Test ● Check PuppetrunsCheck Puppetruns ● Check MonitoringCheck Monitoring ● Promote to UATPromote to UAT
  • 46. PipelinesPipelines ● Lots of themLots of them ● Similar ones, but not identical onesSimilar ones, but not identical ones ● One project = different deploymentOne project = different deployment targetstargets ● People move teams expect samePeople move teams expect same patternspatterns ● Mostly unmaintanedMostly unmaintaned
  • 49. Scaling PipelinesScaling Pipelines ● Create a Pipeline,Create a Pipeline, ● For job in PipelineFor job in Pipeline • Create new Job Based on OldJobCreate new Job Based on OldJob ● Update One JobUpdate One Job ● Never refactor the restNever refactor the rest
  • 50. Generating Jenkins PipelinesGenerating Jenkins Pipelines ● Template the XMLTemplate the XML ● Put it in PuppetPut it in Puppet • Worked for stable pipelinesWorked for stable pipelines • KindaKinda ● XML gets rewritten on the flyXML gets rewritten on the fly
  • 51. JenkinsJobBuilderJenkinsJobBuilder ● First Usable AttemptFirst Usable Attempt ● Python BasedPython Based ● Openstack CommunityOpenstack Community ● Limited FunctionalityLimited Functionality ● Little Adoption / OpenstackLittle Adoption / Openstack Abandonned itAbandonned it
  • 52. PipelineDSLPipelineDSL ● JenkinsfileJenkinsfile ● Inside a repoInside a repo ● GroovyGroovy ● Limited functionalityLimited functionality ● Initially buggyInitially buggy ● Popular for Easy tasksPopular for Easy tasks • (straight, no splits etc)(straight, no splits etc)
  • 53. Jenkins Job DSLJenkins Job DSL ● GroovyGroovy ● FlexibleFlexible ● Well SupportedWell Supported ● Suitable for more complex PipelinesSuitable for more complex Pipelines https://jenkinsci.github.io/job-dsl-https://jenkinsci.github.io/job-dsl- plugin/plugin/
  • 54. SeedjobsSeedjobs ● GroovyGroovy ● GitGit ● Rebuild jobs on commitRebuild jobs on commit ● Projects in foldersProjects in folders
  • 55. Larger CI StacksLarger CI Stacks ● Generate Pipelines / Jobs based on config files ,Generate Pipelines / Jobs based on config files , ● Build librariesBuild libraries • CheckoutJobCheckoutJob • DeployJobDeployJob • PackageJobPackageJob ● Use Groovy / JobDSL to generate PipelineDSLUse Groovy / JobDSL to generate PipelineDSL
  • 56. Testing Multiple VersionsTesting Multiple Versions ● Initial stage tests code on multipleInitial stage tests code on multiple versionsversions • e.g current puppet versione.g current puppet version • Next puppet versionNext puppet version • Bleeding Edge versionBleeding Edge version ● Only current version breaks buildOnly current version breaks build ● Goal = get all versions greenGoal = get all versions green
  • 57. Problems solvedProblems solved ● One job per task, no reuse of jobs with differentOne job per task, no reuse of jobs with different parametersparameters ● All Jobs are in sync, update one = update allAll Jobs are in sync, update one = update all ● Centrally managed jobs (git)Centrally managed jobs (git)
  • 58. Stop Clicking , Write CodeStop Clicking , Write Code
  • 59. ContactContact Kris Buytaert kris.buytaert@inuits.euKris Buytaert kris.buytaert@inuits.eu Further ReadingFurther Reading @krisbuytaert@krisbuytaert http://www.krisbuytaert.be/blog/http://www.krisbuytaert.be/blog/ https://inuits.eu/https://inuits.eu/ InuitsInuits Essensteenweg 31Essensteenweg 31 BrasschaatBrasschaat BelgiumBelgium 891.514.231891.514.231 +32 475 961221+32 475 961221