Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# EI_AUDIO_CLASSIFICATION_MODEL = path to the model file
# CUSTOM_MODEL_PATH = path to the custom model directory
services:
ei-audio-classifier-runner:
image: ${DOCKER_REGISTRY_BASE:-ghcr.io/arduino/}app-bricks/ei-models-runner:0.6.0
Expand Down
13 changes: 13 additions & 0 deletions src/arduino/app_bricks/audio_classification/brick_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,16 @@ requires_model: true
model: glass-breaking
model_configuration_variables:
- EI_AUDIO_CLASSIFICATION_MODEL
variables:
- name: EI_AUDIO_CLASSIFICATION_MODEL
description: Path to the model file
hidden: true
default_value: /models/ootb/ei/glass-breaking.eim
- name: CUSTOM_MODEL_PATH
description: Path to the custom model directory
hidden: true
default_value: /home/arduino/.arduino-bricks/ei-models
- name: BIND_ADDRESS
description: Bind address
hidden: true
default_value: 127.0.0.1
7 changes: 1 addition & 6 deletions src/arduino/app_bricks/dbstorage_tsstore/brick_compose.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# BIND_ADDRESS = external container address
# BIND_PORT = container port
# DB_USERNAME = Edge Impulse project API key
# DB_PASSWORD = Database password
# INFLUXDB_ADMIN_TOKEN = InfluxDB admin token
services:
dbstorage-influx:
image: influxdb:2.7
Expand All @@ -12,7 +7,7 @@ services:
max-size: "5m"
max-file: "2"
ports:
- "${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-8086}:8086"
- "${BIND_ADDRESS:-127.0.0.1}:8086:8086"
volumes:
- "${APP_HOME:-.}/data/influx-data:/var/lib/influxdb2"
environment:
Expand Down
16 changes: 15 additions & 1 deletion src/arduino/app_bricks/dbstorage_tsstore/brick_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,18 @@ id: arduino:dbstorage_tsstore
name: Database - Time Series
description: "Simplified time series database storage layer for Arduino sensor samples built on top of InfluxDB."
requires_container: true
category: storage
category: storage
variables:
- name: DB_USERNAME
description: Database username
default_value: admin
- name: DB_PASSWORD
description: Database password
default_value: Arduino15
- name: INFLUXDB_ADMIN_TOKEN
description: InfluxDB admin token
default_value: 392edbf2-b8a2-481f-979d-3f188b2c05f0
- name: BIND_ADDRESS
description: External container address
hidden: true
default_value: 127.0.0.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# EI_CLASSIFICATION_MODEL = path to the model file
# CUSTOM_MODEL_PATH = path to the custom model directory
services:
ei-classification-runner:
image: ${DOCKER_REGISTRY_BASE:-ghcr.io/arduino/}app-bricks/ei-models-runner:0.6.0
Expand Down
13 changes: 13 additions & 0 deletions src/arduino/app_bricks/image_classification/brick_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,16 @@ requires_model: true
model: mobilenet-image-classification
model_configuration_variables:
- EI_CLASSIFICATION_MODEL
variables:
- name: EI_CLASSIFICATION_MODEL
description: Path to the model file
hidden: true
default_value: /models/ootb/ei/mobilenet_v2_1.0_224_image_classification.eim
- name: CUSTOM_MODEL_PATH
description: Path to the custom model directory
hidden: true
default_value: /home/arduino/.arduino-bricks/ei-models
- name: BIND_ADDRESS
description: Bind address
hidden: true
default_value: 127.0.0.1
2 changes: 0 additions & 2 deletions src/arduino/app_bricks/keyword_spotting/brick_compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# EI_KEYWORD_SPOTTING_MODEL = path to the model file
# CUSTOM_MODEL_PATH = path to the custom model directory
services:
ei-keyword-spot-runner:
image: ${DOCKER_REGISTRY_BASE:-ghcr.io/arduino/}app-bricks/ei-models-runner:0.6.0
Expand Down
13 changes: 13 additions & 0 deletions src/arduino/app_bricks/keyword_spotting/brick_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@ requires_model: true
model: keyword-spotting-hey-arduino
model_configuration_variables:
- EI_KEYWORD_SPOTTING_MODEL
variables:
- name: EI_KEYWORD_SPOTTING_MODEL
description: Path to the model file
hidden: true
default_value: /models/ootb/ei/keyword-spotting-hey-arduino.eim
- name: CUSTOM_MODEL_PATH
description: Path to the custom model directory
hidden: true
default_value: /home/arduino/.arduino-bricks/ei-models
- name: BIND_ADDRESS
description: Bind address
hidden: true
default_value: 127.0.0.1
2 changes: 0 additions & 2 deletions src/arduino/app_bricks/motion_detection/brick_compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# EI_MOTION_DETECTION_MODEL = path to the model file
# CUSTOM_MODEL_PATH = path to the custom model directory
services:
ei-motion-detection-runner:
image: ${DOCKER_REGISTRY_BASE:-ghcr.io/arduino/}app-bricks/ei-models-runner:0.6.0
Expand Down
13 changes: 13 additions & 0 deletions src/arduino/app_bricks/motion_detection/brick_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,16 @@ requires_model: true
model: updown-wave-motion-detection
model_configuration_variables:
- EI_MOTION_DETECTION_MODEL
variables:
- name: EI_MOTION_DETECTION_MODEL
description: Path to the model file
hidden: true
default_value: /models/ootb/ei/updown-wave-motion-detection.eim
- name: CUSTOM_MODEL_PATH
description: Path to the custom model directory
hidden: true
default_value: /home/arduino/.arduino-bricks/ei-models
- name: BIND_ADDRESS
description: Bind address
hidden: true
default_value: 127.0.0.1
5 changes: 2 additions & 3 deletions src/arduino/app_bricks/object_detection/brick_compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# EI_OBJ_DETECTION_MODEL = path to the model file
# CUSTOM_MODEL_PATH = path to the custom model directory
services:
ei-obj-detection-runner:
image: ${DOCKER_REGISTRY_BASE:-ghcr.io/arduino/}app-bricks/ei-models-runner:0.6.0
Expand All @@ -13,7 +11,7 @@ services:
group_add:
- "render"
ports:
- ${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-1337}:1337
- ${BIND_ADDRESS:-127.0.0.1}:1337:1337
volumes:
- "${CUSTOM_MODEL_PATH:-/home/arduino/.arduino-bricks/ei-models}:${CUSTOM_MODEL_PATH:-/home/arduino/.arduino-bricks/ei-models}"
command: ["--model-file", "${EI_OBJ_DETECTION_MODEL:-/models/ootb/ei/yolo-x-nano.eim}", "--run-http-server", "1337", "--dont-print-predictions"]
Expand All @@ -22,3 +20,4 @@ services:
interval: 2s
timeout: 2s
retries: 25

