Development - ml-workgroup/image-segmentation-study-manager GitHub Wiki

Setup

In order to develop on this project it is advised to use a Docker environemnt, because this project uses a library which does not work yet on Windows. (uwsgi)

Having Docker installed, you can run ISSM following these steps:

  • Run cmd/sh and change your working directory into the cloned repository
  • Run docker build -t issm:latest -t issm:0.1 . => This will build the image, name it 'issm' create an additional tag named 0.1 (the current version). Mind to change the version which is used in docker-compose_prod.yml file to the version you just built
  • After completion, make sure that the issm image is available with docker images (should be on the top)

Now there are 2 possibilities how to run the image, either on command line with docker run [...] or with docker-compose. If you prefer docker run then adapt the settings from the docker-compose files in the root of this github repository.

Docker Compose Setup

If you are using docker-compose you can use the docker-compose files in the root directory of the repository.

Development

Use docker-compose_dev.yml for development.

It initializes the database, adds dummy data and starts the flask server which will then be available at http://localhost:5000. Initially the accounts [email protected] (PW: admin), [email protected] (PW: reviewer) and [email protected] (PW: user) are avaiable. Also 2 projects with each 50 images, 50 manual segmentation masks and 50 automatic segmentation masks (from automatic segmentation models) are created as dummy data.

Productive

Use docker-compose_prod.yml for productive environment.

It does not initialize the database with dummy data but it will create an initial technical admin account from the environment parameters ADMIN (the email address of the technical admin) and ADMIN_PW (the password of the technical admin).

Hot Reload

In Development you will notice that we are mounting the directory ./app from our current directory into the container. Mounting parts of the github repository is necessary to make changes to the code immediately effective for your deployed instance of ISSM.

Also we are mounting the local directory ./data into the container folder /data. This means we can directly see the project folders as well as the database file in our host system, in case we want to debug something on those files.

Run ISSM

Now that we have our docker-compose file, we can run the following command to...

start ISSM DEV: docker-compose -f docker-compose_dev.yml up -d stop ISSM DEV: docker-compose -f docker-compose_dev.yml down

start ISSM PROD: docker-compose -f docker-compose_prod.yml up -d stop ISSM PROD: docker-compose -f docker-compose_prod.yml down