Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(automation): Automate data extraction, MQTT communication, and v… #652

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
26448bf
feat(automation): Automate data extraction, MQTT communication, and v…
Mayank-glitch-cpu Jan 28, 2025
1e6b841
removed unnecessary print statements
Mayank-glitch-cpu Jan 29, 2025
3cf0dd2
made generic image name for docker compose
Mayank-glitch-cpu Jan 29, 2025
d35e558
Update makefile to create separate run-mqtt as request by brian
Sahilgr8 Jan 30, 2025
a70bbf2
removed spaces with TABS
Mayank-glitch-cpu Jan 31, 2025
cc654a5
modified Makefile to cater the dependencies issues
Mayank-glitch-cpu Jan 31, 2025
3c4e012
rectified the paho dependecies using venv
Mayank-glitch-cpu Jan 31, 2025
c12045a
catered paho dependencies
Mayank-glitch-cpu Jan 31, 2025
a0a4567
resolved the paho and TAB issues
Mayank-glitch-cpu Jan 31, 2025
b417ddd
resolved the paho dependencies without venv
Mayank-glitch-cpu Jan 31, 2025
a658b60
resolved python issues
Mayank-glitch-cpu Feb 4, 2025
3dcde5e
Merge branch 'main' into I-547
Mayank-glitch-cpu Feb 4, 2025
55b7064
resolving reviewdog issues
Mayank-glitch-cpu Feb 4, 2025
0f22d63
Merge branch 'I-547' of https://github.com/Mayank-glitch-cpu/automate…
Mayank-glitch-cpu Feb 4, 2025
43e514c
Merge branch 'main' into I-547
Mayank-glitch-cpu Feb 16, 2025
76fb6d9
Review Dog Flag: rebuild docker image
Mayank-glitch-cpu Feb 16, 2025
508d9b9
using public images
Mayank-glitch-cpu Feb 19, 2025
878e565
Merge branch 'main' into I-547
Mayank-glitch-cpu Feb 19, 2025
b7f7904
final edits done
Mayank-glitch-cpu Feb 19, 2025
32df080
Deleted Performance Tools
Mayank-glitch-cpu Feb 20, 2025
1542712
Restore performance-tools folder from commit 197209f
Mayank-glitch-cpu Feb 21, 2025
ea06d5a
1884-->1885, 3000-->3001, Docker container name changed
Mayank-glitch-cpu Feb 19, 2025
51ac6d0
Resolved issues flagged by review dog for files in mqtt/
Mayank-glitch-cpu Feb 24, 2025
77fcb00
Update Makefile
Mayank-glitch-cpu Feb 24, 2025
97e6fab
Update docker-compose.yml
Mayank-glitch-cpu Feb 24, 2025
7a3dd56
chore: Sync performance-tools @ 197209f
Mayank-glitch-cpu Feb 24, 2025
3a35a68
Addressed Paho import possible issue
Mayank-glitch-cpu Feb 24, 2025
f450b27
Updated Readme
Mayank-glitch-cpu Feb 24, 2025
c8c5c11
Update README.md
Mayank-glitch-cpu Feb 24, 2025
fc9e10a
Delete src/grafana-custom/dashboards/dashboards.yaml
Mayank-glitch-cpu Feb 24, 2025
854e66d
Dockerised Scripts
Mayank-glitch-cpu Feb 25, 2025
49dddf7
In Sync JSON dump of payload
Mayank-glitch-cpu Feb 25, 2025
fd08d35
updated Readme
Mayank-glitch-cpu Feb 25, 2025
c9f7a06
Merge branch 'main' into I-547
Mayank-glitch-cpu Feb 27, 2025
6c633b4
Resolved review dog issue
Mayank-glitch-cpu Feb 27, 2025
beb5053
Update Makefile
Mayank-glitch-cpu Feb 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Dockerfile.cpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.9-slim

WORKDIR /app

# Install dependencies
RUN apt-get update && apt-get install --no-install-recommends -y \
apt-transport-https \
ca-certificates \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*

