SlideShare ist ein Scribd-Unternehmen logo
1 von 56
Downloaden Sie, um offline zu lesen
How NOT to build a pipeline
Lessons learned from doing it wrong, repeatedly
Mirah Gary & Josh Hill
Pivotal
Overview
Build Antipatterns
- by Mirah
Flow Antipatterns
- by Josh
Builds
Builds pass ✅
Builds fail ❌
Builds error ⚠
Build Errors
Symptom: concourse error
Visual: orange build
Diagnosis: misconfiguration
Treatment: correct the pipeline definition
Symptom: git resource failing due to API rate limit
Treatment: create a GitHub concourse user & authenticate
resources:
- name: my-github-repo
type: git
source:
uri: git@github.com:me/my-github-repo.git
private_key: ((git-private-key))
branch: master
GitHub API rate limit
Error Here
run
Continuing on Failure
Symptom: pipeline fails due to a failed build in an earlier job
Treatment: tasks should fail when errors occur
tasks are code, test them like code
Bad Bash
Treatment: Shellcheck
set -eu
set -o pipefail
Undebuggable Tasks
Symptom: task fails with no useful output
Treatment: add logging to stdout/stderr
Gotcha: set +x can leak creds
Flakes
Symptom: job fails for no reason, passes when run again
Visual:
Treatment: hunt down and fix flakes, make yourself feel the pain
Copypasta
Symptom: many nearly identical tasks
Visual: tasks
├── run-systests-mysql-5.5
│ ├── task.sh
│ └── task.yml
├── run-systests-mysql-5.6
│ ├── task.sh
│ └── task.yml
└── run-systests-mysql-5.7
├── task.sh
└── task.yml
Treatment: refactor tasks
Input Mapping
Lets you rename inputs, so tasks have general, reusable inputs
plan:
- aggregate:
- get: cf-deployment-concourse-tasks
- get: my-private-repo
- task: bbl-up-my-BOSH-director
file: cf-deployment-concourse-tasks/bbl-up/task.yml
input_mapping:
bbl-state: my-private-repo/my-state-dir
Copypasta Take 2
Symptom: job with incorrect passed constraints
Visual:
Treatment: visually inspect after set-pipeline
Tasks with Side Effects
Symptom: running a task again after failure always fails again
unless manually cleaned up
Example: tasks which push to GitHub
Treatment: Idempotent tasks
Tasks are not done until they can be run repeatedly,
even if they fail
State should live in resources, not tasks
No clean up
Symptom: Job fails because a limit is reached
Visual: failed build
Treatment: automate clean up
Flow
Pipelines can flow ✅
Pipelines can block ❌
Pipelines can nonsense .
Plumbing
No pipe
Symptom: job has to be run before another job can pass
Visual: jobs not linked
Treatment: get resource & add passed constraint
No pipe
Symptom: job has to be run before another job can pass
Visual: jobs not linked
Treatment: get resource & add passed constraint
jobs:
- name: system-director
plan:
- get: dummy-bbr-script-release-bucket
passed: [deploy-bosh-directors]
Missing trigger
Symptom: job does not trigger automatically on previous job
Visual: dotted line between jobs
Treatment: add trigger
Missing trigger
Symptom: job does not trigger automatically on previous job
Visual: dotted line between jobs
Treatment: add trigger
jobs:
- name: system-director
plan:
- get: dummy-bbr-script-release-bucket
passed: [deploy-bosh-directors]
trigger: true
Fans
Incomplete fan in
Symptom: version that fails tests is delivered
Visual: lines inconsistent with other jobs
Treatment: add passed constraint
Overlapping fan out
Symptom: too many builds in the pipeline
Visual: too many lines
Treatment: minimise passed constraints
Resources
build image
build image
again!
build image
once
Wrong resource flows
Symptom: rebuilding artifacts in the pipeline
Visual: wrong resource flows through
Treatment: change resource that flows through
deploy test delete
deploy test delete
1. deploy
2. test
4. delete
3. deploy
5. test
Missing resource
Symptom: triggering serial group twice causes failed build
Visual: failed build in serial group
Treatment: add resource to represent state
Missing resource
Symptom: triggering serial group twice causes failed build
Visual: failed build in serial group
Treatment: add resource to represent state
Summary
Pipeline anti-patterns
Builds
● Build errors
● API rate limiting
● Continuing on failure
● Bad bash
● Undebuggable tasks
● Flakes
● Copypasta
● Tasks with side effects
● No clean up
Flow
● No pipe
● Missing trigger
● Incomplete fan in
● Overlapping fan out
● Wrong resource flows
● Missing resource
That’s all!
Pipelines: github.com/cloudfoundry-incubator/backup-and-restore-ci
Concourse: backup-and-restore.ci.cf-app.com
Thank you .
Mirah Gary & Josh Hill
Pivotal

