Skip to content

Setup of rdt server on docker

anandRIyer edited this page Jan 21, 2020 · 13 revisions

Welcome to the rdt-reader wiki!

How to setup rdt server on docker:

Pre-requisite:

  1. Please use an Ubuntu machine and make sure docker is installed. Please use Python 3.6

  2. Git LFS is also required. Follow these instructions: sudo curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash sudo apt-get install git-lfs sudo git lfs install

This is required to load some of the models.

Steps:

  1. Create a folder /home/rdtreader/ and download the git repository: https://github.com/DigitalHealthIntegration/rdt-reader.git

Make sure you do a recursive clone: git clone --recurse-submodules https://github.com/DigitalHealthIntegration/rdt-reader.git

  1. Now go to the folder /home/rdtreader/rdt-reader and run: docker image build -f ./Dockerfile -t iprd-rdt-reader . (please pay attention to the dot/period in the end)

This sets up the docker image required for the setup: iprd-rdt-reader. Verify by running docker images and check if you see iprd-rdt-reader.

  1. Now, we need to start an instance of this docker image. Do: docker run -d -p 9000:9000 iprd-rdt-reader

  2. Verify that the docker container is up and running by doing: docker ps. From the output of docker ps, get the container id (the first column in the result) (If you do not see this container listed at all, pls do: docker ps -a to see if it crashed)

  3. The server is now up and running. Verify by running: http://IP:9000/health-check and make sure you get an “OK” in response.

  4. For docker containers, you may run: docker exec -u 0 -it <docker container id> /bin/bash to login to the docker container as root. Use the container id from the previous step.

Possible errors and resolution:

  1. Sometimes, there may be an error while trying to download the packages from the anaconda/conda-forge portals in case of patchy internet. Make sure you use a stable internet in that case.

  2. Your shell has not been properly configured to use 'conda activate'. To initialize your shell, run

    $ conda init <SHELL_NAME>

This means the shell has not been initialized properly. As mentioned in the error, run the above command and close the shell and restart.

  1. Missing packages - either tensorflow or sqlparse. Make sure tensorflow is installed. If not, run: conda install -c anaconda tensorflow-mkl.

  2. For any other execution errors, please check python version number (can be obtained by running python3 -V)

  3. Make sure that the rdt git root is set correctly. For that, please see: /home/rdtreader/rdt-reader/settings.py and /home/rdtreader/rdt-reader/django_server/api/settings.py and see if the RDT_GIT_ROOT is set right. By default, it should be "/home/rdtreader/rdt-reader". If you decide to use something else, make sure this is set correctly.

  4. Sometimes, due to errors while cloning the git repository, we may see issues in the tensorflow-yolov3 folder. Ex: in tensorflow-yolov3-models/models/Flu_audere/1 folder, we should see a file saved_model.pb which should be about 900 KB. If less than that, it probably indicates there was an issue.

Solution: Please download the following files: https://drive.google.com/drive/u/0/folders/1mKZWs4f0DvjgrwUp4wBRcr1QMYfASyBM Extract the contents of these zip files to the following folders: Flu_audere.zip: /rdt-reader/tensorflow-yolov3-models/models/Flu_audere/1 Flu_audere_line.zip: /rdt-reader/tensorflow-yolov3-models/models/Flu_audere_line/1 After this, make sure you copy the contents of tensorflow-yolov3-models/models sub folder in tensorflow-yolov3/.

Useful references:

  1. https://digitalhealthintegration.github.io/rdt-reader/. This is the RDT reader wiki site. It outlines steps required for setting up the rdt server. However, it does not cover much of docker stuff.

  2. https://github.com/DigitalHealthIntegration/rdt-reader: Github repo

  3. https://docs.docker.com/. Please read this for any general docker related stuff.

Clone this wiki locally