Skip to content

Decent CI Cheat Sheet

Alex Swindler edited this page Jan 6, 2018 · 13 revisions

CI Cheat Sheet

General Notes

  • CI system uses decent_ci which is hosted on github at https://github.com/lefticus/decent_ci
  • --disable-ssl-verification is necessary when behind a restrictive firewall, and helpful in general on Windows due to outdated ssl certs shipping with ruby.

Configuration

CI Configuration files exist in the root of a repository, with the filenames .decent_ci* They can be highly configured based on operating system and OS version.

Results Tracking

CI expects to post its output to a github hosted gh-pages repository. This output repository is defined in the top level .decent_ci.yaml file (example). These repositories are https://github.com/NREL/OpenStudioBuildResults and https://github.com/NREL/EnergyPlusBuildResults.

The result pages are rendered by the github Jekyllrb engine and posted to http://nrel.github.io/OpenStudioBuildResults/index.html and http://nrel.github.io/EnergyPlusBuildResults/index.html respectively.

Cleanup Process

Be sure to note that at the top of each page is a link to the "full results" which shows history older than 5 days old. Also, the CI tries to keep itself clean. Every 24 hours a cleanup task is run that deletes old / stale data. This task is kept track of just like any other build result, with a DailyTask file posted to the results repository.

  • Any Pending build that is > 24 hours old is deleted to allow the build to restart automatically.
  • Any results for a deleted branch or tag are deleted automatically
  • At most 10 results per build configuration per branch are allowed. Anything greater than 10 is deleted, keeping the newest results
  • If the repository has more than 900 results posted already, then the max allowed results is 8 per configuration per branch. GitHub has issues with returning greater than 1000 files in a given directory, so if the results directory gets full, a cascade of problems happens.

Debugging CI Issues

The most common question is "is the CI still up and running?" If it looks like the result pages haven't been updated in a while, follow these steps to debug what might be going on:

  1. Check the results repositories, _posts sub folders, to see what the CI is up to; here and here.
  2. A commit message of "Commit initial build results..." indicates that the CI has started a build.
  3. An updated results file with a message of "Commit final build results..." indicates that the CI has completed a particular build.
  4. You can look at these initial / final postings to see what the CI has done recently.
  5. If a repository has > 1000 files in the _posts folder the CI system is unable to communicate with github properly and posts will be continuously re-run.

If these things check out and the system just seems to not be running, it's likely that it's simply down. Check to make sure the computer is up and the processes are running.

If it is running, but things are still not working, you can try running the CI locally in test mode. Clone https://github.com/lefticus/decent_ci locally and execute it in test mode:

ruby ./ci.rb ci_runs true <githubkey> <repositoryname> <aws keys if building EnergyPlus>

The CI can read several environment variables that exist for testing purposes:

  • DECENT_CI_BRANCH_FILTER - regex for which filters / tags to build
  • DECENT_CI_COMPILER_FILTER - regex for which compiler configurations to build
  • DECENT_CI_SKIP_DAILY_TASKS - if true, the daily cleanup task is not run
  • DECENT_CI_SKIP_REGRESSIONS - if true, regressions are not run
  • DECENT_CI_SKIP_TEST - if true, tests are not run

Maintaining CI Updates

The run_ci.rb script referenced below automatically does an update of the decent_ci repository with each execution, making sure to stay up to date with the latest changes.

The master framework for the results website exists in https://github.com/lefticus/decent_ci_results. To update the results pages with bug fixes / layout changes:

git clone https://github.com/NREL/OpenStudioBuildResults
cd OpenStudioBuildResults
git pull https://github.com/lefticus/decent_ci_results gh-pages
git push origin gh-pages

and for EnergyPlus

git clone https://github.com/NREL/EnergyPlusBuildResults
cd EnergyPlusBuildResults
git pull https://github.com/lefticus/decent_ci_results gh-pages
git push origin gh-pages

New CI Build System Checklist

Reference Sources

https://github.com/NREL/EnergyPlus/wiki/Continuous-Integration https://github.com/lefticus/decent_ci https://github.com/NREL/OpenStudio/blob/develop/doc/ContinuousIntegration.md

Linux

  • Install dependencies for OpenStudio and EnergyPlus

    sudo apt-get update
    sudo apt-get dist-upgrade
    sudo apt-get install dpkg-dev git cmake-curses-gui qt5-default libqt5webkit5-dev libboost1.55-all-dev ruby2.0 libssl-dev libxt-dev doxygen graphviz ruby2.0-dev python2.7 python-pip cppcheck gfortran ttf-mscorefonts-installer valgrind
  • Install EnergyPlus 8.3 (Required for OpenStudio)

    wget https://github.com/NREL/EnergyPlus/releases/download/v8.3.0/EnergyPlus-8.3.0-6d97d074ea-Linux-x86_64.sh
    sudo sh EnergyPlus-8.3.0-6d97d074ea-Linux-x86_64.sh
  • Install clang-3.5

    sudo su
    wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|apt-key add -
    apt-add-repository 'deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.5 main'

apt-get install clang-3.5 exit


- Install python modules
```sh
sudo apt-get install python3 python3-yaml python3-matplotlib
  • Install python pip modules

    sudo pip install boto gitpython pygithub
  • Install ruby modules

    sudo gem2.0 install octokit activesupport le
  • Install tools for running coverage. Note that coverage can only work with gcc right now due to compiler limitations.

    sudo apt-get install lcov gcovr
  • Clone ci runner

    git clone https://gist.github.com/10914850.git run_ci
  • Run ci

    cd run_ci
    ruby2.0 ./run_ci.rb ci_runs  --disable-ssl-verification --aws-access-key-id=<aws-key> --aws-secret-access-key=<aws-secretkey>  --logentries-key=<key> false <githubkey> NREL/EnergyPlus NREL/OpenStudio
  • Install latest pandoc https://github.com/jgm/pandoc/releases

  • Install latest wkhtmltopdf http://wkhtmltopdf.org/downloads.html

Windows

Mac