Skip to content

Commit b86bff1

Browse files
committed
add hidden variable
1 parent 741159c commit b86bff1

File tree

3 files changed

+174
-139
lines changed

3 files changed

+174
-139
lines changed

internal/orchestrator/bricksindex/bricks_index.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ type BrickVariable struct {
4242
Name string `yaml:"name"`
4343
DefaultValue string `yaml:"default_value"`
4444
Description string `yaml:"description,omitempty"`
45+
Hidden bool `yaml:"is_hidden,omitempty"`
4546
}
4647

4748
func (v BrickVariable) IsRequired() bool {

internal/orchestrator/bricksindex/bricks_index_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ func TestGenerateBricksIndexFromFile(t *testing.T) {
5858
bNoRequireModel, found := index.FindBrickByID("arduino:missing-model-require")
5959
require.True(t, found)
6060
require.False(t, bNoRequireModel.RequireModel)
61+
62+
withHidden, found := index.FindBrickByID("arduino:with-hidden-variables")
63+
require.True(t, found)
64+
require.Equal(t, "HIDDEN_VAR", withHidden.Variables[0].Name)
65+
require.True(t, withHidden.Variables[0].Hidden)
66+
require.Equal(t, "VISIBLE_VARIABLE", withHidden.Variables[1].Name)
67+
require.False(t, withHidden.Variables[1].Hidden)
68+
require.Equal(t, "VISIBLE_VARIABLE_IF_MISSING", withHidden.Variables[2].Name)
69+
require.False(t, withHidden.Variables[2].Hidden)
6170
}
6271

6372
func TestBricksIndexYAMLFormats(t *testing.T) {
Lines changed: 164 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,167 @@
11
bricks:
2-
- id: arduino:image_classification
3-
name: Image Classification
4-
description: "Brick for image classification using a pre-trained model. It processes\
5-
\ images and returns the predicted class label and confidence score.\nBrick is\
6-
\ designed to work with pre-trained models provided by framework or with custom\
7-
\ image classification models trained on Edge Impulse platform. \n"
8-
require_container: true
9-
require_model: true
10-
ports: []
11-
model_name: mobilenet-image-classification
12-
variables:
13-
- name: CUSTOM_MODEL_PATH
14-
default_value: /opt/models/ei/
15-
description: path to the custom model directory
16-
- name: EI_CLASSIFICATION_MODEL
17-
default_value: /models/ootb/ei/mobilenet-v2-224px.eim
18-
description: path to the model file
19-
- id: arduino:camera_scanner
20-
name: Camera Scanner
21-
description: Scans a camera for barcodes and QR codes
22-
require_container: false
23-
require_model: false
24-
ports: []
25-
- id: arduino:streamlit_ui
26-
name: Streamlit UI
27-
description: A simplified user interface based on Streamlit and Python.
28-
require_container: false
29-
require_model: false
30-
ports:
31-
- 7000
32-
- id: arduino:keyword_spotter
33-
name: Keyword Spotter
34-
description: 'Brick for keyword spotting using a pre-trained model. It processes
35-
audio input to detect specific keywords or phrases.
2+
- id: arduino:image_classification
3+
name: Image Classification
4+
description:
5+
"Brick for image classification using a pre-trained model. It processes\
6+
\ images and returns the predicted class label and confidence score.\nBrick is\
7+
\ designed to work with pre-trained models provided by framework or with custom\
8+
\ image classification models trained on Edge Impulse platform. \n"
9+
require_container: true
10+
require_model: true
11+
ports: []
12+
model_name: mobilenet-image-classification
13+
variables:
14+
- name: CUSTOM_MODEL_PATH
15+
default_value: /opt/models/ei/
16+
description: path to the custom model directory
17+
- name: EI_CLASSIFICATION_MODEL
18+
default_value: /models/ootb/ei/mobilenet-v2-224px.eim
19+
description: path to the model file
20+
- id: arduino:camera_scanner
21+
name: Camera Scanner
22+
description: Scans a camera for barcodes and QR codes
23+
require_container: false
24+
require_model: false
25+
ports: []
26+
- id: arduino:streamlit_ui
27+
name: Streamlit UI
28+
description: A simplified user interface based on Streamlit and Python.
29+
require_container: false
30+
require_model: false
31+
ports:
32+
- 7000
33+
- id: arduino:keyword_spotter
34+
name: Keyword Spotter
35+
description:
36+
"Brick for keyword spotting using a pre-trained model. It processes
37+
audio input to detect specific keywords or phrases.
3638
37-
Brick is designed to work with pre-trained models provided by framework or with
38-
custom audio classification models trained on Edge Impulse platform.
39+
Brick is designed to work with pre-trained models provided by framework or with
40+
custom audio classification models trained on Edge Impulse platform.
3941
40-
'
41-
require_container: true
42-
require_model: true
43-
ports: []
44-
model_name: keyword-spotting-hello-world
45-
variables:
46-
- name: CUSTOM_MODEL_PATH
47-
default_value: /opt/models/ei/
48-
description: path to the custom model directory
49-
- name: EI_KEYWORK_SPOTTING_MODEL
50-
default_value: /models/ootb/ei/keyword-spotting-hello-world.eim
51-
description: path to the model file
52-
- id: arduino:mqtt
53-
name: MQTT Connector
54-
description: MQTT connector module. Acts as a client for receiving and publishing
55-
messages to an MQTT broker.
56-
require_container: false
57-
require_model: false
58-
ports: []
59-
- id: arduino:web_ui
60-
name: Web UI
61-
description: A user interface based on HTML and JavaScript that can rely on additional
62-
APIs and a WebSocket exposed by a web server.
63-
require_container: false
64-
require_model: false
65-
ports:
66-
- 7000
67-
- id: arduino:dbstorage_tsstore
68-
name: Database Storage - Time Series Store
69-
description: Simplified time series database storage layer for Arduino sensor samples
70-
built on top of InfluxDB.
71-
require_container: true
72-
require_model: false
73-
ports: []
74-
variables:
75-
- name: APP_HOME
76-
default_value: .
77-
- name: DB_PASSWORD
78-
default_value: Arduino15
79-
description: Database password
80-
- name: DB_USERNAME
81-
default_value: admin
82-
description: Edge Impulse project API key
83-
- name: INFLUXDB_ADMIN_TOKEN
84-
default_value: 392edbf2-b8a2-481f-979d-3f188b2c05f0
85-
description: InfluxDB admin token
86-
- id: arduino:dbstorage_sqlstore
87-
name: Database Storage - SQLStore
88-
description: Simplified database storage layer for Arduino sensor data using SQLite
89-
local database.
90-
require_container: false
91-
require_model: false
92-
ports: []
93-
- id: arduino:object_detection
94-
name: Object Detection
95-
description: "Brick for object detection using a pre-trained model. It processes\
96-
\ images and returns the predicted class label, bounding-boxes and confidence\
97-
\ score.\nBrick is designed to work with pre-trained models provided by framework\
98-
\ or with custom object detection models trained on Edge Impulse platform. \n"
99-
require_container: true
100-
require_model: true
101-
ports: []
102-
model_name: yolox-object-detection
103-
variables:
104-
- name: CUSTOM_MODEL_PATH
105-
default_value: /opt/models/ei/
106-
description: path to the custom model directory
107-
- name: EI_OBJ_DETECTION_MODEL
108-
default_value: /models/ootb/ei/yolo-x-nano.eim
109-
description: path to the model file
110-
- id: arduino:weather_forecast
111-
name: Weather Forecast
112-
description: Online weather forecast module for Arduino using open-meteo.com geolocation
113-
and weather APIs. Requires an internet connection.
114-
require_container: false
115-
require_model: false
116-
ports: []
117-
- id: arduino:visual_anomaly_detection
118-
name: Visual Anomaly Detection
119-
description: "Brick for visual anomaly detection using a pre-trained model. It processes\
120-
\ images and returns detected anomalies and bounding-boxes.\nBrick is designed\
121-
\ to work with pre-trained models provided by framework or with custom object\
122-
\ detection models trained on Edge Impulse platform. \n"
123-
require_container: true
124-
require_model: true
125-
ports: []
126-
model_name: concreate-crack-anomaly-detection
127-
variables:
128-
- name: CUSTOM_MODEL_PATH
129-
default_value: /opt/models/ei/
130-
description: path to the custom model directory
131-
- name: EI_V_ANOMALY_DETECTION_MODEL
132-
default_value: /models/ootb/ei/concrete-crack-anomaly-detection.eim
133-
description: path to the model file
134-
- id: arduino:missing-model-require
135-
name: Camera Scanner
136-
description: Scans a camera for barcodes and QR codes
137-
require_container: false
138-
ports: []
139-
- id: arduino:model_required
140-
name: Model Required Brick
141-
description: A brick that requires a model
142-
require_model: true
42+
"
43+
require_container: true
44+
require_model: true
45+
ports: []
46+
model_name: keyword-spotting-hello-world
47+
variables:
48+
- name: CUSTOM_MODEL_PATH
49+
default_value: /opt/models/ei/
50+
description: path to the custom model directory
51+
- name: EI_KEYWORK_SPOTTING_MODEL
52+
default_value: /models/ootb/ei/keyword-spotting-hello-world.eim
53+
description: path to the model file
54+
- id: arduino:mqtt
55+
name: MQTT Connector
56+
description:
57+
MQTT connector module. Acts as a client for receiving and publishing
58+
messages to an MQTT broker.
59+
require_container: false
60+
require_model: false
61+
ports: []
62+
- id: arduino:web_ui
63+
name: Web UI
64+
description:
65+
A user interface based on HTML and JavaScript that can rely on additional
66+
APIs and a WebSocket exposed by a web server.
67+
require_container: false
68+
require_model: false
69+
ports:
70+
- 7000
71+
- id: arduino:dbstorage_tsstore
72+
name: Database Storage - Time Series Store
73+
description:
74+
Simplified time series database storage layer for Arduino sensor samples
75+
built on top of InfluxDB.
76+
require_container: true
77+
require_model: false
78+
ports: []
79+
variables:
80+
- name: APP_HOME
81+
default_value: .
82+
- name: DB_PASSWORD
83+
default_value: Arduino15
84+
description: Database password
85+
- name: DB_USERNAME
86+
default_value: admin
87+
description: Edge Impulse project API key
88+
- name: INFLUXDB_ADMIN_TOKEN
89+
default_value: 392edbf2-b8a2-481f-979d-3f188b2c05f0
90+
description: InfluxDB admin token
91+
- id: arduino:dbstorage_sqlstore
92+
name: Database Storage - SQLStore
93+
description:
94+
Simplified database storage layer for Arduino sensor data using SQLite
95+
local database.
96+
require_container: false
97+
require_model: false
98+
ports: []
99+
- id: arduino:object_detection
100+
name: Object Detection
101+
description:
102+
"Brick for object detection using a pre-trained model. It processes\
103+
\ images and returns the predicted class label, bounding-boxes and confidence\
104+
\ score.\nBrick is designed to work with pre-trained models provided by framework\
105+
\ or with custom object detection models trained on Edge Impulse platform. \n"
106+
require_container: true
107+
require_model: true
108+
ports: []
109+
model_name: yolox-object-detection
110+
variables:
111+
- name: CUSTOM_MODEL_PATH
112+
default_value: /opt/models/ei/
113+
description: path to the custom model directory
114+
- name: EI_OBJ_DETECTION_MODEL
115+
default_value: /models/ootb/ei/yolo-x-nano.eim
116+
description: path to the model file
117+
- id: arduino:weather_forecast
118+
name: Weather Forecast
119+
description:
120+
Online weather forecast module for Arduino using open-meteo.com geolocation
121+
and weather APIs. Requires an internet connection.
122+
require_container: false
123+
require_model: false
124+
ports: []
125+
- id: arduino:visual_anomaly_detection
126+
name: Visual Anomaly Detection
127+
description:
128+
"Brick for visual anomaly detection using a pre-trained model. It processes\
129+
\ images and returns detected anomalies and bounding-boxes.\nBrick is designed\
130+
\ to work with pre-trained models provided by framework or with custom object\
131+
\ detection models trained on Edge Impulse platform. \n"
132+
require_container: true
133+
require_model: true
134+
ports: []
135+
model_name: concreate-crack-anomaly-detection
136+
variables:
137+
- name: CUSTOM_MODEL_PATH
138+
default_value: /opt/models/ei/
139+
description: path to the custom model directory
140+
- name: EI_V_ANOMALY_DETECTION_MODEL
141+
default_value: /models/ootb/ei/concrete-crack-anomaly-detection.eim
142+
description: path to the model file
143+
- id: arduino:missing-model-require
144+
name: Camera Scanner
145+
description: Scans a camera for barcodes and QR codes
146+
require_container: false
147+
ports: []
148+
- id: arduino:model_required
149+
name: Model Required Brick
150+
description: A brick that requires a model
151+
require_model: true
152+
- id: arduino:with-hidden-variables
153+
name: Visual Anomaly Detection
154+
description: "Brick with hidden variables"
155+
variables:
156+
- name: HIDDEN_VARIABLE
157+
default_value: a_hidden_value
158+
description: this variable is hidden
159+
hidden: true
160+
- name: VISIBLE_VARIABLE
161+
default_value: a_visible_value
162+
description: this variable is visible because 'hidden' is set to false
163+
hidden: false
164+
- name: VISIBLE_VARIABLE_IF_MISSING_HIDDEN
165+
default_value: another_visible_value
166+
description: this variable is visiable because 'hidden' field is missing
167+
hidden: false

0 commit comments

Comments
 (0)