O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

Expert Talks Cardiff 2017 - Keeping your ci-cd system as fast as it needs to be

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Próximos SlideShares
Smalltalk-Driven GUI Testing
Smalltalk-Driven GUI Testing
Carregando em…3
×

Confira estes a seguir

1 de 66 Anúncio

Expert Talks Cardiff 2017 - Keeping your ci-cd system as fast as it needs to be

Baixar para ler offline

First, you automated your build. Then your build grew out of control, so you decided to split it into modules that trigger each other as needed. Now you have a large chain of builds, each of them taking a short amount of time (brilliant!), but each time you commit you don't just build one thing, you build and rebuild so many modules that it, again, takes forever to clear up every time you commit a change.


In this talk I'll show you what information you need to gather from your CI/CD pipeline, and how you can gather such information, in order to re-shape the architecture of your systems so as to optimise your build time

First, you automated your build. Then your build grew out of control, so you decided to split it into modules that trigger each other as needed. Now you have a large chain of builds, each of them taking a short amount of time (brilliant!), but each time you commit you don't just build one thing, you build and rebuild so many modules that it, again, takes forever to clear up every time you commit a change.


In this talk I'll show you what information you need to gather from your CI/CD pipeline, and how you can gather such information, in order to re-shape the architecture of your systems so as to optimise your build time

Anúncio
Anúncio

Mais Conteúdo rRelacionado

Quem viu também gostou (20)

Semelhante a Expert Talks Cardiff 2017 - Keeping your ci-cd system as fast as it needs to be (20)

Anúncio

Mais recentes (20)

Anúncio

Expert Talks Cardiff 2017 - Keeping your ci-cd system as fast as it needs to be

  1. 1. Abraham Marin-Perez @AbrahamMarin fromfragiletoagile.com Keeping Your CI / CD Pipeline as Fast as It Needs to Be #ExpertTalks @AbrahamMarin @EqualExperts
  2. 2. Abraham Marin-Perez @AbrahamMarin fromfragiletoagile.com Keeping Your CI / CD Pipeline as Fast as It Needs to Be #ExpertTalks @AbrahamMarin @EqualExperts
  3. 3. About Me
  4. 4. About Me
  5. 5. About Me
  6. 6. About Me
  7. 7. About Me
  8. 8. About Me
  9. 9. About This Talk
  10. 10.  Continuous Integration: check everything is still working after every commit  Continuous Deployment: every successful commit turns into a release About This Talk
  11. 11. About This Talk
  12. 12. About This Talk
  13. 13. About This Talk
  14. 14. About This Talk
  15. 15. SUPER APP # Files: 75 # Tests: 800 Build Time: 4 min Output: superapp.war
  16. 16. SUPER APP # Files: 113 # Tests: 1200 Build Time: 6 min Output: superapp.war
  17. 17. SUPER APP # Files: 169 # Tests: 1800 Build Time: 9 min Output: superapp.war
  18. 18. Slow feedback Broken builds mask issues Development paralysis Impact on ability to meet our SLAs Pay per use Missed business opportunities The Problems Of Size
  19. 19. Live with it Partial CD: only quick tests Phased CD: split into components Test Deprecation Policy Microservices How Organisations Manage Size
  20. 20. Microservices
  21. 21. Microservices
  22. 22. Microservices
  23. 23. SUPER APP # Files: 169 # Tests: 1800 Build Time: 9 min Output: superapp.war APP BACKEN D SUPER APP # Files: 115 # Tests: 1200 Build Time: 6 min Output: superapp.war # Files: 72 # Tests: 800 Build Time: 4 min Output: appbackend.jar
  24. 24. Microservices?
  25. 25. Microservices
  26. 26. Microservices
  27. 27. Microservices
  28. 28. Microservices
  29. 29. Microservices
  30. 30. Microservices
  31. 31. Build Pipeline Becomes a Network
  32. 32. https://goo.gl/LvkkRq Scalable Continuous Deployment With Maven
  33. 33. A real case scenario
  34. 34. Service Service Service Parent POM Logging
  35. 35. Service Service Service Parent POM Logging 28%
  36. 36. Service Service Service Parent POM Logging 28% 28% 28%
  37. 37. Service Service Service Parent POM Logging 28% 28% 28% 20%
  38. 38. Service Service Service Parent POM Logging 48% 28% 28% 20%
  39. 39. Service Service Service Parent POM Logging Highest run frequency Lowest run frequency
  40. 40. Service Service Service Highest run frequency Lowest run frequency
  41. 41.  Build Time (BT): time an individual build takes to run  Change Rate (CR): percentage of commits upon an individual build with respect to the whole system Useful Metrics
  42. 42. Service Service Service Highest run frequency Lowest run frequency
  43. 43. Service Service Service Parent POM Logging 28%
  44. 44.  Impact Time (IT): total time to run a build and all the builds that will be triggered as a result Useful Metrics
  45. 45. No dependants  IT(A) = BT(A) A Useful Metrics
  46. 46. Serial execution  IT(A) = BT(A) + IT(B) + IT(C) B A C Useful Metrics
  47. 47. Parallel execution  IT(A) = BT(A) + max(IT(B), IT(C)) B A C Useful Metrics
  48. 48. Service Service Service Highest run frequency Lowest run frequency
  49. 49. Weighted Impact Time (WIT): impact time of a build weighted according to its change rage WIT(A) = IT(A) * CR(A) Useful Metrics
  50. 50. Average Impact Time (AIT): total time needed, on average, to execute all necessary builds after any given commit anywhere in the system AIT = WIT(A) + WIT(B) + ... + WIT(Z) Useful Metrics
  51. 51. Sample Thresholds
  52. 52. Average Impact Time Average Impact Time is what indicates how well you have scaled your system Sample Thresholds
  53. 53. Maximum Impact Time In a worst-case scenario, a build won’t take longer than this. Sample Thresholds
  54. 54. Maximum Impact Time for Critical Components The same, but only for your most sensitive modules (log-in, payment gateway, etc.) Beware of dependencies! Sample Thresholds
  55. 55. Service Service Service Highest run frequency Lowest run frequency
  56. 56. Manual processing takes time...
  57. 57.  Most CI systems provide an API  Calculations aren’t complex  Multiple graphical tools available Automating Build Analysis
  58. 58. github.com/quiram/build-hotspots Build Hotspots
  59. 59. https://commons.wikimedia.org/wiki/File:2012_Italian_GP_-_Lotus_wheel.jpg
  60. 60. Thank You @EqualExper ts equal- experts equalexperts.com Thank You fromfragiletoagile.com @AbrahamMarin #FastCI

