{"id":262,"date":"2010-06-21T09:30:11","date_gmt":"2010-06-21T09:30:11","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2010\/06\/21\/how-we-reduced-build-time-from-8-hours-to-1-hour\/"},"modified":"2017-12-29T13:27:18","modified_gmt":"2017-12-29T13:27:18","slug":"how-we-reduced-build-time-from-8-hours-to-1-hour","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-we-reduced-build-time-from-8-hours-to-1-hour\/","title":{"rendered":"How we reduced build time from 8 hours to 1 hour ? &#8211; Complete Guide"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4425 aligncenter\" src=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2010\/06\/hudson-master-slave-setup.png\" alt=\"hudson-master-slave-setup\" width=\"600\" height=\"400\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2010\/06\/hudson-master-slave-setup.png 600w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2010\/06\/hudson-master-slave-setup-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><strong>Situation<\/strong><\/p>\n<ol>\n<li>For one of our clients, Build is taking 8 hours and nightly build is failing frequently.<\/li>\n<li>Test case execution is consuming more time than the compilation.<\/li>\n<li>Low confidence levels for developers on nightly builds and subsequently during integration cycle.<\/li>\n<\/ol>\n<p><strong>Approach<\/strong><\/p>\n<ol>\n<li>We reviewed the whole set of build scripts being used and test case suite to check how we can refatcor them.<\/li>\n<li>Verified the build infrastructure i.e., build server capacity from hardware point of view.<\/li>\n<li>Feasibility study done to check how a CI environment help in giving faster feedback on the quality.<\/li>\n<\/ol>\n<p><strong><br \/>\nSolution<\/strong><\/p>\n<ol>\n<li>Refactoring done for build scripts to make modules compilation parallel (wherever possible).<\/li>\n<li>Some test cases are selected (which don\u2019t require external services like database) to run as part of the build.<\/li>\n<li>CI environment (using open source cruise control) is established to run builds per commit and execute only above set of test cases as part of the build.<\/li>\n<li>Set up low-cost remote agent machine which will run remaining test suite once per day.<\/li>\n<\/ol>\n<p><strong>Results<\/strong><\/p>\n<ol>\n<li>Build took only 1 hour and gave faster feedback to dev team.<\/li>\n<li>CI environment provided good confidence to dev team.<\/li>\n<li>Team is able to implement more best practices.<\/li>\n<li>Effective use of existing build\u00a0 infrastructure (hardware) ensured no further cost is required.<\/li>\n<li>This helped the client in ensuring smooth release management.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Situation For one of our clients, Build is taking 8 hours and nightly build is failing frequently. Test case execution is consuming more time than the compilation&#8230;. <\/p>\n","protected":false},"author":1,"featured_media":4425,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[4255,4252,4254,4257,1122,3113,4253,1806,4256,4240,593,4251,4258,104,1452],"class_list":["post-262","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorised","tag-build-process-time","tag-build-time","tag-build-time-optimization","tag-decrease-build-time","tag-guide","tag-how-to","tag-how-to-reduced-build-time","tag-instruction","tag-lessen-build-time","tag-method","tag-process","tag-reduce","tag-save-build-time","tag-tutorials","tag-ways"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=262"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/262\/revisions"}],"predecessor-version":[{"id":4427,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/262\/revisions\/4427"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/4425"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}