Docker Deployment, ARAX - RTXteam/RTX GitHub Wiki

Name and Description

ARAX

A tool for querying, manipulating, filtering, and exploring biomedical knowledge graphs. It is designed to be a type of middleware—an autonomous relay agent—within the Translator system. The top-level layer of Translator (which is called the autonomous relay system) will issue structured queries to ARAX via ARAX's web application programming interface. Then, based on the query type, ARAX will determine which knowledge providers it needs to consult in order to be able to answer the query; ARAX will then query the required knowledge providers, synthesize the information that it gets from those queries, and respond to the top-level layer in a standardized structured data format.

GitHub path

Docker file is located at at RTX/DockerBuild/Dockerfile

Configuration File

The configuration file must be placed within the container at the following path:

/mnt/data/orangeboard/production/RTX/code/config_secrets.json

Database files

Database files including their parent directory should be placed inside the container at the following path:

/mnt/data/orangeboard/databases/

I.E. if a database file database.sqlite is stored in the KG2.5.2 directory it should be placed inside the container as:

/mnt/data/orangeboard/databases/KG2.5.2/database.sqlite

Build and Configuration

Ensure that the host machine has a minimum of 64 GB of RAM and 600GB of available disk space. We currently use a m5a.4xlarge AWS EC2 instance.

To configure the host machine do the following:

  1. Ensure that docker and git are installed
  2. Ensure that SSL certifications set up on the host machine and that a port is open to be bound to port 80 inside the container. (for the purposes of this documentation we will use port 8080)
  3. ensure nginx is installed and configured with a similar configuration file (paths, server names, ect changed to match host machine configuration) Or setup something similar using a different software/service:
map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
    listen 80;
    server_name <newserver>;
    return 302 https://$host$request_uri;
}

server {
    listen 443 ssl;
    ssl on;

    server_name <newserver>;
    root /etc/nginx/www;

    ssl_certificate             /etc/letsencrypt/live/<newserver>/fullchain.pem;
    ssl_certificate_key         /etc/letsencrypt/live/<newserver>/privkey.pem;
    ssl_protocols               TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers   on;
    ssl_ciphers                 "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
    ssl_ecdh_curve              secp384r1;
    ssl_session_timeout         1d;
    ssl_session_cache           shared:SSL:50m;
    ssl_dhparam                 /etc/nginx/dhparam.pem;
    ssl_stapling                on;
    ssl_stapling_verify         on;

    add_header    Strict-Transport-Security   max-age=15768000;

    server_tokens         off;

    location /.well-known {
    	try_files $uri $uri/ =404;
        add_header 'Access-Control-Allow-Origin' '*';
    }
    
    location / {
	proxy_read_timeout 3000s;
        add_header 'X-Frame-Options' 'SAMEORIGIN';
	proxy_buffering off;

	include proxy_params;
	proxy_pass http://localhost:8080;
	proxy_set_header  X-Forwarded-Proto $scheme;
	proxy_set_header  X-Real-IP         $remote_addr;
	proxy_set_header  X-Forwarded-For   $proxy_add_x_forwarded_for;
	proxy_set_header  X-Real-IP-AWS	    $remote_addr;
    }
}

To build a new docker image:

  1. clone the RTX repo git clone https://github.com/RTXteam/RTX.git
  2. Build the docker image docker build --no-cache --rm -t arax:1.0 ./RTX/DockerBuild/
  3. Run the container docker run -d -it --name arax -p 8080:80 arax:1.0
  4. Ensure that both the configuration file and database files are placed in the correct locations inside the container as detailed above.
  5. From inside the container run the following to create the correct symlinks to the database files:
su rt && cd /mnt/data/orangeboard/production/RTX && python3 code/ARAX/ARAXQuery/ARAX_database_manager.py
  1. Run the following from inside the container as root to start the service:
service apache2 start
service RTX_OpenAPI_production start

Testing

To test that the system is working correctly run the following inside the container:

su rt && cd /mnt/data/orangeboard/production/RTX/code/ARAX/test && pytest -v
⚠️ **GitHub.com Fallback** ⚠️