Skip to content

Latest commit

 

History

History
60 lines (37 loc) · 3.84 KB

DOCKER_COMPOSE_DEPLOYMENT.MD

File metadata and controls

60 lines (37 loc) · 3.84 KB

Deploy on Docker ('docker compose')

Make sure you have installed and configured docker in your environment. After that, you can run the below commands from the solution's root directory and get started trying it.

Grab the GitHub repo code

Get the GitHub repo's code:

git clone git@github.com:Azure/mec-app-solution-accelerator.git

(Optional step) Set the DOCKER_REGISTRY environment variable

Before creating the Docker images it's important to setup the DOCKER_REGISTRY environment variable in your dev system (Windows / Linux) so the images will be created with the right prefix (i.e. Docker hub user). This is important if you later want to use the same Docker images to upload them into Docker Hub or any other Docker Registry from where you will deploy the images to Kuberentes.

Here you have additional information on why and How to setup the DOCKER_REGISTRY environment variable.

But if you just want to try the solution with docker compose up or Visual Studio, this step is optional, as it should work locally, anyways.

Build the Docker images

Now, build the Docker images with docker compose build:

docker compose build

image

You could directly have run docker compose up (the next step), so if the images were not built already they will be built in the first place, but this step using docker compose build is intentional so you learn how you can just create the Docker images for other deployments such as Kubernetes, without habing to run it first into a Docker host.

Run the solution

You start the containers and run the solution in yoour local docker host with this command:

docker compose up

You should see 'docker compose up' starting like in the following screenshot: image

Wait until all containers are up and running and you start seeing traces related to detections performed by the AI model and events raised because of them, like in the following screenshot: image

Whats going on under the covers?

When the containers are running, the process starts with the FrameSplitter service/s which is ingesting the video feed from the video sources. In the "out-of-the-box" example code, the video comes from a local video file, but you can change that video source, with the configuration in docker-compose.override.yml and use any RTSP feed uri from real video cameras or from a fake RTSP provided by a VM simulating a video camera.

Then the image frames are sent to the AI model microservice which is detecting the target issues/objects. When that happens, events are published through the MQTT broker (pub/sub pattern) and the subscribers get it in order to evaluate if alerts should be raised depending on alerts rules. If alerts are raised thorugh Pub/Sub, then hte alerts will appear in the Alerts Dashboard UI.

Alerts Dashboard UI web app

At this point, you should be able to run the "Alerts Dashboard" web app with the following URL in any browser:

http://localhost:1002
image

Note that the same alerts could be reaching to other systems such as additional IoT devices, machinery to react or any other alert systems, all of them getting the same alert events based on the Publish/Subscription pattern using the MQTT message broker.