Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup arax-backup.rtx.ai server (a backup server for the ARAX ARA andd KG2 API) #1671

Closed
saramsey opened this issue Sep 23, 2021 · 19 comments
Closed
Assignees

Comments

@saramsey
Copy link
Member

This idea came out of the mini-hackathon today.

@saramsey
Copy link
Member Author

saramsey commented Sep 23, 2021

I have provisioned an r5a.2xlarge instance (Ubuntu 18.04 AMI) named arax-backup.rtx.ai in us-west-2 with a root filesystem in a 1023 GiB EBS volume (AWS instance ID i-0f3589ffb64a0fb20). For the instance network security policy, I enabled security groups for inbound HTTPS (TCP port 443), HTTP (TCP port 80), and SSH (TCP port 22).

@saramsey
Copy link
Member Author

saramsey commented Sep 23, 2021

I assigned elastic IP address 44.236.84.186 to this instance.

@saramsey
Copy link
Member Author

saramsey commented Sep 23, 2021

I set up a DNS A record arax-backup.rtx.ai pointing to IP 44.236.84.186.

@saramsey
Copy link
Member Author

I temporarily updated the DNS A record arax.rtx.ai to point to IP 44.236.84.186.

@saramsey
Copy link
Member Author

I updated apt-get inside the instance and installed certbot, python-certbox-nginx, and emacs inside the instance (this installs nginx by dependency).

@saramsey
Copy link
Member Author

saramsey commented Sep 23, 2021

I set up @finnagin's RSA public key inside /home/ubuntu/.ssh/authorized_keys inside the instance. I also generated a public key /root/.ssh/id_rsa.pub using ssh-keygen and installed that public key in /home/sramsey/.ssh/authorized_keys on arax.ncats.io.

@saramsey
Copy link
Member Author

saramsey commented Sep 23, 2021

Inside the instance, I made a new directory /mnt/data and, using sftp -C, I copied the following files into it from arax.ncats.io:/translator/data/orangeboard/databases/KG2.7.3:

node_synonymizer_v1.0_KG2.7.3.sqlite 
meta_kg_v1.0_KG2.7.3c.json 
kg2c_v1.0_KG2.7.3.sqlite 
fda_approved_drugs_v1.0_KG2.7.3c.pickle 
curie_to_pmids_v1.0_KG2.7.3.sqlite 
config_local.json 
autocomplete_v1.0_KG2.7.3.sqlite 
GRAPH_v1.0_refreshed_KG2.7.3.sqlite DTD_probability_database_v1.0_refreshed_KG2.7.3.db 
COHDdatabase_v1.0_KG2.7.3.db

@saramsey
Copy link
Member Author

saramsey commented Sep 23, 2021

From the arax.ncats.io instance, I copied the config file /etc/nginx/sites-enabled/default to /home/ubuntu/default on arax-backup.rtx.ai. I edited the file changing arax.ncats.io to arax.rtx.ai throughout, and I changed /etc/nginx/dhparams.pem to /etc/ssl/certs/dhparam.pem. I installed that updated config file in /etc/nginx/sites-enabled/default on arax-backup.rtx.ai (the original version can be found in /etc/nginx/sites-available/default).

@saramsey
Copy link
Member Author

saramsey commented Sep 23, 2021

I generated a new file dhparam.pem by running (on arax-backup.rtx.ai, as root):

cd /etc/ssl/certs && openssl dhparam -out dhparam.pem 4096

@saramsey
Copy link
Member Author

saramsey commented Sep 23, 2021

I started nginx using

sudo service nginx start

and tested that TLS works for https://arax-backup.rtx.ai and https://arax.rtx.ai. TLS works fine, but of course, per the config file, it is TLS-terminated and redirects to port 8080 which is not currently working (yet) because we haven't set up the Docker container for ARAX, so we get a 502 HTTP status code (Bad Gateway Error).

@saramsey
Copy link
Member Author

Having verified that https://arax.rtx.ai works (connects to the backup server), I then updated the DNS A record for arax.rtx.ai to point back to the IP address for arax.ncats.io, since under normal circumstances we want arax.rtx.ai to point to the arax.ncats.io server.

@saramsey
Copy link
Member Author

Tagging @amykglen @finnagin so they are aware of the current status of the issue.

@saramsey
Copy link
Member Author

Copying over the synonymizer_artifacts subdirectory now...

@saramsey
Copy link
Member Author

OK, I believe I have copied over all the relevant files from /translator/data/orangeboard/databases/KG2.7.3 on arax.ncats.io to /mnt/data/orangeboard/databases/KG2.7.3 on arax-backup.rtx.ai.

@saramsey
Copy link
Member Author

So @finnagin you have the green-light to install ARAX on arax-backup.rtx.ai.

@finnagin
Copy link
Member

Update: I tried spinning up the merged dockerfile but ran into a few issues that may take a while to figure out how to fix. Since we are low on time I'm going to just spin up a container from an image of the container hosted on arax.ncats.io. Though, because this will take a little while and I have to shut down arax.ncats.io to do it I will wait until this evening to make the image.

@finnagin
Copy link
Member

I believe I now have arax-backup.rtx.ai up and running.

@finnagin
Copy link
Member

finnagin commented Sep 24, 2021

Though currently I cannot test the UI as when I try to connect via the url arax-backup.rtx.ai I get a 403 error.

@saramsey
Copy link
Member Author

Relay is over. arax-backup.rtx.ai is working, but now the instance is stopped to save AWS costs (we can just start the instance if we ever need to run the backup ARAX).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants