Deploying industrial computer vision requires a reproducible local workstation configuration. In this guide, you will learn how to set up edge AI inference environment nodes for real-time industrial visual inspection. Therefore, you can validate your GPU runtime, launch containerized services, and execute offline test suites confidently.
1. System Requirements & Host Prerequisites
To set up edge AI inference environment nodes successfully, your host machine must meet baseline specifications. Specifically, these hardware and software baselines ensure deterministic execution:
| Component | Minimum Requirement | Recommended |
|---|---|---|
| Operating System | Ubuntu 22.04 / 24.04 LTS | Ubuntu 22.04 LTS |
| GPU / Acceleration | NVIDIA GPU (Turing, Ampere, Ada, or Jetson Xavier/Orin) with CUDA 12+ drivers | Dedicated RTX / Tesla GPU or Jetson Orin |
| RAM | 8 GB | 16 GB |
| Disk Space | 64 GB free | 128 GB SSD |
| Container Engine | Docker Engine 27+ with Docker Compose v2 | Docker Engine + NVIDIA Container Toolkit (nvidia-ctk) |
| Languages | Python 3.10+, Rust toolchain (cargo, rustc 1.80+) | Python 3.11, Rust stable |
Verifying the NVIDIA Container Toolkit
Before booting containers, also confirm that Docker interfaces with your host GPU properly. For example, run this diagnostic command inside your terminal:
docker run --rm --gpus all nvidia/cuda:12.2.0-base-ubuntu22.04 nvidia-smi
If the terminal displays driver versions, CUDA levels, and GPU model details, your GPU passthrough functions correctly. However, if this command fails, install the NVIDIA Container Toolkit before proceeding.
2. Setting Up Environment Variables Securely
All runtime configuration parameters reside inside a root .env file. Consequently, managing this file carefully prevents security leaks.
Step 1: Restrict File Permissions
First, create the file and lock down its filesystem permissions:
touch .env
chmod 600 .env
[!IMPORTANT] Because
chmod 600 .envrestricts read and write access exclusively to your active user account. Also, never commit.envinto version control.
Step 2: Configure Critical Credentials
Next, populate your .env file with required baseline configurations:
# --- Central Cloud IoT Credentials ---
CLOUD_API_BASE_URL=https:app.domain.com
CLOUD_API_KEY=your-api-key-here
EDGE_DEVICE_TOKEN=your-device-token
# --- S3 / Object Storage Configuration ---
S3_ENDPOINT_URL=http://127.0.0.1:18000
S3_ACCESS_KEY=your-s3-access-key
S3_SECRET_KEY=your-s3-secret-key
S3_HOSTNAME=localhost
S3_PORT=18000
FRAME_IMAGE_BUCKET=your-image-bucket-name
# --- Database & Experiment Tracking ---
POSTGRES_DB=inspection_orchestrator
POSTGRES_USER=postgres
POSTGRES_PASSWORD=generate-a-strong-password
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
MLFLOW_ADMIN_USERNAME=admin
MLFLOW_ADMIN_PASSWORD=generate-a-strong-mlflow-password
MLFLOW_FLASK_SERVER_SECRET_KEY=generate-a-secret-flask-key
MLFLOW_HTTP_PORT=8080
# --- Edge Telemetry & Event Broker ---
LOCAL_MQTT_HOST=127.0.0.1
LOCAL_MQTT_PORT=1884
In particular, these parameters enable local microservices to communicate seamlessly with databases, storage, and messaging brokers.
3. Provisioning the NVIDIA Hardware Profile
Never configure inference hardware variables manually. Instead, execute the repository hardware provisioning script directly:
chmod +x ./select-hardware.sh
./select-hardware.sh
What the Hardware Selector Does
The script probes system PCI buses using lspci to detect installed NVIDIA graphics cards. When it detects NVIDIA silicon, the script writes these profile variables into .env:
COMPOSE_PROFILES=nvidia
INFERENCE_ENGINE=deepstream
INFERENCE_ENGINE_URL=http://localhost:8088
If you attempt to launch Docker Compose without selecting hardware, startup aborts immediately:
INFERENCE_ENGINE: Run ./select-hardware.sh before Docker Compose
This safeguard prevents running mismatched runtime configurations on the factory floor.
4. How to Set Up Edge AI Inference Environment Stacks
The repository provides two distinct Compose profiles depending on your operational goals:
Option A: Running the Factory Edge Inference Node
For example, this baseline command launches the core edge appliance services. Specifically, it starts the DeepStream inference server, the edge orchestrator bridge, the MQTT broker, embedded S3 storage, and the OTA daemon:
docker compose up -d --build
docker compose ps
Subsequently, inspect the live logs from the DeepStream inference server:
docker compose logs -f deepstream-server
Because these services run with minimal footprint, they provide continuous 24/7 inference reliability on production lines.
Option B: Running the ML Training Overlay Stack
When you wish to set up edge AI inference environment nodes with training capabilities, apply the feature flag overlay:
docker compose \
-f docker-compose.yml \
-f docker-compose.training.yml \
up -d --build
This extended command boots PostgreSQL, the orchestrator API, dataset curation tools, and MLflow experiment tracking. Therefore, you can train and evaluate new detection models directly on the edge node.
5. Service Map & Health Check Endpoints
After booting your containers, verify service health by probing these local network endpoints:
| Service | Port / URL | Health / Verify Command |
|---|---|---|
| DeepStream Server | http://127.0.0.1:8088 | curl -s http://127.0.0.1:8088/health/ready |
| RustFS S3 API | http://127.0.0.1:18000 | curl -s http://127.0.0.1:18000/health |
| RustFS Web Console | http://127.0.0.1:18001 | Browser UI (Log in with configured S3 credentials) |
| Orchestrator API | http://127.0.0.1:8091 | curl -s http://127.0.0.1:8091/health/ready |
| Dataset Curator | http://127.0.0.1:8092 | curl -s http://127.0.0.1:8092/health |
| MLflow UI | http://127.0.0.1:8080 | Browser UI (Log in with configured MLflow credentials) |
| Sensor Inference API | http://127.0.0.1:8093 | curl -s http://127.0.0.1:8093/health/ready |
Each command returns an HTTP status code confirming subsystem readiness:
6. Running Verified Offline Tests
The repository decouples unit tests from live external dependencies. Consequently, you can execute automated tests without starting live MQTT, PostgreSQL, or S3 brokers.
1. Vision Export Verification Test
This Python test confirms that model exporters isolate Intel OpenVINO artifacts from NVIDIA TensorRT packages:
python3 -m unittest tests/test_model_export.py
Furthermore, this test validates that exporters create the required DeepStream primary inference configuration (ds_pgie_config.txt).
2. Rust Services Compilation & Static Checks
Next, evaluate the Rust control plane crates without spinning up background containers:
cargo fmt --all -- --check
cargo clippy --workspace --all-targets
cargo test --workspace
Consequently, these commands enforce formatting standards, catch lint issues, and execute test assertions across the workspace.
7. Top 5 Setup Pitfalls & Verified Fixes
Here are the top five setup hurdles engineers encounter during initial workstation configuration:
1. Compose Fails on Unset Hardware
- Symptom: When Docker Compose throws an environment validation error on
INFERENCE_ENGINE. - Cause: Your
.envlacksINFERENCE_ENGINEorINFERENCE_ENGINE_URLvalues. - Fix: Specifically, run
./select-hardware.shto configure your profile.
2. DeepStream Fails with Missing libcudart.so
- Symptom: When container logs show
RuntimeError: libcudart.so not found in any candidate path. - Cause: Docker lacks GPU runtime hooks or the host lacks the NVIDIA Container Toolkit.
- Fix: In response, confirm
runtime: nvidiaappears indocker-compose.yml, then restart the Docker daemon.
3. WebRTC Video Stream Times Out
- Symptom: If the browser displays a continuous loading spinner or triggers ICE timeouts.
- Cause: Host firewall rules block WebRTC UDP traffic, preventing Coturn traversal.
- Fix: Instead, adjust firewall rules as detailed in standard network troubleshooting procedures:
sudo ufw disableAlternatively, open UDP ports8554,8889, and3478directly.
4. Missing Host System Utilities
- Symptom: Setup scripts fail with
ERROR: jq is not installed. Cannot parse JSON payload. - Cause: The host workstation lacks standard CLI JSON parsing tools.
- Fix: Therefore, install missing utilities using apt:
sudo apt-get update && sudo apt-get install -y jq curl unzip
5. RustFS S3 Connection Refused
- Symptom: Training workers report
EndpointConnectionErrorconnecting tohttp://host.docker.internal:18000. - Cause: Linux Docker bridge networks fail to resolve the host gateway alias.
- Fix: In contrast, verify
extra_hosts: ["host.docker.internal:host-gateway"]remains intact indocker-compose.training.yml.
Recap
- Always protect your
.envfile usingchmod 600to prevent credential exposure. - Furthermore, execute
./select-hardware.shto configure NVIDIA acceleration automatically. - Launch the base stack for inference, or include
-f docker-compose.training.ymlfor training tasks. - You can setup edge AI inference environment nodes with high confidence by querying local health endpoints.
- In addition, offline test suites validate model export pipelines without requiring live external brokers.
Glossary
| Term | Meaning |
|---|---|
| NVIDIA Container Toolkit | Allows Docker containers to interface with host NVIDIA GPUs via CUDA |
| Compose Profile | Docker Compose mechanism (--profile nvidia) to start only specific services |
| Feature Flag Overlay | An auxiliary Compose file (docker-compose.training.yml) merged at runtime |
| UFW | Uncomplicated Firewall on Ubuntu systems |
host.docker.internal | Special DNS name mapping container network requests to host loopback interfaces |
Engineering Deep Dive Challenges
- Verify host GPU access: Run
nvidia-smiinside a disposable Docker container to confirm GPU passthrough. - Inspect hardware selection logic: Inspect
./select-hardware.shto see how it writesCOMPOSE_PROFILES=nvidia. - Execute model export tests: Run
python3 -m unittest tests/test_model_export.pyand inspect test outputs. - Probe live service health: Launch the base stack with
docker compose up -dand querycurl http://127.0.0.1:8088/health/ready. - Analyze network port bindings: Run
docker compose psand examine which services bind to localhost versus public interfaces.

