githubtraining / ci-circle

Course repo for Learning Lab course "Continuous Integration with CircleCI". Template repo ➡
https://github.com/githubtraining/ci-circle-template
Creative Commons Attribution 4.0 International
3 stars 9 forks source link

Investigate circle config.yml for build performance #59

Closed ppremk closed 5 years ago

ppremk commented 5 years ago

While testing noticed that the build step takes a little long before it starts running the testlink step. Will need to dive in the config.yml file steps to see what is going on there before proposing a fix or suggestion.

ppremk commented 5 years ago

Initial findings:


version: 2.1
executors:
  ci-executor:
    docker:
      - image: circleci/ruby:2.4.1-node-browsers

jobs:
  build:
    executor: ci-executor
    steps:
      - checkout

      - run:
          name: install dependencies
          command: bundle install

      - run:
          name: build the jekyll site
          command: bundle exec jekyll build

      - run:
          name: notify build is finished
          command: echo "The build is finished!"

  testlinks:
    executor: ci-executor
    steps:
      - checkout

      - run:
          name: install dependencies
          command: bundle install

      - run:
          name: build the jekyll site
          command: bundle exec jekyll build

      - run:
          name: run html proofer
          command: bundle exec htmlproofer ./_site --check-html

workflows:
  version: 2.1

  build_and_test:
    jobs:
      - build
      - testlinks:
          requires:
            - build
           # filters:
           # branches:
           #   only: master
brianamarie commented 5 years ago

@ppremk I've gone through the template repository and changed the config file on each branch to have the matching changes based on your above example. I'm going to reimport the course template repository, and try happy path. Hopefully everything will be working, and working faster! 😄

hectorsector commented 5 years ago

40 can also speed up the build, I just worry about adding so much complexity to the config.

ppremk commented 5 years ago

Reducing the jobs to 1 does not have a big difference in the duration taken to execute the build and test

screenshot 2018-12-19 at 21 57 09
ppremk commented 5 years ago

40 can also speed up the build, I just worry about adding so much complexity to the config.

Thanks @hectorsector i've also tinkered with the caching part. Where it takes too much time is the installing dependencies part where it is at an average 1.10~ minutes

I will look into a docker images which might have all the dependencies installed.. that could be an option.. but we will need to first test it.

I am also 💯 with you on not introducing complexity to the config. 🙂

ppremk commented 5 years ago

@brianamarie the following changes has very slight improvements

screenshot 2018-12-20 at 12 57 43
brianamarie commented 5 years ago

👋 @ppremk I'm hoping to update the template repository today with the final versions of the config. What's the latest version that we should use?

ppremk commented 5 years ago

👋 @brianamarie here are the latest progress and updates:


version: 2.1
executors:
  ci-executor:
    docker:
      - image: githubtraining/ci-custom:latest

jobs:
  build:
    executor: ci-executor
    steps:
      - checkout

      - run:
          name: build dependencies
          command: bundle install

      - run:
          name: build the jekyll site
          command: bundle exec jekyll build

      - run:
          name: notify build is finished
          command: echo "The build is finished!"

  testlinks:
    executor: ci-executor
    steps:
      - checkout

      - run:
          name: build dependencies
          command: bundle install

      - run:
          name: build the jekyll site
          command: bundle exec jekyll build

      - run:
          name: notify build is finished
          command: echo "The build is finished!"

      - run:
          name: run html proofer
          command: bundle exec htmlproofer ./_site --check-html

      - run:
          name: notify test is finished
          command: echo "The test is completed!"

workflows:
  version: 2.1

  build_and_test:
    jobs:
      - build
      - testlinks:
          requires:
            - build

Feel free to close this issue once you have completed the actions items mentioned in #75 🙂

brianamarie commented 5 years ago

Thank you SO MUCH @ppremk! Build times are so much improved. I'm going to close this now. 🎉 🎉 🎉

screen shot 2018-12-21 at 13 15 08