Weitere ähnliche Inhalte

Was ist angesagt?

Continuous integration with Git & CI Joe
Continuous integration with Git & CI JoeContinuous integration with Git & CI Joe
Continuous integration with Git & CI Joe
Shawn Price
 
One click deployment with Jenkins - PHP Munich
One click deployment with Jenkins - PHP MunichOne click deployment with Jenkins - PHP Munich
One click deployment with Jenkins - PHP Munich
Mayflower GmbH
 
Perl web programming
Perl web programmingPerl web programming
Perl web programming
Johnny Pork
 
How to outsource the pain of drupal translation to smartling from loparev
How to outsource the pain of drupal translation to smartling from loparevHow to outsource the pain of drupal translation to smartling from loparev
How to outsource the pain of drupal translation to smartling from loparev
Oleksii Bogush
 
Testing Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade WorkflowTesting Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade Workflow
Pantheon
 
One Click Deployment with Jenkins - PHP Unconference 2011
One Click Deployment with Jenkins - PHP Unconference 2011One Click Deployment with Jenkins - PHP Unconference 2011
One Click Deployment with Jenkins - PHP Unconference 2011
Mayflower GmbH
 

Was ist angesagt? (20)

Workshop: Introduction to Web Components & Polymer
Workshop: Introduction to Web Components & Polymer Workshop: Introduction to Web Components & Polymer
Workshop: Introduction to Web Components & Polymer
 
Bit Rot in the Docs
Bit Rot in the DocsBit Rot in the Docs
Bit Rot in the Docs
 
Continuous integration with Git & CI Joe
Continuous integration with Git & CI JoeContinuous integration with Git & CI Joe
Continuous integration with Git & CI Joe
 
Frappe Open Day - September 2018
Frappe Open Day - September 2018Frappe Open Day - September 2018
Frappe Open Day - September 2018
 
One click deployment with Jenkins - PHP Munich
One click deployment with Jenkins - PHP MunichOne click deployment with Jenkins - PHP Munich
One click deployment with Jenkins - PHP Munich
 
Double Loop
Double LoopDouble Loop
Double Loop
 
Just another bughunt
Just another bughunt Just another bughunt
Just another bughunt
 
ComponenKit and React Native
ComponenKit and React NativeComponenKit and React Native
ComponenKit and React Native
 
Collaborative Development: The Only CD That Matters - Brent Beer - Codemotion...
Collaborative Development: The Only CD That Matters - Brent Beer - Codemotion...Collaborative Development: The Only CD That Matters - Brent Beer - Codemotion...
Collaborative Development: The Only CD That Matters - Brent Beer - Codemotion...
 
From Software Engineering To Machine Learning
From Software Engineering To Machine LearningFrom Software Engineering To Machine Learning
From Software Engineering To Machine Learning
 
Why Your Site is Slow: Performance Answers for Your Clients
Why Your Site is Slow: Performance Answers for Your ClientsWhy Your Site is Slow: Performance Answers for Your Clients
Why Your Site is Slow: Performance Answers for Your Clients
 
Perl web programming
Perl web programmingPerl web programming
Perl web programming
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer
 
How to outsource the pain of drupal translation to smartling from loparev
How to outsource the pain of drupal translation to smartling from loparevHow to outsource the pain of drupal translation to smartling from loparev
How to outsource the pain of drupal translation to smartling from loparev
 
Testing Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade WorkflowTesting Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade Workflow
 
Practical PHP Deployment with Jenkins
Practical PHP Deployment with JenkinsPractical PHP Deployment with Jenkins
Practical PHP Deployment with Jenkins
 
One Click Deployment with Jenkins - PHP Unconference 2011
One Click Deployment with Jenkins - PHP Unconference 2011One Click Deployment with Jenkins - PHP Unconference 2011
One Click Deployment with Jenkins - PHP Unconference 2011
 
Build a chatroom!
Build a chatroom!Build a chatroom!
Build a chatroom!
 