15 changes: 14 additions & 1 deletion src/arduino/app_bricks/object_detection/brick_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,17 @@ requires_container: true
requires_model: true
model: yolox-object-detection
model_configuration_variables:
- EI_OBJ_DETECTION_MODEL
- EI_OBJ_DETECTION_MODEL
variables:
- name: EI_OBJ_DETECTION_MODEL
description: Path to the model file
hidden: true
default_value: /models/ootb/ei/yolox-object-detection.eim
- name: CUSTOM_MODEL_PATH
description: Path to the custom model directory
hidden: true
default_value: /home/arduino/.arduino-bricks/ei-models
- name: BIND_ADDRESS
description: Bind address
hidden: true
default_value: 127.0.0.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# EI_CLASSIFICATION_MODEL = path to the model file
# CUSTOM_MODEL_PATH = path to the custom model directory
services:
ei-video-classification-runner:
image: ${DOCKER_REGISTRY_BASE:-ghcr.io/arduino/}app-bricks/ei-models-runner:0.6.0
Expand All @@ -13,7 +11,7 @@ services:
volumes:
- "${CUSTOM_MODEL_PATH:-/home/arduino/.arduino-bricks/ei-models/}:${CUSTOM_MODEL_PATH:-/home/arduino/.arduino-bricks/ei-models/}"
- "/run/udev:/run/udev"
command: ["--model-file", "${EI_CLASSIFICATION_MODEL:-/models/ootb/ei/mobilenet-v2-224px.eim}", "--dont-print-predictions", "--mode", "streaming", "--preview-original-resolution", "--camera", "${VIDEO_DEVICE:-/dev/video1}"]
command: ["--model-file", "${EI_V_CLASSIFICATION_MODEL:-/models/ootb/ei/mobilenet-v2-224px.eim}", "--dont-print-predictions", "--mode", "streaming", "--preview-original-resolution", "--camera", "${VIDEO_DEVICE:-/dev/video1}"]
healthcheck:
test: [ "CMD-SHELL", "wget -q --spider http://ei-video-classification-runner:4912 || exit 1" ]
interval: 2s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,21 @@ required_devices:
- camera
model: mobilenet-image-classification
model_configuration_variables:
- EI_CLASSIFICATION_MODEL
- EI_V_CLASSIFICATION_MODEL
variables:
- name: EI_V_CLASSIFICATION_MODEL
description: Path to the model file
hidden: true
default_value: /models/ootb/ei/mobilenet_v2_1.0_224_image_classification.eim
- name: CUSTOM_MODEL_PATH
description: Path to the custom model directory
hidden: true
default_value: /home/arduino/.arduino-bricks/ei-models
- name: BIND_ADDRESS
description: Bind address
hidden: true
default_value: 127.0.0.1
- name: VIDEO_DEVICE
description: Video device path
hidden: true
default_value: /dev/video1
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# EI_OBJ_DETECTION_MODEL = path to the model file
# CUSTOM_MODEL_PATH = path to the custom model directory
services:
ei-video-obj-detection-runner:
image: ${DOCKER_REGISTRY_BASE:-ghcr.io/arduino/}app-bricks/ei-models-runner:0.6.0
Expand All @@ -13,7 +11,7 @@ services:
volumes:
- "${CUSTOM_MODEL_PATH:-/home/arduino/.arduino-bricks/ei-models/}:${CUSTOM_MODEL_PATH:-/home/arduino/.arduino-bricks/ei-models/}"
- "/run/udev:/run/udev"
command: ["--model-file", "${EI_OBJ_DETECTION_MODEL:-/models/ootb/ei/yolo-x-nano.eim}", "--dont-print-predictions", "--mode", "streaming", "--preview-original-resolution", "--camera", "${VIDEO_DEVICE:-/dev/video1}"]
command: ["--model-file", "${EI_V_OBJ_DETECTION_MODEL:-/models/ootb/ei/yolo-x-nano.eim}", "--dont-print-predictions", "--mode", "streaming", "--preview-original-resolution", "--camera", "${VIDEO_DEVICE:-/dev/video1}"]
healthcheck:
test: [ "CMD-SHELL", "wget -q --spider http://ei-video-obj-detection-runner:4912 || exit 1" ]
interval: 2s
Expand Down
19 changes: 18 additions & 1 deletion src/arduino/app_bricks/video_objectdetection/brick_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,21 @@ required_devices:
- camera
model: yolox-object-detection
model_configuration_variables:
- EI_OBJ_DETECTION_MODEL
- EI_V_OBJ_DETECTION_MODEL
variables:
- name: EI_V_OBJ_DETECTION_MODEL
description: Path to the model file
hidden: true
default_value: /models/ootb/ei/yolox-object-detection.eim
- name: CUSTOM_MODEL_PATH
description: Path to the custom model directory
hidden: true
default_value: /home/arduino/.arduino-bricks/ei-models
- name: BIND_ADDRESS
description: Bind address
hidden: true
default_value: 127.0.0.1
- name: VIDEO_DEVICE
description: Video device path
hidden: true
default_value: /dev/video1
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# EI_V_ANOMALY_DETECTION_MODEL = path to the model file
# CUSTOM_MODEL_PATH = path to the custom model directory
services:
ei-obj-video-anomalies-det-runner:
image: ${DOCKER_REGISTRY_BASE:-ghcr.io/arduino/}app-bricks/ei-models-runner:0.6.0
Expand Down
13 changes: 13 additions & 0 deletions src/arduino/app_bricks/visual_anomaly_detection/brick_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,16 @@ requires_model: true
model: concrete-crack-anomaly-detection
model_configuration_variables:
- EI_V_ANOMALY_DETECTION_MODEL
variables:
- name: EI_V_ANOMALY_DETECTION_MODEL
description: Path to the model file
hidden: true
default_value: /models/ootb/ei/concrete-crack-anomaly-detection.eim
- name: CUSTOM_MODEL_PATH
description: Path to the custom model directory
hidden: true
default_value: /home/arduino/.arduino-bricks/ei-models
- name: BIND_ADDRESS
description: Bind address
hidden: true
default_value: 127.0.0.1
2 changes: 1 addition & 1 deletion src/arduino/app_internal/core/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def parse_docker_compose_variable(variable_string) -> List[tuple[str, str]] | st

