Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Advanced CI
I’m Dirk Zittersteyn,
Software engineer @ since mid 2013
Did some stuff
@ before that
The wonderful world of
Continuous Integration.
A.k.a.:
Getting to green
Version Control
Is your team larger than 1 person?
Use version control.
Is your team 1 person?
Use version control.
Big (open source) players
Version control can look
overly complicated
Codebase
More awesome
WorkingonfeatureX
BuiltfeatureY
FinishedfeatureX
Mainline branch
Mainline branch
The mainline stays deliverable
Mainline branch
Branch “New feature”
$ git branch
$ hg branch
$ svn copy
Mainline branch
Branch “New feature”
Mainline branch
Branch “New feature”
Mainline branch
Branch “New feature”
Integrate your changes
Concurrent work!
Concurrent work
Mainline branch
Branch “New feature”
Branch “Other feature”
Toavoid“IntegrationHell”
So, are we done?
Concurrency is hard
Meet Charlie.
My code
isn’t
broken!
My code
isn’t
broken!
You better check yo build
Before you wreck yo build
Ice Cube
!
Mainline should be green
Agreement ≠ Reality
Missing testcases
“It’s so simple, it won’t break”
Agreement ≠ Reality
‘Bad’ commits
$ git commit -m ’removed debug statement’
Agreement ≠ Reality
Quick fixes w/o running tests
$ git commit -m ’server no longer explodes’
But wait, there’s more!
+ =
!+ = !
Mainline + Branch = New Mainline
!+ != ?
Yes!
!+ !=
Yes(ish)!
!+ !=
Assuming everything is okay.
e.g.
all environments are the same,
nobody is removing tests,
nobody is setting this up to ha...
+ = ?
Mainline:
add(a, b):
result = a + b
return result
test_add():
assert add(1,1) == 2
+ = ?
Developer A:
add(a, b):
+ g.adds += 1
result = a + b
return result
test_add():
+ g.adds = 0
assert add(1,1) == 2
+ assert ...
Merge A’s changes with mainline
add(a, b):
+ g.adds += 1
result = a + b
return result
test_add():
+ g.adds = 0
assert add(...
Merge B’s changes with mainline
add(a, b):
g.adds += 1
result = a + b
+ g.adds += 1
return result
test_add():
g.adds = 0
a...
add(a, b):
g.adds += 1
result = a + b
g.adds += 1
return result
test_add():
g.adds = 0
assert add(1,1) == 2
! assert g.add...
!
Developer A
Developer B
Does this happen?
if ((err = SSLFreeBuffer(&hashCtx)) != 0)
goto fail;
if ((err = ReadyHash(&SSLHashSHA1, &hashCtx)) != 0)
goto fail;
if ((e...
Just because you're paranoid
doesn't mean that they're not after you
Joseph Heller
Developers shouldn’t change the mainline
Every merge is a change!
Oh merciful
Gatekeeper, please
merge my code!
✓
!
!
Calm down, Try again
!
Calm down, Try again
!
What do we use?
Our judge, jury and execut(ion)er
Jenkins-CI.org
• Test execution:
py.test
• Code merging
Gatekeeper plugi...
Running on
Bare metal
Running on
+
Bare metal
Release 1418
Unstable
Unstable
Release 1418
Case 1
Case 2
Unstable
Release 1418
Case 1
Case 2
Unstable
Release 1418
Case 1
Case 2
Unstable
Release 1418
Case 1
Case 2
Unstable
Release 1418
Case 1
Case 2
Unstable
Release 1418
✓
Case 1
Case 2
Unstable
Release 1418
✓
Case 1
Case 2
Unstable
Release 1418
✓
Case 1
Case 2
Unstable
Release 1418
✓
Case 1
Case 2
Unstable
Release 1418
✓
!
Case 1
Case 2
!
Unstable
Release 1418
✓
Case 1
Case 2
!
Unstable
Release 1418
✓
Case 1
Case 2
!
Unstable
Release 1418
✓
Case 1
Case 2
!
Unstable
Release 1418
✓
Case 1
Case 2
!
Unstable
Release 1418
✓
✓Case 1
Case 2
!
Unstable
Release 1418
✓
✓
✓
Case 1
Case 2
!
Unstable
Release 1418
✓
✓
✓
Staging
✓
Case 1
Case 2
!
Unstable
Release 1418
✓
✓
✓
Staging
✓
Release 1420
Case 1
Case 2
So, are we done?
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn
Upcoming SlideShare
Loading in …5
×

Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn

1,969 views

Published on

Presenting a short introduction to version control, and how to set up your tools to make sure you can always deploy.

Download the version with annotations here: https://www.dropbox.com/s/nweywk72ztldphf/Advanced%20CI%20Pygrunn%20-%20standalone.pptx

Reinout van Rees wrote a summary of the presentation, which can be found on his blog: http://reinout.vanrees.org/weblog/2014/05/09/continuous-integration.html

Published in: Software, Technology
  • Be the first to comment

Advanced Continuous Integration - PyGrunn 2014 - Dirk Zittersteyn

  1. 1. Advanced CI
  2. 2. I’m Dirk Zittersteyn, Software engineer @ since mid 2013
  3. 3. Did some stuff @ before that
  4. 4. The wonderful world of Continuous Integration.
  5. 5. A.k.a.: Getting to green
  6. 6. Version Control
  7. 7. Is your team larger than 1 person? Use version control.
  8. 8. Is your team 1 person? Use version control.
  9. 9. Big (open source) players
  10. 10. Version control can look overly complicated
  11. 11. Codebase
  12. 12. More awesome
  13. 13. WorkingonfeatureX BuiltfeatureY FinishedfeatureX
  14. 14. Mainline branch
  15. 15. Mainline branch The mainline stays deliverable
  16. 16. Mainline branch Branch “New feature” $ git branch $ hg branch $ svn copy
  17. 17. Mainline branch Branch “New feature”
  18. 18. Mainline branch Branch “New feature”
  19. 19. Mainline branch Branch “New feature” Integrate your changes
  20. 20. Concurrent work!
  21. 21. Concurrent work Mainline branch Branch “New feature” Branch “Other feature”
  22. 22. Toavoid“IntegrationHell”
  23. 23. So, are we done?
  24. 24. Concurrency is hard
  25. 25. Meet Charlie.
  26. 26. My code isn’t broken!
  27. 27. My code isn’t broken!
  28. 28. You better check yo build Before you wreck yo build Ice Cube
  29. 29. ! Mainline should be green
  30. 30. Agreement ≠ Reality Missing testcases “It’s so simple, it won’t break”
  31. 31. Agreement ≠ Reality ‘Bad’ commits $ git commit -m ’removed debug statement’
  32. 32. Agreement ≠ Reality Quick fixes w/o running tests $ git commit -m ’server no longer explodes’
  33. 33. But wait, there’s more!
  34. 34. + = !+ = ! Mainline + Branch = New Mainline
  35. 35. !+ != ?
  36. 36. Yes! !+ !=
  37. 37. Yes(ish)! !+ !=
  38. 38. Assuming everything is okay. e.g. all environments are the same, nobody is removing tests, nobody is setting this up to happen !+ !=
  39. 39. + = ?
  40. 40. Mainline: add(a, b): result = a + b return result test_add(): assert add(1,1) == 2 + = ?
  41. 41. Developer A: add(a, b): + g.adds += 1 result = a + b return result test_add(): + g.adds = 0 assert add(1,1) == 2 + assert g.adds == 1 Developer B: add(a, b): result = a + b + g.adds += 1 return result test_add(): + g.adds = 0 assert add(1,1) == 2 + assert g.adds == 1
  42. 42. Merge A’s changes with mainline add(a, b): + g.adds += 1 result = a + b return result test_add(): + g.adds = 0 assert add(1,1) == 2 + assert g.adds == 1
  43. 43. Merge B’s changes with mainline add(a, b): g.adds += 1 result = a + b + g.adds += 1 return result test_add(): g.adds = 0 assert add(1,1) == 2 assert g.adds == 1
  44. 44. add(a, b): g.adds += 1 result = a + b g.adds += 1 return result test_add(): g.adds = 0 assert add(1,1) == 2 ! assert g.adds == 1 !+ =
  45. 45. ! Developer A Developer B
  46. 46. Does this happen?
  47. 47. if ((err = SSLFreeBuffer(&hashCtx)) != 0) goto fail; if ((err = ReadyHash(&SSLHashSHA1, &hashCtx)) != 0) goto fail; if ((err = SSLHashSHA1.update(&hashCtx, &clientRandom)) != 0) goto fail; if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0) goto fail; if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) goto fail; ! goto fail; if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0) goto fail; At least, that’s what the NSA wants you to think
  48. 48. Just because you're paranoid doesn't mean that they're not after you Joseph Heller
  49. 49. Developers shouldn’t change the mainline
  50. 50. Every merge is a change!
  51. 51. Oh merciful Gatekeeper, please merge my code!
  52. 52.
  53. 53. !
  54. 54. !
  55. 55. Calm down, Try again !
  56. 56. Calm down, Try again !
  57. 57. What do we use? Our judge, jury and execut(ion)er Jenkins-CI.org • Test execution: py.test • Code merging Gatekeeper plugin • Developer notification Fogbugz plugin .com/ /paylogic-jenkins-plugins
  58. 58. Running on Bare metal
  59. 59. Running on + Bare metal
  60. 60. Release 1418 Unstable
  61. 61. Unstable Release 1418 Case 1 Case 2
  62. 62. Unstable Release 1418 Case 1 Case 2
  63. 63. Unstable Release 1418 Case 1 Case 2
  64. 64. Unstable Release 1418 Case 1 Case 2
  65. 65. Unstable Release 1418 Case 1 Case 2
  66. 66. Unstable Release 1418 ✓ Case 1 Case 2
  67. 67. Unstable Release 1418 ✓ Case 1 Case 2
  68. 68. Unstable Release 1418 ✓ Case 1 Case 2
  69. 69. Unstable Release 1418 ✓ Case 1 Case 2
  70. 70. Unstable Release 1418 ✓ ! Case 1 Case 2
  71. 71. ! Unstable Release 1418 ✓ Case 1 Case 2
  72. 72. ! Unstable Release 1418 ✓ Case 1 Case 2
  73. 73. ! Unstable Release 1418 ✓ Case 1 Case 2
  74. 74. ! Unstable Release 1418 ✓ Case 1 Case 2
  75. 75. ! Unstable Release 1418 ✓ ✓Case 1 Case 2
  76. 76. ! Unstable Release 1418 ✓ ✓ ✓ Case 1 Case 2
  77. 77. ! Unstable Release 1418 ✓ ✓ ✓ Staging ✓ Case 1 Case 2
  78. 78. ! Unstable Release 1418 ✓ ✓ ✓ Staging ✓ Release 1420 Case 1 Case 2
  79. 79. So, are we done?

×