APIdays Paris 2018 - Client Library Automation, Inside Out, Avital Tzubeli, D...
APIdays Paris 2018 - Client Library Automation, Inside Out, Avital Tzubeli, D...APIdays Paris 2018 - Client Library Automation, Inside Out, Avital Tzubeli, D...
APIdays Paris 2018 - Client Library Automation, Inside Out, Avital Tzubeli, D...
 
LeapMotion for Web with React and Flux
LeapMotion for Web with React and FluxLeapMotion for Web with React and Flux
LeapMotion for Web with React and Flux
 

Ähnlich wie How NOT to build a pipeline

Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
 

Ähnlich wie How NOT to build a pipeline (20)

Operational API design anti-patterns (Jason Harmon)
Operational API design anti-patterns (Jason Harmon)Operational API design anti-patterns (Jason Harmon)
Operational API design anti-patterns (Jason Harmon)
 
Ember addons, served three ways
Ember addons, served three waysEmber addons, served three ways
Ember addons, served three ways
 
DWX 2022 - DevSecOps mit GitHub
DWX 2022 - DevSecOps mit GitHubDWX 2022 - DevSecOps mit GitHub
DWX 2022 - DevSecOps mit GitHub
 
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!
Azure DevOps Realtime Work Item Sync: the good, the bad, the ugly!
 
Our long road to….continuous improvement (DevOps Days Boston 2014)
Our long road to….continuous improvement  (DevOps Days Boston 2014)Our long road to….continuous improvement  (DevOps Days Boston 2014)
Our long road to….continuous improvement (DevOps Days Boston 2014)
 
Automated Detection of HPP Vulnerabilities in Web Applications Version 0.3, B...
Automated Detection of HPP Vulnerabilities in Web Applications Version 0.3, B...Automated Detection of HPP Vulnerabilities in Web Applications Version 0.3, B...
Automated Detection of HPP Vulnerabilities in Web Applications Version 0.3, B...
 
The What & Why of Pattern Lab
The What & Why of Pattern LabThe What & Why of Pattern Lab
The What & Why of Pattern Lab
 
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI serverPyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
 
Automated code review process
Automated code review processAutomated code review process
Automated code review process
 
Contributing to github is for everyone
Contributing to github is for everyoneContributing to github is for everyone
Contributing to github is for everyone
 
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
Start with passing tests (tdd for bugs) v0.5 (22 sep 2016)
 
Panmind at Ruby Social Club Milano
Panmind at Ruby Social Club MilanoPanmind at Ruby Social Club Milano
Panmind at Ruby Social Club Milano
 
Drupal Patch Reviews: Get good reviews, give good reviews. Faster.
Drupal Patch Reviews: Get good reviews, give good reviews. Faster.Drupal Patch Reviews: Get good reviews, give good reviews. Faster.
Drupal Patch Reviews: Get good reviews, give good reviews. Faster.
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Continuous integration in github
Continuous integration in githubContinuous integration in github
Continuous integration in github
 
Introduction to test_driven_development
Introduction to test_driven_developmentIntroduction to test_driven_development
Introduction to test_driven_development
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
 
Introduction to GitHub Actions - How to easily automate and integrate with Gi...
Introduction to GitHub Actions - How to easily automate and integrate with Gi...Introduction to GitHub Actions - How to easily automate and integrate with Gi...
Introduction to GitHub Actions - How to easily automate and integrate with Gi...
 

Mehr von Josh Hill

Mehr von Josh Hill (8)

Reviving the platform everyday
Reviving the platform everydayReviving the platform everyday
Reviving the platform everyday
 
Working together v2.1 with speaker notes
Working together v2.1 with speaker notesWorking together v2.1 with speaker notes
Working together v2.1 with speaker notes
 
Working together
Working togetherWorking together
Working together
 
Knot programming
Knot programmingKnot programming
Knot programming
 
Beyond Makers Academy
Beyond Makers AcademyBeyond Makers Academy
Beyond Makers Academy
 
Improving specs with RSpec 3
Improving specs with RSpec 3Improving specs with RSpec 3
Improving specs with RSpec 3
 
Starting out
Starting outStarting out
Starting out
 
From West End theatre to coding everyday
From West End theatre to coding everydayFrom West End theatre to coding everyday
From West End theatre to coding everyday
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

How NOT to build a pipeline