Lessons learned from doing it repeatedly
by Mirah Gary & Josh Hill, Pivotal
Pipelines are the infrastructure we use to test and deliver our code. We work with them every day, but sometimes they behave in unexpected ways. We will go over common failure modes and issues we have encountered in our Concourse pipelines, and understand what we can do to prevent and solve these pain points.
Being able to build pipelines that work for you is critical for effective dev/ops. By sharing our own mistakes, we hope that you will be able to recognize them when they happen and know what to do to fix the problems.
This talk was delivered at the Concourse London User Group (CLUG) on 6 December 2018 at Pivotal London: https://www.meetup.com/Concourse-London-User-Group/events/256171643/
8. 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
14. 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
15. Copypasta Take 2
Symptom: job with incorrect passed constraints
Visual:
Treatment: visually inspect after set-pipeline
16. 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
17.
18. No clean up
Symptom: Job fails because a limit is reached
Visual: failed build
Treatment: automate clean up
27. No pipe
Symptom: job has to be run before another job can pass
Visual: jobs not linked
Treatment: get resource & add passed constraint
28. 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]
29.
30.
31. Missing trigger
Symptom: job does not trigger automatically on previous job
Visual: dotted line between jobs
Treatment: add trigger
32. 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
47. Wrong resource flows
Symptom: rebuilding artifacts in the pipeline
Visual: wrong resource flows through
Treatment: change resource that flows through
51. Missing resource
Symptom: triggering serial group twice causes failed build
Visual: failed build in serial group
Treatment: add resource to represent state
52. Missing resource
Symptom: triggering serial group twice causes failed build
Visual: failed build in serial group
Treatment: add resource to represent state
54. 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