ranking-agent / strider

A TRAPI-compliant component of ARAGORN that queries distributed KPs and assembles answers to user questions.
MIT License
3 stars 0 forks source link
ara ncats-translator trapi

Strider

A web service and API for Strider, the knowledge-provider querying, answer generating, ranking module of ARAGORN.

This service accepts a biomedical question as a Translator reasoner standard message and asynchronously generates results in the same format.

Demonstration

A live version of the API can be found here.

Local Development

Management Script

The codebase comes with a zero-dependency python management script that can be used to automate basic local development tasks. Make sure you have docker and docker-compose installed and then run:

./manage.py dev # starts server accessible at 5781
./manage.py test # run tests
./manage.py coverage # run tests, open coverage report in browser

Without Management Script

The management script is a simple alias for docker-compose commands. To run a dev environment without it you can use:

docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build

This will start the requisite containers as well as the strider container. Changes made locally will update the container while running.

You can also run tests and coverage reports withou the management script. Check the manage.py file for instructions on how to do this.

Profiler

The local development environment also includes a built-in profiler for debugging performance issues. To use this, set PROFILER=true in a .env file in the root of the repository. Once the application is running the profiler will automatically be run on all incoming requests. To view profiles you can visit localhost:5781/profiles, which will give you a list of the captured profiles. These captured profiles can be used with the snakeviz utility to easily diagnose performance issues.

Testing

Documentation for testing can be found in the tests README. Additional high level testing architecture overview can be found in the docs folder.

Deployment

A docker-compose file is included for easy deployment. To use, you also must set up a .env file to specify some configuration options:

example:

KPREGISTRY_URL=http://robokop.renci.org:4983
OMNICORP_URL=http://robokop.renci.org:3210
OPENAPI_SERVER_URL=https://strider.renci.org/

After creating this at the root of the repository you can run:

docker-compose -f docker-compose.yml -f docker-compose.prod.yml up --build

Usage

http://<HOST>:5781/docs

Documentation

High level documentation can be found in the docs folder.