Skip to content

Deployment how tos

Amy Glen edited this page Jan 5, 2023 · 38 revisions

To build Plover from new KG2 version

(Note: This example is for KG2.7.6, but the steps should be analogous for future KG2 versions.)

First update the default KG2 version in the newkg2version branch like so:

git fetch
git checkout newkg2version

In app/kg_config.json, change "kg2c_lite_2.7.5.json.gz" to "kg2c_lite_2.7.6.json.gz", or whatever exactly the new KG2c JSON file is called in the translator-lfs-artifacts repo. Push this change to the newkg2version branch.

Then start the kg2cplover.rtx.ai ec2 instance and run the following:

ssh [email protected]
cd PloverDB/
git checkout newkg2version
git pull origin newkg2version
bash -x run.sh ploverimage2.7.6 plovercontainer2.7.6 "sudo docker"

This will take around 50 minutes to finish.

After it's done, verify it's working by running the test suite against it. From your own machine (assuming you have cloned the PloverDB repo and done pip install -r requirements.txt):

cd PloverDB/
pytest -v test/test.py --endpoint http://kg2cplover.rtx.ai:9990

Note that sometimes tests need to be updated due to changes in the KG2 version, though the majority of tests should pass. For any failing tests, ensure they're failing due to expected topological changes in the new KG2 version; if so, tweak them to get them passing again (via adjusting pinned curies, predicates, or whatever makes sense).

When we're ready for the ITRB CI Plover instance to be running this new KG2 version, merge the newkg2version branch into main. This should automatically deploy to the ITRB CI Plover. Ping Kanna to update the ITRB Prod and Test Plovers.

To start our Plover instance when ITRB's Plover is down

(Note: This example is for KG2.7.4, but the steps should be analogous for future KG2 versions.)

Start the kg2cplover.rtx.ai ec2 instance and run the following:

ssh [email protected]
cd PloverDB/
sudo docker start plovercontainer2.7.4

If the above gave some sort of error, instead try this:

sudo docker stop plovercontainer2.7.4
sudo docker rm plovercontainer2.7.4
sudo docker run -d --name plovercontainer2.7.4 -p 9990:80 ploverimage2.7.4

Wait about 5 minutes for the indexes to finish loading. You can check the logs with:

sudo docker logs plovercontainer2.7.4

When it's ready the last few lines of the log should look something like this:

2022-03-02 00:25:58,807 INFO: Indexes are fully loaded! Took 5.27 minutes.
WSGI app 0 (mountpoint='') ready in 317 seconds on interpreter 0x pid: 11 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 11)
spawned uWSGI worker 1 (pid: 14, cores: 1)
spawned uWSGI worker 2 (pid: 15, cores: 1)
running "unix_signal:15 gracefully_kill_them_all" (master-start)...

While you're waiting for the above command to finish, you can point the ARAX code to this Plover instead of the ITRB Plover:

  1. Change all three Plover URLs in the "plover" slot of RTX/code/config_dbs.json to this Plover endpoint (http://kg2-7-4cplover.rtx.ai:9990)
  2. Push that change to master
  3. Roll master out to the /kg2 and /kg2beta endpoints on arax.ncats.io

At this point, once Plover has finished loading indexes, /kg2 and /kg2beta should be running normally again.

Clone this wiki locally