Skip to content
Robert C. Alfredson edited this page Oct 13, 2020 · 11 revisions

Project Structure

Production Build

Development Build

Users

Web Server

The web server is built on top of Flask and uses Eventlet along with gunicorn to handle concurrent networking for two important services. Firstly, it serves the web client to user via HTML and JavaScript. Secondly, every operation a user executes is handled by the web server. When requests that require long execution are called, the web server pass them to the workers instance, via RabbitMQ. This allows the server to handle thousands of requests per seconds without delays to other users.

Web Client

Written in JavaScript (Vuejs) and served by the Web Server, the client directory holds the static files which make calls the backend REST API to interact with the database.

Workers

Distributed Task Queue

Database

Database Volume

The Docker builds uses a volume to store data generated by the database. Although the use of volumes may be confusing for a user not familiar with docker, it provides many advantages over folder mounts.

  • Migration and creating backups are easier
  • Volumes are compatible with both Linux and Windows containers
  • Allows for multiple instances of the application to use the same data

If a user would like to re-install COCO Annotator the task becomes more complicated since the data from the database will be carried from container to container. If you simply delete the application's folder annotations, categories and datasets will still carry over to the new installation. In order to fully remove the database such that all database entries are deleted a user can remove the Docker volume using the command shown below. It is important the Docker container is not running well executing this command.

Listing 1: Docker command for removing volume

$ docker volume rm --force coco-annotator_mongodb_data

Known Issues

Windows File Watcher

Due to limitations of CIFS implementation in Linux kernel, file change events in mounted folders of a host are not propagated to a container by Docker for Windows (source). You can install docker-windows-volume-watcher or move the images into the datasets directory from within the container as shown below.

Moving Images within a Container

  1. Create an image folder inside the datasets directory called temp. Note this will map the directory inside the container to /data/datasets/temp.
  2. Place folders or images inside this folder (using windows folder explorer)
  3. Create an interactive bash shell on the container (annotator must be running).
$ docker exec -it annotator_webclient bash
  1. Move the folders or images into the proper datasets folder from within the interactive bash shell terminal
$ mv /data/datasets/temp/some_image_folder /data/datasets/SomeDataset/