-
Notifications
You must be signed in to change notification settings - Fork 0
Setup of rdt server on docker
Welcome to the rdt-reader wiki!
How to setup rdt server on docker:
Pre-requisite:
-
Please use an Ubuntu machine and make sure docker is installed. Please use Python 3.6
-
Git LFS is also required. Follow these instructions:
sudo curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bashsudo apt-get install git-lfssudo git lfs install
This is required to load some of the models.
Steps:
- 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
- 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.
-
Now, we need to start an instance of this docker image. Do:
docker run -d -p 9000:9000 iprd-rdt-reader -
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)
-
The server is now up and running. Verify by running: http://IP:9000/health-check and make sure you get an “OK” in response.
-
For docker containers, you may run:
docker exec -u 0 -it <docker container id> /bin/bashto login to the docker container as root. Use the container id from the previous step.
Possible errors and resolution:
-
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.
-
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.
-
Missing packages - either tensorflow or sqlparse. Make sure tensorflow is installed. If not, run: conda install -c anaconda tensorflow-mkl.
-
For any other execution errors, please check python version number (can be obtained by running python3 -V)
-
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.
-
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:
-
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.
-
https://github.com/DigitalHealthIntegration/rdt-reader: Github repo
-
https://docs.docker.com/. Please read this for any general docker related stuff.