From 94483209c7d898fb29cc4e3f5b49dd96c704d045 Mon Sep 17 00:00:00 2001 From: Mirko Curtolo Date: Thu, 4 Dec 2025 15:25:32 +0100 Subject: [PATCH 1/6] Move compose variables into brick config file --- .../audio_classification/brick_compose.yaml | 2 -- .../audio_classification/brick_config.yaml | 10 ++++++++++ .../dbstorage_tsstore/brick_compose.yaml | 5 ----- .../dbstorage_tsstore/brick_config.yaml | 15 ++++++++++++++- .../image_classification/brick_compose.yaml | 2 -- .../image_classification/brick_config.yaml | 10 ++++++++++ .../keyword_spotting/brick_compose.yaml | 2 -- .../app_bricks/keyword_spotting/brick_config.yaml | 10 ++++++++++ .../motion_detection/brick_compose.yaml | 2 -- .../app_bricks/motion_detection/brick_config.yaml | 10 ++++++++++ .../object_detection/brick_compose.yaml | 3 +-- .../app_bricks/object_detection/brick_config.yaml | 12 +++++++++++- .../video_imageclassification/brick_compose.yaml | 2 -- .../video_imageclassification/brick_config.yaml | 12 +++++++++++- .../video_objectdetection/brick_compose.yaml | 2 -- .../video_objectdetection/brick_config.yaml | 12 +++++++++++- .../visual_anomaly_detection/brick_compose.yaml | 2 -- .../visual_anomaly_detection/brick_config.yaml | 10 ++++++++++ 18 files changed, 98 insertions(+), 25 deletions(-) diff --git a/src/arduino/app_bricks/audio_classification/brick_compose.yaml b/src/arduino/app_bricks/audio_classification/brick_compose.yaml index 0a710c5f..2ca9f3b6 100644 --- a/src/arduino/app_bricks/audio_classification/brick_compose.yaml +++ b/src/arduino/app_bricks/audio_classification/brick_compose.yaml @@ -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 diff --git a/src/arduino/app_bricks/audio_classification/brick_config.yaml b/src/arduino/app_bricks/audio_classification/brick_config.yaml index 1b1836bc..3bd33919 100644 --- a/src/arduino/app_bricks/audio_classification/brick_config.yaml +++ b/src/arduino/app_bricks/audio_classification/brick_config.yaml @@ -9,3 +9,13 @@ 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 +- name: CUSTOM_MODEL_PATH + description: Path to the custom model directory + hidden: true +- name: BIND_ADDRESS + description: Bind address + hidden: true \ No newline at end of file diff --git a/src/arduino/app_bricks/dbstorage_tsstore/brick_compose.yaml b/src/arduino/app_bricks/dbstorage_tsstore/brick_compose.yaml index b43f55c6..7ca01e0b 100644 --- a/src/arduino/app_bricks/dbstorage_tsstore/brick_compose.yaml +++ b/src/arduino/app_bricks/dbstorage_tsstore/brick_compose.yaml @@ -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 diff --git a/src/arduino/app_bricks/dbstorage_tsstore/brick_config.yaml b/src/arduino/app_bricks/dbstorage_tsstore/brick_config.yaml index 8258cf13..6ceb5d76 100644 --- a/src/arduino/app_bricks/dbstorage_tsstore/brick_config.yaml +++ b/src/arduino/app_bricks/dbstorage_tsstore/brick_config.yaml @@ -2,4 +2,17 @@ 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 \ No newline at end of file +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 \ No newline at end of file diff --git a/src/arduino/app_bricks/image_classification/brick_compose.yaml b/src/arduino/app_bricks/image_classification/brick_compose.yaml index fe20b37e..03e84a02 100644 --- a/src/arduino/app_bricks/image_classification/brick_compose.yaml +++ b/src/arduino/app_bricks/image_classification/brick_compose.yaml @@ -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 diff --git a/src/arduino/app_bricks/image_classification/brick_config.yaml b/src/arduino/app_bricks/image_classification/brick_config.yaml index a26273b4..a8627971 100644 --- a/src/arduino/app_bricks/image_classification/brick_config.yaml +++ b/src/arduino/app_bricks/image_classification/brick_config.yaml @@ -9,3 +9,13 @@ 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 +- name: CUSTOM_MODEL_PATH + description: Path to the custom model directory + hidden: true +- name: BIND_ADDRESS + description: Bind address + hidden: true \ No newline at end of file diff --git a/src/arduino/app_bricks/keyword_spotting/brick_compose.yaml b/src/arduino/app_bricks/keyword_spotting/brick_compose.yaml index 4340871e..a47f0bf4 100644 --- a/src/arduino/app_bricks/keyword_spotting/brick_compose.yaml +++ b/src/arduino/app_bricks/keyword_spotting/brick_compose.yaml @@ -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 diff --git a/src/arduino/app_bricks/keyword_spotting/brick_config.yaml b/src/arduino/app_bricks/keyword_spotting/brick_config.yaml index b5e2875e..93daf70f 100644 --- a/src/arduino/app_bricks/keyword_spotting/brick_config.yaml +++ b/src/arduino/app_bricks/keyword_spotting/brick_config.yaml @@ -11,3 +11,13 @@ 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 +- name: CUSTOM_MODEL_PATH + description: Path to the custom model directory + hidden: true +- name: BIND_ADDRESS + description: Bind address + hidden: true \ No newline at end of file diff --git a/src/arduino/app_bricks/motion_detection/brick_compose.yaml b/src/arduino/app_bricks/motion_detection/brick_compose.yaml index abc10e77..92ff7ebe 100644 --- a/src/arduino/app_bricks/motion_detection/brick_compose.yaml +++ b/src/arduino/app_bricks/motion_detection/brick_compose.yaml @@ -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 diff --git a/src/arduino/app_bricks/motion_detection/brick_config.yaml b/src/arduino/app_bricks/motion_detection/brick_config.yaml index 86160c49..ad10efd6 100644 --- a/src/arduino/app_bricks/motion_detection/brick_config.yaml +++ b/src/arduino/app_bricks/motion_detection/brick_config.yaml @@ -9,3 +9,13 @@ 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 +- name: CUSTOM_MODEL_PATH + description: Path to the custom model directory + hidden: true +- name: BIND_ADDRESS + description: Bind address + hidden: true \ No newline at end of file diff --git a/src/arduino/app_bricks/object_detection/brick_compose.yaml b/src/arduino/app_bricks/object_detection/brick_compose.yaml index 99871411..80ebc4bb 100644 --- a/src/arduino/app_bricks/object_detection/brick_compose.yaml +++ b/src/arduino/app_bricks/object_detection/brick_compose.yaml @@ -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 @@ -22,3 +20,4 @@ services: interval: 2s timeout: 2s retries: 25 + \ No newline at end of file diff --git a/src/arduino/app_bricks/object_detection/brick_config.yaml b/src/arduino/app_bricks/object_detection/brick_config.yaml index e5a96ce5..20e19907 100644 --- a/src/arduino/app_bricks/object_detection/brick_config.yaml +++ b/src/arduino/app_bricks/object_detection/brick_config.yaml @@ -8,4 +8,14 @@ requires_container: true requires_model: true model: yolox-object-detection model_configuration_variables: - - EI_OBJ_DETECTION_MODEL \ No newline at end of file + - EI_OBJ_DETECTION_MODEL +variables: +- name: EI_OBJ_DETECTION_MODEL + description: Path to the model file + hidden: true +- name: CUSTOM_MODEL_PATH + description: Path to the custom model directory + hidden: true +- name: BIND_ADDRESS + description: Bind address + hidden: true \ No newline at end of file diff --git a/src/arduino/app_bricks/video_imageclassification/brick_compose.yaml b/src/arduino/app_bricks/video_imageclassification/brick_compose.yaml index 3dd8139a..a25f6f87 100644 --- a/src/arduino/app_bricks/video_imageclassification/brick_compose.yaml +++ b/src/arduino/app_bricks/video_imageclassification/brick_compose.yaml @@ -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 diff --git a/src/arduino/app_bricks/video_imageclassification/brick_config.yaml b/src/arduino/app_bricks/video_imageclassification/brick_config.yaml index 0517c457..a458c5ef 100644 --- a/src/arduino/app_bricks/video_imageclassification/brick_config.yaml +++ b/src/arduino/app_bricks/video_imageclassification/brick_config.yaml @@ -13,4 +13,14 @@ required_devices: - camera model: mobilenet-image-classification model_configuration_variables: - - EI_CLASSIFICATION_MODEL \ No newline at end of file + - EI_CLASSIFICATION_MODEL +variables: +- name: EI_V_CLASSIFICATION_MODEL + description: Path to the model file + hidden: true +- name: CUSTOM_MODEL_PATH + description: Path to the custom model directory + hidden: true +- name: BIND_ADDRESS + description: Bind address + hidden: true \ No newline at end of file diff --git a/src/arduino/app_bricks/video_objectdetection/brick_compose.yaml b/src/arduino/app_bricks/video_objectdetection/brick_compose.yaml index 804bc638..9dbb74ca 100644 --- a/src/arduino/app_bricks/video_objectdetection/brick_compose.yaml +++ b/src/arduino/app_bricks/video_objectdetection/brick_compose.yaml @@ -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 diff --git a/src/arduino/app_bricks/video_objectdetection/brick_config.yaml b/src/arduino/app_bricks/video_objectdetection/brick_config.yaml index 66b297ee..5c702e9c 100644 --- a/src/arduino/app_bricks/video_objectdetection/brick_config.yaml +++ b/src/arduino/app_bricks/video_objectdetection/brick_config.yaml @@ -12,4 +12,14 @@ required_devices: - camera model: yolox-object-detection model_configuration_variables: - - EI_OBJ_DETECTION_MODEL \ No newline at end of file + - EI_OBJ_DETECTION_MODEL +variables: +- name: EI_V_OBJ_DETECTION_MODEL + description: Path to the model file + hidden: true +- name: CUSTOM_MODEL_PATH + description: Path to the custom model directory + hidden: true +- name: BIND_ADDRESS + description: Bind address + hidden: true \ No newline at end of file diff --git a/src/arduino/app_bricks/visual_anomaly_detection/brick_compose.yaml b/src/arduino/app_bricks/visual_anomaly_detection/brick_compose.yaml index ced99fcb..50cc1f40 100644 --- a/src/arduino/app_bricks/visual_anomaly_detection/brick_compose.yaml +++ b/src/arduino/app_bricks/visual_anomaly_detection/brick_compose.yaml @@ -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 diff --git a/src/arduino/app_bricks/visual_anomaly_detection/brick_config.yaml b/src/arduino/app_bricks/visual_anomaly_detection/brick_config.yaml index 2920b52f..8710edca 100644 --- a/src/arduino/app_bricks/visual_anomaly_detection/brick_config.yaml +++ b/src/arduino/app_bricks/visual_anomaly_detection/brick_config.yaml @@ -9,3 +9,13 @@ 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 +- name: CUSTOM_MODEL_PATH + description: Path to the custom model directory + hidden: true +- name: BIND_ADDRESS + description: Bind address + hidden: true \ No newline at end of file From da2fa00d6af8748d1368db68f4e1e279956d3f12 Mon Sep 17 00:00:00 2001 From: Mirko Curtolo Date: Fri, 5 Dec 2025 16:40:22 +0100 Subject: [PATCH 2/6] Fix video examples variables --- .../video_imageclassification/brick_compose.yaml | 2 +- .../app_bricks/video_imageclassification/brick_config.yaml | 7 +++++-- .../app_bricks/video_objectdetection/brick_compose.yaml | 2 +- .../app_bricks/video_objectdetection/brick_config.yaml | 7 +++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/arduino/app_bricks/video_imageclassification/brick_compose.yaml b/src/arduino/app_bricks/video_imageclassification/brick_compose.yaml index a25f6f87..9bfcab33 100644 --- a/src/arduino/app_bricks/video_imageclassification/brick_compose.yaml +++ b/src/arduino/app_bricks/video_imageclassification/brick_compose.yaml @@ -11,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 diff --git a/src/arduino/app_bricks/video_imageclassification/brick_config.yaml b/src/arduino/app_bricks/video_imageclassification/brick_config.yaml index a458c5ef..4dec5d91 100644 --- a/src/arduino/app_bricks/video_imageclassification/brick_config.yaml +++ b/src/arduino/app_bricks/video_imageclassification/brick_config.yaml @@ -13,7 +13,7 @@ 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 @@ -23,4 +23,7 @@ variables: hidden: true - name: BIND_ADDRESS description: Bind address - hidden: true \ No newline at end of file + hidden: true +- name: VIDEO_DEVICE + description: Video device path + hidden: true \ No newline at end of file diff --git a/src/arduino/app_bricks/video_objectdetection/brick_compose.yaml b/src/arduino/app_bricks/video_objectdetection/brick_compose.yaml index 9dbb74ca..393491d5 100644 --- a/src/arduino/app_bricks/video_objectdetection/brick_compose.yaml +++ b/src/arduino/app_bricks/video_objectdetection/brick_compose.yaml @@ -11,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 diff --git a/src/arduino/app_bricks/video_objectdetection/brick_config.yaml b/src/arduino/app_bricks/video_objectdetection/brick_config.yaml index 5c702e9c..d3818d6a 100644 --- a/src/arduino/app_bricks/video_objectdetection/brick_config.yaml +++ b/src/arduino/app_bricks/video_objectdetection/brick_config.yaml @@ -12,7 +12,7 @@ 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 @@ -22,4 +22,7 @@ variables: hidden: true - name: BIND_ADDRESS description: Bind address - hidden: true \ No newline at end of file + hidden: true +- name: VIDEO_DEVICE + description: Video device path + hidden: true \ No newline at end of file From 9c541214c2ead6c921000ee900c0e208127cddf9 Mon Sep 17 00:00:00 2001 From: Mirko Curtolo Date: Thu, 11 Dec 2025 09:01:16 +0100 Subject: [PATCH 3/6] Add default values --- .../app_bricks/audio_classification/brick_config.yaml | 5 ++++- src/arduino/app_bricks/dbstorage_tsstore/brick_config.yaml | 3 ++- .../app_bricks/image_classification/brick_config.yaml | 5 ++++- src/arduino/app_bricks/keyword_spotting/brick_config.yaml | 5 ++++- src/arduino/app_bricks/motion_detection/brick_config.yaml | 5 ++++- src/arduino/app_bricks/object_detection/brick_config.yaml | 5 ++++- .../app_bricks/video_imageclassification/brick_config.yaml | 6 +++++- .../app_bricks/video_objectdetection/brick_config.yaml | 6 +++++- .../app_bricks/visual_anomaly_detection/brick_config.yaml | 5 ++++- 9 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/arduino/app_bricks/audio_classification/brick_config.yaml b/src/arduino/app_bricks/audio_classification/brick_config.yaml index 3bd33919..bea89b7f 100644 --- a/src/arduino/app_bricks/audio_classification/brick_config.yaml +++ b/src/arduino/app_bricks/audio_classification/brick_config.yaml @@ -13,9 +13,12 @@ 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 \ No newline at end of file + hidden: true + default_value: 127.0.0.1 \ No newline at end of file diff --git a/src/arduino/app_bricks/dbstorage_tsstore/brick_config.yaml b/src/arduino/app_bricks/dbstorage_tsstore/brick_config.yaml index 6ceb5d76..251454dc 100644 --- a/src/arduino/app_bricks/dbstorage_tsstore/brick_config.yaml +++ b/src/arduino/app_bricks/dbstorage_tsstore/brick_config.yaml @@ -15,4 +15,5 @@ variables: default_value: 392edbf2-b8a2-481f-979d-3f188b2c05f0 - name: BIND_ADDRESS description: External container address - hidden: true \ No newline at end of file + hidden: true + default_value: 127.0.0.1 \ No newline at end of file diff --git a/src/arduino/app_bricks/image_classification/brick_config.yaml b/src/arduino/app_bricks/image_classification/brick_config.yaml index a8627971..07e8052e 100644 --- a/src/arduino/app_bricks/image_classification/brick_config.yaml +++ b/src/arduino/app_bricks/image_classification/brick_config.yaml @@ -13,9 +13,12 @@ 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 \ No newline at end of file + hidden: true + default_value: 127.0.0.1 \ No newline at end of file diff --git a/src/arduino/app_bricks/keyword_spotting/brick_config.yaml b/src/arduino/app_bricks/keyword_spotting/brick_config.yaml index 93daf70f..14ad051f 100644 --- a/src/arduino/app_bricks/keyword_spotting/brick_config.yaml +++ b/src/arduino/app_bricks/keyword_spotting/brick_config.yaml @@ -15,9 +15,12 @@ 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 \ No newline at end of file + hidden: true + default_value: 127.0.0.1 \ No newline at end of file diff --git a/src/arduino/app_bricks/motion_detection/brick_config.yaml b/src/arduino/app_bricks/motion_detection/brick_config.yaml index ad10efd6..7b22a8ef 100644 --- a/src/arduino/app_bricks/motion_detection/brick_config.yaml +++ b/src/arduino/app_bricks/motion_detection/brick_config.yaml @@ -13,9 +13,12 @@ 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 \ No newline at end of file + hidden: true + default_value: 127.0.0.1 \ No newline at end of file diff --git a/src/arduino/app_bricks/object_detection/brick_config.yaml b/src/arduino/app_bricks/object_detection/brick_config.yaml index 20e19907..b2fec719 100644 --- a/src/arduino/app_bricks/object_detection/brick_config.yaml +++ b/src/arduino/app_bricks/object_detection/brick_config.yaml @@ -13,9 +13,12 @@ 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 \ No newline at end of file + hidden: true + default_value: 127.0.0.1 \ No newline at end of file diff --git a/src/arduino/app_bricks/video_imageclassification/brick_config.yaml b/src/arduino/app_bricks/video_imageclassification/brick_config.yaml index 4dec5d91..34ed1c52 100644 --- a/src/arduino/app_bricks/video_imageclassification/brick_config.yaml +++ b/src/arduino/app_bricks/video_imageclassification/brick_config.yaml @@ -18,12 +18,16 @@ 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 \ No newline at end of file + hidden: true + default_value: /dev/video1 \ No newline at end of file diff --git a/src/arduino/app_bricks/video_objectdetection/brick_config.yaml b/src/arduino/app_bricks/video_objectdetection/brick_config.yaml index d3818d6a..8866acf8 100644 --- a/src/arduino/app_bricks/video_objectdetection/brick_config.yaml +++ b/src/arduino/app_bricks/video_objectdetection/brick_config.yaml @@ -17,12 +17,16 @@ 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 \ No newline at end of file + hidden: true + default_value: /dev/video1 \ No newline at end of file diff --git a/src/arduino/app_bricks/visual_anomaly_detection/brick_config.yaml b/src/arduino/app_bricks/visual_anomaly_detection/brick_config.yaml index 8710edca..ec33a288 100644 --- a/src/arduino/app_bricks/visual_anomaly_detection/brick_config.yaml +++ b/src/arduino/app_bricks/visual_anomaly_detection/brick_config.yaml @@ -13,9 +13,12 @@ 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 \ No newline at end of file + hidden: true + default_value: 127.0.0.1 \ No newline at end of file From bcfe0e0d7cf61d051f9a0080820d97c175bdb192 Mon Sep 17 00:00:00 2001 From: Mirko Curtolo Date: Thu, 11 Dec 2025 14:29:07 +0100 Subject: [PATCH 4/6] Remove binding port variable --- src/arduino/app_bricks/dbstorage_tsstore/brick_compose.yaml | 2 +- src/arduino/app_bricks/object_detection/brick_compose.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arduino/app_bricks/dbstorage_tsstore/brick_compose.yaml b/src/arduino/app_bricks/dbstorage_tsstore/brick_compose.yaml index 7ca01e0b..fb148825 100644 --- a/src/arduino/app_bricks/dbstorage_tsstore/brick_compose.yaml +++ b/src/arduino/app_bricks/dbstorage_tsstore/brick_compose.yaml @@ -7,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: diff --git a/src/arduino/app_bricks/object_detection/brick_compose.yaml b/src/arduino/app_bricks/object_detection/brick_compose.yaml index 80ebc4bb..2b29d8ef 100644 --- a/src/arduino/app_bricks/object_detection/brick_compose.yaml +++ b/src/arduino/app_bricks/object_detection/brick_compose.yaml @@ -11,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"] From 279007cdf9042a4377274ae30cb3df0a5f2397da Mon Sep 17 00:00:00 2001 From: Mirko Curtolo Date: Thu, 11 Dec 2025 14:55:14 +0100 Subject: [PATCH 5/6] Fix tests --- src/arduino/app_internal/core/module.py | 2 +- src/arduino/app_tools/module_listing.py | 2 +- .../imageclassification/test_imageclassification.py | 2 +- .../app_bricks/keyword_spotter/test_keyword_spotter.py | 2 +- .../app_bricks/motion_detection/test_motion_detection.py | 2 +- .../app_bricks/objectdetection/test_objectdetection.py | 2 +- .../test_vibration_anomaly_detection.py | 2 +- tests/arduino/app_core/brick_compose_test_data.yaml | 3 +-- tests/arduino/app_core/test_edge_impulse.py | 4 ++-- 9 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/arduino/app_internal/core/module.py b/src/arduino/app_internal/core/module.py index c59e4c19..34f2fdea 100644 --- a/src/arduino/app_internal/core/module.py +++ b/src/arduino/app_internal/core/module.py @@ -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 diff --git a/src/arduino/app_tools/module_listing.py b/src/arduino/app_tools/module_listing.py index 5499e60a..32530f51 100644 --- a/src/arduino/app_tools/module_listing.py +++ b/src/arduino/app_tools/module_listing.py @@ -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 diff --git a/tests/arduino/app_bricks/imageclassification/test_imageclassification.py b/tests/arduino/app_bricks/imageclassification/test_imageclassification.py index 359fb3a3..6046c332 100644 --- a/tests/arduino/app_bricks/imageclassification/test_imageclassification.py +++ b/tests/arduino/app_bricks/imageclassification/test_imageclassification.py @@ -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")]) diff --git a/tests/arduino/app_bricks/keyword_spotter/test_keyword_spotter.py b/tests/arduino/app_bricks/keyword_spotter/test_keyword_spotter.py index 252a2a35..2bcbd7eb 100644 --- a/tests/arduino/app_bricks/keyword_spotter/test_keyword_spotter.py +++ b/tests/arduino/app_bricks/keyword_spotter/test_keyword_spotter.py @@ -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")]) diff --git a/tests/arduino/app_bricks/motion_detection/test_motion_detection.py b/tests/arduino/app_bricks/motion_detection/test_motion_detection.py index ee89749a..fd9e266e 100644 --- a/tests/arduino/app_bricks/motion_detection/test_motion_detection.py +++ b/tests/arduino/app_bricks/motion_detection/test_motion_detection.py @@ -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")]) diff --git a/tests/arduino/app_bricks/objectdetection/test_objectdetection.py b/tests/arduino/app_bricks/objectdetection/test_objectdetection.py index f61e85c9..ba6240db 100644 --- a/tests/arduino/app_bricks/objectdetection/test_objectdetection.py +++ b/tests/arduino/app_bricks/objectdetection/test_objectdetection.py @@ -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")]) diff --git a/tests/arduino/app_bricks/vibration_anomaly_detection/test_vibration_anomaly_detection.py b/tests/arduino/app_bricks/vibration_anomaly_detection/test_vibration_anomaly_detection.py index 3dc3a7b9..fa835bf8 100644 --- a/tests/arduino/app_bricks/vibration_anomaly_detection/test_vibration_anomaly_detection.py +++ b/tests/arduino/app_bricks/vibration_anomaly_detection/test_vibration_anomaly_detection.py @@ -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")]) diff --git a/tests/arduino/app_core/brick_compose_test_data.yaml b/tests/arduino/app_core/brick_compose_test_data.yaml index 45b2fe0e..eb285fa3 100644 --- a/tests/arduino/app_core/brick_compose_test_data.yaml +++ b/tests/arduino/app_core/brick_compose_test_data.yaml @@ -1,5 +1,4 @@ # 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 @@ -7,7 +6,7 @@ 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: diff --git a/tests/arduino/app_core/test_edge_impulse.py b/tests/arduino/app_core/test_edge_impulse.py index 2b61d2f0..afa299be 100644 --- a/tests/arduino/app_core/test_edge_impulse.py +++ b/tests/arduino/app_core/test_edge_impulse.py @@ -19,7 +19,7 @@ def mock_infra(monkeypatch: pytest.MonkeyPatch): bytes unchanged. """ # avoid real docker-compose lookups - fake = {"services": {"ei-inference": {"ports": ["${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-1337}:1337"]}}} + fake = {"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) monkeypatch.setattr("arduino.app_internal.core.resolve_address", lambda h: "127.0.0.1") monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda s: [(None, None), (None, "1337")]) @@ -289,7 +289,7 @@ def fake_get( monkeypatch.setattr(HttpClient, "request_with_retry", fake_get) # Mock docker-compose related functions - 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 h: "127.0.0.1") monkeypatch.setattr("arduino.app_internal.core.parse_docker_compose_variable", lambda s: [(None, None), (None, "1337")]) From 1dfa2790ac715053587d1c2fb5e37fe1737040e2 Mon Sep 17 00:00:00 2001 From: Stefano Torneo Date: Thu, 11 Dec 2025 15:13:42 +0100 Subject: [PATCH 6/6] fix tests --- .../app_core/test_docker_compose_utils.py | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/tests/arduino/app_core/test_docker_compose_utils.py b/tests/arduino/app_core/test_docker_compose_utils.py index 26a9d8ac..144da625 100644 --- a/tests/arduino/app_core/test_docker_compose_utils.py +++ b/tests/arduino/app_core/test_docker_compose_utils.py @@ -30,20 +30,18 @@ def test_parse_docker_compose_multi_variable(): def test_docker_compose_load_all_vars(): """Test loading all variables from a Docker Compose file.""" discovered_vars = load_module_supported_variables("tests/arduino/app_core/brick_compose_test_data.yaml") - assert len(discovered_vars) == 6 + assert len(discovered_vars) == 5 for var in discovered_vars: - if var.name == "DATABASE_HOST": - assert var.default_value == "db" - elif var.name == "DATABASE_PORT": - assert var.default_value == "8086" - elif var.name == "BIND_ADDRESS": + if var.name == "APP_HOME": + assert var.default_value == "." + if var.name == "BIND_ADDRESS": assert var.default_value == "127.0.0.1" - elif var.name == "ADMIN_TOKEN": - assert var.default_value == "392edbf2-b8a2-481f-979d-3f188b2c05f0" - elif var.name == "USERNAME": + if var.name == "DB_USERNAME": assert var.default_value == "admin" - elif var.name == "APP_HOME": - assert var.default_value == "." + if var.name == "DB_PASSWORD": + assert var.default_value == "Arduino15" + if var.name == "INFLUXDB_ADMIN_TOKEN": + assert var.default_value == "392edbf2-b8a2-481f-979d-3f188b2c05f0" def test_get_compose_file_dbstorage_tsstore(): @@ -57,19 +55,17 @@ def test_get_compose_file_dbstorage_tsstore(): compose_file = get_brick_compose_file(_InfluxDBHandler) assert compose_file is not None discovered_vars = load_module_supported_variables(compose_file) - assert len(discovered_vars) == 6 + assert len(discovered_vars) == 5 for var in discovered_vars: - if var.name == "DOCKER_INFLUXDB_INIT_MODE": - assert var.default_value == "setup" - if var.name == "DOCKER_INFLUXDB_INIT_USERNAME": + if var.name == "APP_HOME": + assert var.default_value == "." + if var.name == "BIND_ADDRESS": + assert var.default_value == "127.0.0.1" + if var.name == "DB_USERNAME": assert var.default_value == "admin" - if var.name == "DOCKER_INFLUXDB_INIT_PASSWORD": + if var.name == "DB_PASSWORD": assert var.default_value == "Arduino15" - if var.name == "DOCKER_INFLUXDB_INIT_ORG": - assert var.default_value == "arduino" - if var.name == "DOCKER_INFLUXDB_INIT_BUCKET": - assert var.default_value == "arduinostorage" - if var.name == "DOCKER_INFLUXDB_INIT_ADMIN_TOKEN": + if var.name == "INFLUXDB_ADMIN_TOKEN": assert var.default_value == "392edbf2-b8a2-481f-979d-3f188b2c05f0"