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)...

In the meantime, you can get the modified config files ready for the kg2 and kg2beta endpoints (on arax.ncats.io); you need versions of them that point to this Plover instead of the ITRB Plover.

To update the kg2 endpoint's config file:

ssh [email protected]
cd /translator/data/orangeboard/kg2/RTX/code

Then, in config_local.json, replace every instance of https://kg2cploverdb.ci.transltr.io with http://kg2-7-4cplover.rtx.ai:9990. (You may want to save a copy of config_local.json before editing it.)

To update the kg2beta endpoint's config file:

First update the master copy of configv2.json by logging onto the proper ec2 instance:

And then changing every instance of https://kg2cploverdb.ci.transltr.io --> http://kg2-7-4cplover.rtx.ai:9990 in the configv2.json in the home directory. (Note that it's good practice to save a copy of configv2.json before you start editing it.)

Now force kg2beta to download the updated copy of configv2.json:

ssh [email protected]
cd /translator/data/orangeboard/kg2beta/RTX/code
rm configv2.json

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

Clone this wiki locally