Skip to content

CI system (via GitHub actions)

Amy Glen edited this page Oct 21, 2022 · 15 revisions

Overview

Every commit to master automatically runs our ARAX Pytest suite on an EC2 instance via Github Actions (using a "self-hosted runner").

This is what determines the passing/failing 'Test Build' badge in our GitHub repo.

The EC2 instance this automatic testing is done on is cicd.rtx.ai; it should be left running all the time. Ask another dev if you need access to this instance.

Starting and stopping the runner

The runner should always be left running, but in the event you need to start it, do the following:

ssh ubuntu@cicd.rtx.ai
cd actions-runner/
sudo ./svc.sh start

If instead you just want to see its status, use this command:

sudo ./svc.sh status

And if you need to stop the runner for some reason (we don't typically do this), use this command:

sudo ./svc.sh stop

More details/how-tos for the runner software are here.

The runner's workflow

With every run, the runner does a fresh build of ARAX and RTX-KG2 via Docker from the master branch. It uses the "merged" Dockerfile (at RTX/code/DockerBuild/Merged-Dockerfile).

The exact steps the runner takes are defined in the config file at RTX/.github/workflows/pytest.yml.

Note that, as part of its workflow, the runner automatically:

  1. Downloads the necessary config_secrets.json file
  2. Takes care of downloading all necessary databases from arax.ncats.io; it also takes care of removing any databases it no longer needs (i.e., that no longer appear in config_dbs.json in the master branch) ***
    • Thus you do not need to worry about uploading database files or config files to cicd.rtx.ai, nor worry about it running out of disk space
    • Note that database files are not repeatedly downloaded with every run; instead, they are downloaded into their proper KG2 subdirectory in /mnt/data/orangeboard/databases only once (if not already present)
  3. Creates a kg2_url_override.txt file that ensures ARAX will use the KG2 API on localhost (i.e., on cicd.rtx.ai)

*** NOTE: Step 2 is not quite working automatically currently (see issue #1914). Until that issue is addressed, any time the contents of config_dbs.json changes in master, someone needs to go onto cicd.rtx.ai and manually run the Database Manager's database update method. Steps to do that are the following:

ssh ubuntu@cicd.rtx.ai
cd RTX/
git pull origin master
python3 code/ARAX/ARAXQuery/ARAX_database_manager.py --mnt --skip-if-exists --remove_unused