# Install mosquitto-clients
RUN apt-get update && apt-get install --no-install-recommends -y mosquitto-clients \
&& rm -rf /var/lib/apt/lists/*

# Install Python packages
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r /app/requirements.txt

# Copy the application code
COPY . /app/

CMD ["bash", "-c", "python3 mqtt/publisher_intel.py"]
24 changes: 24 additions & 0 deletions Dockerfile.fps
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Dockerfile.mqtt
FROM python:3.9-slim

WORKDIR /app

# Install dependencies
RUN apt-get update && apt-get install --no-install-recommends -y \
apt-transport-https \
ca-certificates \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*

# Install mosquitto-clients
RUN apt-get update && apt-get install --no-install-recommends -y mosquitto-clients \
&& rm -rf /var/lib/apt/lists/*

# Install Python packages
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r /app/requirements.txt

# Copy the application code
COPY . /app/

CMD ["bash", "-c", "python3 mqtt/fps_extracter.py"]
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,39 @@ run-render-mode:

down:
docker compose -f src/$(DOCKER_COMPOSE) down
docker container stop grafana mqtt-broker
docker container rm grafana mqtt-broker

run-demo: | download-models update-submodules download-sample-videos
@echo "Building automated self checkout app"
$(MAKE) build
@echo Running automated self checkout pipeline
$(MAKE) run-render-mode


run-mqtt:
# Check if Python 3 is installed
@python3 --version || (echo "Python 3 is not installed. Please install Python 3 and try again." && exit 1)
# Ensure python points to python3
@sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1

# Build and start the Docker Compose services
docker compose up -d
rm -f performance-tools/benchmark-scripts/results/* 2>/dev/null
$(MAKE) benchmark-cmd

# Build and run the Python scripts container
docker build -t mqtt-scripts -f Dockerfile.fps .
docker build -t mqtt-scripts -f Dockerfile.cpu .
docker run -d --rm \
-v $(PWD)/performance-tools/benchmark-scripts/results:/app/results \
-v $(PWD)/mqtt:/app/mqtt \
mqtt-scripts
@echo "To view the results, open the browser and navigate to http://localhost:3000"
@echo "wait"

benchmark-cmd:
$(MAKE) PIPELINE_COUNT=$(PIPELINE_COUNT) DURATION=$(DURATION) DEVICE_ENV=$(DEVICE_ENV) RESULTS_DIR=$(RESULTS_DIR) benchmark

run-headless: | download-models update-submodules download-sample-videos
@echo "Building automated self checkout app"
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- [Manage Docker as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/)
- [Docker Compose v2](https://docs.docker.com/compose/) (Optional)
- Intel hardware (CPU, GPU, dGPU)
- Python 3

## QuickStart

Expand All @@ -34,6 +35,14 @@ stop containers:
make down
```

## Viewing Benchmark Results in Grafana Dashboard

To run the MQTT scripts and ensure that the necessary Python packages are installed, use the following command:

```
make run-mqtt
```

## [Advanced Documentation](https://intel-retail.github.io/documentation/use-cases/automated-self-checkout/automated-self-checkout.html)

## Join the community
Expand Down
45 changes: 45 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: '3.7'
services:
mqtt-broker_2:
image: eclipse-mosquitto:2.0.18
container_name: mqtt-broker_2
ports:
- "1885:1883"
volumes:
- ./mosquitto-custom/mosquitto.conf:/mosquitto/config/mosquitto.conf
restart: unless-stopped

grafana:
image: grafana/grafana:latest
container_name: my_grafana_1
environment:
- GF_INSTALL_PLUGINS=grafana-mqtt-datasource
volumes:
- ./grafana-custom/provisioning/dashboards/dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml
- ./grafana-custom/provisioning/datasource/mqtt-datasource.yaml:/etc/grafana/provisioning/datasources/mqtt-datasource.yaml
- ./grafana-custom/dashboards/:/var/lib/grafana/dashboards
ports:
- "3001:3000"
depends_on:
- mqtt-broker_2

mqtt-runner-1:
build:
context: .
dockerfile: Dockerfile.fps
container_name: fps-mqtt-runner-1
volumes:
- ./performance-tools/benchmark-scripts/results:/app/results
- ./mqtt:/app/mqtt # Mount your MQTT script directory if needed
restart: unless-stopped

mqtt-runner-2:
build:
context: .
dockerfile: Dockerfile.cpu
container_name: cpu-mqtt-runner-1
volumes:
- ./performance-tools/benchmark-scripts/results:/app/results
- ./mqtt:/app/mqtt # Mount your MQTT script directory if needed
restart: unless-stopped

Loading