Args:
variable_string: The string to parse (e.g., "${DATABASE_HOST:-db}",
"${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-8086}:8086"), "${DATABASE_PASSWORD}".
"${BIND_ADDRESS:-127.0.0.1}:8086:8086"), "${DATABASE_PASSWORD}".

Returns:
A list of tuple containing the variable name and the default value (if present), or the original
Expand Down
2 changes: 1 addition & 1 deletion src/arduino/app_tools/module_listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def to_dict(self) -> dict:
if self.require_container:
var_to_add: List[ModuleVariable] = []
for var in self.docker_compose_variables:
if var.name != "APPSLAB_VERSION" and var.name != "DOCKER_REGISTRY_BASE" and var.name != "BIND_ADDRESS" and var.name != "BIND_PORT":
if var.name != "APPSLAB_VERSION" and var.name != "DOCKER_REGISTRY_BASE" and var.name != "BIND_ADDRESS":
var_to_add.append(var)
vars_list: List[Dict] = [var.to_dict() for var in var_to_add]
out_dict["variables"] = vars_list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@pytest.fixture(autouse=True)
def mock_dependencies(monkeypatch: pytest.MonkeyPatch):
"""Mock out docker-compose lookups and image helpers."""
fake_compose = {"services": {"models-runner": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-8100}:8100"]}}}
fake_compose = {"services": {"models-runner": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:8100:8100"]}}}
monkeypatch.setattr("arduino.app_internal.core.load_brick_compose_file", lambda cls: fake_compose)
monkeypatch.setattr("arduino.app_internal.core.resolve_address", lambda host: "127.0.0.1")
monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda x: [(None, None), (None, "8200")])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@pytest.fixture(autouse=True)
def mock_dependencies(monkeypatch: pytest.MonkeyPatch):
"""Mock out docker-compose lookups and image helpers."""
fake_compose = {"services": {"models-runner": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-8100}:8100"]}}}
fake_compose = {"services": {"models-runner": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:8100:8100"]}}}
monkeypatch.setattr("arduino.app_internal.core.load_brick_compose_file", lambda cls: fake_compose)
monkeypatch.setattr("arduino.app_internal.core.resolve_address", lambda host: "127.0.0.1")
monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda x: [(None, None), (None, "8200")])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def app_instance(monkeypatch):
@pytest.fixture(autouse=True)
def mock_dependencies(monkeypatch: pytest.MonkeyPatch):
"""Mock out docker-compose lookups and image helpers."""
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-1337}:1337"]}}}
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:1337:1337"]}}}
monkeypatch.setattr("arduino.app_internal.core.ei.load_brick_compose_file", lambda cls: fake_compose)
monkeypatch.setattr("arduino.app_internal.core.resolve_address", lambda host: "127.0.0.1")
monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda x: [(None, None), (None, "1337")])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def mock_dependencies(monkeypatch: pytest.MonkeyPatch):

This is needed to avoid network calls and other side effects.
"""
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-1337}:1337"]}}}
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:1337:1337"]}}}
monkeypatch.setattr("arduino.app_internal.core.ei.load_brick_compose_file", lambda cls: fake_compose)
monkeypatch.setattr("arduino.app_internal.core.resolve_address", lambda host: "127.0.0.1")
monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda x: [(None, None), (None, "1337")])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def app_instance(monkeypatch):
@pytest.fixture(autouse=True)
def mock_dependencies(monkeypatch: pytest.MonkeyPatch):
"""Mock out docker-compose lookups and image helpers."""
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-1337}:1337"]}}}
fake_compose = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:1337:1337"]}}}
monkeypatch.setattr("arduino.app_internal.core.ei.load_brick_compose_file", lambda cls: fake_compose)
monkeypatch.setattr("arduino.app_internal.core.resolve_address", lambda host: "127.0.0.1")
monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda x: [(None, None), (None, "1337")])
Expand Down
3 changes: 1 addition & 2 deletions tests/arduino/app_core/brick_compose_test_data.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# BIND_ADDRESS = external container address
# BIND_PORT = container port
# DB_USERNAME = Edge Impulse project API key
# DB_PASSWORD = Database password
# INFLUXDB_ADMIN_TOKEN = InfluxDB admin token
services:
dbstorage-influx:
image: influxdb:2.7
ports:
- "${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-8086}:8086"
- "${BIND_ADDRESS:-127.0.0.1}:8086:8086"
volumes:
- "${APP_HOME:-.}/data/influx-data:/var/lib/influxdb2"
environment:
Expand Down
Loading