Skip to content

Commit

Permalink
Docker compose build works
Browse files Browse the repository at this point in the history
  • Loading branch information
lext committed Dec 11, 2019
1 parent aa919ca commit 7dc3fa4
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 111 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ Codes for paper **Automatic Knee Osteoarthritis Diagnosis from Plain Radiographs

# Disclaimer

**This branch is made only for inference purposes. Re-training is possible only in the master branch!!!**
**This branch is only for inference purposes. Re-training is possible only in the master branch!!!**

### Running the backend server
### Running the software
This code requires the fresh-most docker and docker compose installed.

Execute `sh deploy.sh cpu` to deploy the app on CPU. If you have installed nvidia-docker,
you can also deploy on GPU. The inference is 3 times faster on GPU. To deploy on GPU, run `sh deploy.sh gpu`.

Be careful, this app carries all the dependencies and weighs around 10GB in total.

# Technical documentation

## License
This code is freely available only for research purposes. Commercial use is not allowed by any means.
The provided software is not cleared for diagnostic purposes.

## How to cite
```
Expand Down
7 changes: 5 additions & 2 deletions docker/UIDockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM node:10

ARG $DEPLOY_PORT
ENV REACT_APP_BROKER_PORT $DEPLOY_PORT
ARG REACT_APP_BROKER_PORT
ARG REACT_APP_BROKER_ADDR

ENV REACT_APP_BROKER_PORT $REACT_APP_BROKER_PORT
ENV REACT_APP_BROKER_ADDR $REACT_APP_BROKER_ADDR

WORKDIR /usr/src/app
COPY . .
Expand Down
34 changes: 34 additions & 0 deletions docker/docker-compose-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
image: "miptmloulu/kneel:cpu"
ports:
- "5000:5000"
container_name: kneel
volumes:
- type: bind
source: ../snapshots_release_kneel # The snapshots are stored in the root directory
Expand All @@ -23,6 +24,7 @@ services:
image: "miptmloulu/deepknee:cpu"
ports:
- "5001:5001"
container_name: deepknee
volumes:
- type: bind
source: ../snapshots_knee_grading/ # The snapshots are stored in the root directory
Expand All @@ -37,3 +39,35 @@ services:
"--snapshots_path", "/snapshots/", "--device", "cpu", "--deploy", "True",
"--port", "5001",
"--logs", "/logs/deepknee-cpu.log"]
backend-broker:
depends_on:
- kneel
- deepknee-backend
build:
context: ../deepknee-backend-broker
dockerfile: ../docker/BrokerDockerfile
container_name: backend-broker
ports:
- "5002:5002"
environment:
- DEPLOY_HOST=0.0.0.0
- DEPLOY_PORT=5002
- KNEEL_ADDR=http://kneel
- KNEEL_PORT=5000
- DEEPKNEE_ADDR=http://deepknee-backend
- DEEPKNEE_PORT=5001
entrypoint: ["node", "/usr/src/app/server.js"]
ui:
depends_on:
- kneel
- deepknee-backend
- backend-broker
build:
context: ../deepknee-frontend
dockerfile: ../docker/UIDockerfile
args:
- REACT_APP_BROKER_PORT=5002
container_name: ui
ports:
- "5003:5003"
entrypoint: ["serve", "-l", "5003", "-s", "/usr/src/app/build"]
18 changes: 11 additions & 7 deletions docker/docker-compose-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
image: "miptmloulu/kneel:gpu"
ports:
- "5000:5000"
container_name: kneel
volumes:
- type: bind
source: ../snapshots_release_kneel # The snapshots are stored in the root directory
Expand All @@ -22,9 +23,10 @@ services:
runtime: nvidia
depends_on:
- kneel
image: "miptmloulu/kneel:gpu"
image: "miptmloulu/deepknee:gpu"
ports:
- "5001:5001"
container_name: deepknee
volumes:
- type: bind
source: ../snapshots_knee_grading/ # The snapshots are stored in the root directory
Expand All @@ -36,9 +38,9 @@ services:
environment:
- KNEEL_ADDR=http://kneel:5000
entrypoint: ["python", "-m", "ouludeepknee.inference.app",
"--snapshots_path", "/snapshots/",
"--device", "cuda", "--deploy", "True",
"--port", "5001", "deploy_addr", "0.0.0.0",
"--snapshots_path", "/snapshots/",
"--device", "cuda", "--deploy", "True",
"--port", "5001", "--deploy_addr", "0.0.0.0",
"--logs", "/logs/deepknee-gpu.log"]
backend-broker:
depends_on:
Expand All @@ -47,15 +49,16 @@ services:
build:
context: ../deepknee-backend-broker
dockerfile: ../docker/BrokerDockerfile
container_name: backend-broker
ports:
- "5002:5002"
environment:
- DEPLOY_HOST=0.0.0.0
- DEPLOY_PORT=5002
- KNEEL_ADDR=http://kneel
- KNEEL_PORT=5000
- DEEPKNEE_ADDR=http://deepknee-backend
- DEEPKNEE_PORT=5001
- DEPLOY_HOST=0.0.0.0
- DEPLOY_PORT=5002
entrypoint: ["node", "/usr/src/app/server.js"]
ui:
depends_on:
Expand All @@ -66,7 +69,8 @@ services:
context: ../deepknee-frontend
dockerfile: ../docker/UIDockerfile
args:
- DEPLOY_PORT=5002
- REACT_APP_BROKER_PORT=5002
container_name: ui
ports:
- "5003:5003"
entrypoint: ["serve", "-l", "5003", "-s", "/usr/src/app/build"]
7 changes: 7 additions & 0 deletions rebuild_docker_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# DeepKnee REST microservice images
docker build -t miptmloulu/deepknee:gpu -f docker/Dockerfile.gpu .
docker build -t miptmloulu/deepknee:cpu -f docker/Dockerfile.cpu .
docker push miptmloulu/deepknee:cpu && docker push miptmloulu/deepknee:gpu

# Frontend and Backend broker
30 changes: 0 additions & 30 deletions run_experiments_antony.sh

This file was deleted.

40 changes: 0 additions & 40 deletions run_experiments_own.sh

This file was deleted.

30 changes: 0 additions & 30 deletions run_experiments_resnet.sh

This file was deleted.

0 comments on commit 7dc3fa4

Please sign in to comment.