-
Notifications
You must be signed in to change notification settings - Fork 464
Implementation
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.
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.
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
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.
- Create an image folder inside the datasets directory called
temp
. Note this will map the directory inside the container to/data/datasets/temp
. - Place folders or images inside this folder (using windows folder explorer)
- Create an interactive bash shell on the container (annotator must be running).
$ docker exec -it annotator_webclient bash
- 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/