Skip to content

CI Home

cnbennett3 edited this page Oct 17, 2019 · 8 revisions

Continuous Integration


CI is the practice of Continuous Integration. It's a collection of practices that let development teams deliver code changes frequently and reliably. This allows developers to quickly develop small implementation changes and check them into version control more regularly.

CI establishes an automated process for building, packaging, and testing applications. This leads to a consistent integration process, which accelerates code commits, catches errors earlier, and increases software quality. Earlier software commits also increase the ability of developers to collaborate easily on code development.


Source

Source for all projects is kept in GitHub. Here are links to current CI-capable projects:

The README.md file in each repo contains more information on which files to edit. This is important since both BioNames and Onto live in the same repo.


Build

Currently, all CI-based projects are Python-based and thus not compiled, so the build process consists of installing software dependencies and then running tests to verify the build.

The Travis CI Continuous Integration platform is used for automated builds. Each commit to one of the GitHub repositories mentioned above starts a build which is followed by a suite of unit tests. The user is notified of the result so they may commit a fix if necessary.

The Travis build script for each project is in a hidden dot file called .travis.yml. For TranQL, this file is located at NCATS-Tangerine/tranql/.travis.yml. The BioNames and Onto .travis.yml file is located at NCATS-Tangerine/reasoner-tools/.travis.yml.


Containers

Project containers are kept in the DockerHub registry in the renciorg organization. There are repositories set up under the renciorg organization for each project.

Project containers are built from scripts. Build scripts for BioNames, Onto, and TranQL are kept in the GitHub container repository: NCATS-Tangerine/green-compose.

The build command is comp. It is available at /bin/comp in NCATS-Tangerine/green-compose/bin/comp. The comp command is used to build a project's container, to push it to DockerHub, and can be also be used to run a container. In addition, it can also be used to build and push multiple projects at once.

While the automated builds build on a remote server, the manual build builds a docker container in your local directory. The local container can then be run normally using Docker commands (for more information, see the docker run command).

Note that the latest version of each project is always available on DockerHub. It can be downloaded and run without having to build it or download code from GitHub using docker run.


Testing

Testing is an integral part of Continuous Integration. It starts with the build and continues with unit, system, and uptime testing on the deployed software. This determines the sanity of code submissions based on their freedom from regression issues and pass rate on new tests created along with the development of new code. As noted below, code coverage is also run following unit tests to determine how thoroughly the code has been tested.

Unit Tests

White box unit tests have been written in Pytest for BioNames, Onto, and TranQL.

These tests run after every commit which successfully builds in Travis-CI. To the extent possible, each method or function is exercised by at least one corresponding test function which exercises the full code of that function. They may also be executed manually, as detailed on the README.md page in the repo.

System and Availability Tests

Jenkins and Behave are used to automate testing the availability of production TranQL and it's Reasoners, which include ROBOKOP, ICEES, RTX, and Indigo.

Jenkins triggers hourly for each Reasoner. It does a git pull, builds TranQL, and then launches a series of queries through TranQL for that Reasoner. Jenkins sends the queries through the Behave testing framework, which then checks the responses which come back for specific values.

If any of the queries fails, an email is sent so that the cause can be determined.

Because these tests flow from the TranQL API to its backplane to the Reasoner and back, they thoroughly exercise the system.


Code Coverage

The CI process includes code coverage, which automatically follows the unit testing phase. It runs automatically after the unit tests following every Travis build. It uses pytest and/or coverage and then posts the results to coveralls, which is free code coverage tool for open source users.


Documentation

The latest practical documentation for editing and running the projects is in the README.md file associated with each project. It is always stored in the top level directory of the project's GitHub repository.

CI documentation is kept in this wiki.

There is historical documentation, as well as an overview and a user manual for TranQL (aka Translator) at https://researchsoftwareinstitute.github.io/data-translator/, as well as the Reasoners that it uses.