Notas do Editor

  • 2
  • 3
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 20
  • 21
  • 22
  • 27
  • 28
  • 36
  • EITHER BY FOLLOWING THIS, OR BECAUSE YOU HAVE IT, THE NEXT STEP IS MANAGING THE NETWORK
  • 38
  • As you can see, when your pipeline isn’t building fast enough, the trick is reshaping the architecture in a way that red builds are located towards the right. However, that is if you do need to make your pipeline more efficient, but do you need to?

    PERFORMANCE  ESTABLISH THRESHOLD, MEASURE, CHANGE IF ABOVE
  • 47
  • CALCULATE IN DIFFERENT WAYS, DEPENDING ON OUR PARALLEL EXECUTION CAPABILITIES
    If we don’t have the ability to run builds in parallel, then we’ll run A and then B and C (or C and B). In any case, the impact time will the sum of all of them.
    CLICK
  • If we allow parallel execution, then both B and C will be triggered at the same time after A, which means we’ll only have to wait for the slowest of the two.
    CLICK
  • If we allow parallel execution, then both B and C will be triggered at the same time after A, which means we’ll only have to wait for the slowest of the two.
    CLICK
  • Bear in mind these are only approximations. In real life it can be that your ability to run things in parallel is limited by total number of slaves (maybe you can only run up to 5 builds in parallel) or other shared resources (maybe you only have one staging database and two builds cannot get hold of it at the same time). But, despite being approximations, they are a good way to establish a baseline to track and compare.
    CLICK
  • There is something interesting to note about Impact Time, and is that this grows as you go up in the hierarchy. This graph shows the Build Time as the size of the bubbles, but the Impact Time of each bubble will include directly or indirectly that of its dependants. This means that the Parent POM file will be the build with the highest Impact Time, since whenever we change that build we have to rebuild absolutely everything. Now, is that a problem? Maybe not, because it’s also the least modified build (hence its colour). This leads us to conclude that we need to assess the relationship between Impact Time and Change Rate, which brings us to the next metric.
    CLICK
  • This value allows us to compare which builds are the ones causing the highest impact over a period of time, letting us know when an impactful build is infrequent enough so as not to be a problem. And then, by combining all the weighted impact times.
    CLICK
  • We get to the Average Impact Time, which will tell us how long, on average, it takes for our build system to rebuild all the necessary modules after a commit anywhere in the system. Now we’re really getting onto something, because now that we have all these metrics we have a way to define (CLICK) useful thresholds for us.
  • 57
  • 58
  • 59
  • 60
  • Now, let’s take a moment to reflect on all this. We’re defining metrics based on build duration, but also on change rate. And we are considering architectural changes, restructuring of modules, based on these data. But let’s take a closer look at this this temperature graph. It is driven by dependencies among builds, but also by where I am making changes. That means that some of the attributes of this graph will change over time as developers focus on different parts of the system so as to develop different features. That means that the optimal shape of the system will change according to the data of our build, and what was a good idea yesterday may not be so much today.

    Let’s also note that all these graphs are created manually. And I also had to do the analysis manually. I had to do these manually because there aren’t any tools (that I know of) that can provide this information for you. And, useful as this is, you can’t do it too often because CLICK manual processing takes time.
  • 63
  • 64
  • This is a F1 driving wheel. Only the wheel costs $30,000 to produce. Do you see all those buttons, dials and displays? A F1 car has tons of sensors all over the place that measure from the temperature of the tires, to the weight of the car (as it becomes lighter as it consumes fuel), to the aerodynamic forces experienced by different surfaces. All that data is analysed and presented to the driver, so the driver can adjust different parameters to adapt the performance of the car to the circumstances. This is the kind of approach that we need to take if we want a fast build pipeline: we need to measure, we need to analyse, and we need to spend time, effort and money to build the necessary tools to manage the pipeline. It can’t be a pet project. Now, if you’re interested in building this kind of tool, let’s have a chat.
    CLICK

    CI/CD can be your worst bottleneck
    Keeping your CI/CD fast is a performance tuning activity, approach it as such
    No proper tools available, help me build them
  • 66

×