Skip to content

Commit 014a7bd

Browse files
committed
timeseries, multimodal: Updated docs
Changes: 1.docs - Updated docs for udf upload 2.helm - Removed the config.json vol mount Signed-off-by: Pooja Kumbharkar <pooja.kumbharkar@intel.com>
1 parent 94bd9aa commit 014a7bd

File tree

8 files changed

+58
-63
lines changed

8 files changed

+58
-63
lines changed

manufacturing-ai-suite/industrial-edge-insights-multimodal/Makefile

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
INCLUDE ?= default_INCLUDE
88
HELM_REGISTRY = oci://registry-1.docker.io/intel
9+
MAKEFLAGS += --no-print-directory
910

1011
DOCKER_COMPOSE_FILE = ./docker-compose.yml
1112
DOCKER_COMPOSE_VALIDATION_FILE=./docker-compose-validation.override.yml
@@ -126,6 +127,22 @@ check_env_variables:
126127
esac; \
127128
done
128129

130+
.PHONY: wait_for_tsam
131+
wait_for_tsam:
132+
@echo "Waiting for Time-Series Analytics microservice to be accessible..."; \
133+
max_retries=30; \
134+
retry=0; \
135+
until [ "$$(curl -sk -o /dev/null -w '%{http_code}' https://localhost:3000/ts-api/health)" != "000" ]; do \
136+
retry=$$((retry + 1)); \
137+
if [ $$retry -ge $$max_retries ]; then \
138+
echo "Timed out waiting for Time-Series Analytics microservice after $$max_retries attempts."; \
139+
exit 1; \
140+
fi; \
141+
echo " Not accessible yet (attempt $$retry/$$max_retries), retrying in 5s..."; \
142+
sleep 5; \
143+
done; \
144+
echo "Time-Series Analytics microservice is accessible."
145+
129146
.PHONY: upload_zip_file
130147
upload_zip_file:
131148
@echo "Creating UDF deployment zip for weld anomaly detection..."
@@ -137,10 +154,11 @@ upload_zip_file:
137154
if [ -d models ] && [ -n "$$(ls -A models 2>/dev/null)" ]; then folders="$$folders models"; fi; \
138155
zip -r $$zip_file $$folders && \
139156
echo "Created: $$zip_file"
157+
@$(MAKE) wait_for_tsam
140158
@echo "Uploading UDF deployment zip for weld anomaly detection to Time-Series Analytics microservice..."; \
141159
zip_file=$(CURDIR)/configs/time-series-analytics-microservice/weld_anomaly_detector.zip; \
142160
response=$$(curl -s -o /tmp/upload_response.json -w "%{http_code}" \
143-
-X POST https://localhost:3000/ts-api/update_udf_deployment_package \
161+
-X POST https://localhost:${GRAFANA_PORT}/ts-api/update_udf_deployment_package \
144162
-F "file=@$$zip_file" \
145163
-k); \
146164
if [ "$$response" = "200" ]; then \
@@ -159,9 +177,10 @@ post_config:
159177
echo "Error: config.json not found at $$config_file"; \
160178
exit 1; \
161179
fi; \
180+
$(MAKE) wait_for_tsam; \
162181
echo "Posting config for weld anomaly detection to Time-Series Analytics microservice..."; \
163182
response=$$(curl -s -o /tmp/config_response.json -w "%{http_code}" \
164-
-X POST https://localhost:3000/ts-api/config \
183+
-X POST https://localhost:${GRAFANA_PORT}/ts-api/config \
165184
-H 'accept: application/json' \
166185
-H 'Content-Type: application/json' \
167186
-d @$$config_file \
@@ -184,8 +203,6 @@ up: check_env_variables validate_host_ip down
184203
else \
185204
$(DOCKER_COMPOSE) up -d; \
186205
fi; \
187-
echo "Waiting 5 seconds before uploading UDF deployment package..."; \
188-
sleep 5; \
189206
$(MAKE) upload_zip_file
190207

191208
# Status of the deployed containers
@@ -249,7 +266,6 @@ gen_helm_charts:
249266
@cp -f configs/mqtt-broker/*.conf helm/
250267
@cp -f configs/telegraf/config/*.conf helm/
251268
@cp -f configs/telegraf/entrypoint.sh helm/telegraf_entrypoint.sh
252-
@cp -f configs/time-series-analytics-microservice/config.json helm/
253269
@cp -f configs/nginx/nginx-cert-gen.sh helm/nginx-cert-gen.sh
254270
@cp -f configs/nginx/nginx.conf helm/nginx.conf
255271
@cp -f configs/dlstreamer-pipeline-server/config.json helm/dlstreamer-pipeline-server.json

manufacturing-ai-suite/industrial-edge-insights-multimodal/docs/user-guide/get-started/deploy-with-helm.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,14 @@ this sample application in Kubernetes environment:
133133
- weld_anomaly_detector.py
134134
```
135135

136-
2. Copy your new UDF package to the `time-series-analytics-microservice` pod:
136+
2. Upload your new UDF package to the `time-series-analytics-microservice` pod:
137137

138138
```bash
139139
cd edge-ai-suites/manufacturing-ai-suite/industrial-edge-insights-multimodal/configs/time-series-analytics-microservice # path relative to git clone folder
140-
mkdir -p weld_anomaly_detector
141-
cp -r models tick_scripts udfs weld_anomaly_detector/.
140+
rm -f weld_anomaly_detector.zip
141+
zip -r weld_anomaly_detector udfs/ models/ tick_scripts/
142142
143-
POD_NAME=$(kubectl get pods -n multimodal-sample-app -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep deployment-time-series-analytics-microservice | head -n 1)
144-
145-
kubectl cp weld_anomaly_detector $POD_NAME:/tmp/ -n multimodal-sample-app
143+
curl -X POST https://localhost:30001/ts-api/update_udf_deployment_package -F "file=@weld_anomaly_detector.zip" -k
146144
```
147145

148146
> **Note:**
@@ -189,9 +187,9 @@ curl -k https://localhost:30001/dsps-api/pipelines/user_defined_pipelines/weld_d
189187
Run the following command to activate the UDF deployment package:
190188

191189
```bash
192-
curl -k -X 'GET' \
193-
'https://localhost:30001/ts-api/config?restart=true' \
194-
-H 'accept: application/json'
190+
cd edge-ai-suites/manufacturing-ai-suite/industrial-edge-insights-multimodal/configs/time-series-analytics-microservice
191+
192+
curl -s -X POST https://localhost:30001/ts-api/config -H 'accept: application/json' -H 'Content-Type: application/json' -d @config.json -k
195193
```
196194

197195
## Step 6: Verify the Results

manufacturing-ai-suite/industrial-edge-insights-multimodal/helm/templates/provision-configmap.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,6 @@ data:
6868
---
6969
apiVersion: v1
7070
kind: ConfigMap
71-
metadata:
72-
namespace: {{ .Values.namespace }}
73-
name: time-series-analytics-microservice-config
74-
data:
75-
config.json: |-
76-
{{ .Files.Get "config.json" | indent 4 }}
77-
---
78-
apiVersion: v1
79-
kind: ConfigMap
8071
metadata:
8172
namespace: {{ .Values.namespace }}
8273
name: grafana-dashboard-yml

manufacturing-ai-suite/industrial-edge-insights-multimodal/helm/templates/time-series-analytics-microservice.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ spec:
7070
volumeMounts:
7171
- name: vol-temp-time-series-analytics-microservice
7272
mountPath: /tmp
73-
- name: time-series-analytics-microservice-config
74-
mountPath: /app/config.json
75-
subPath: config.json
7673
- name: dev-dri
7774
mountPath: /dev/dri
7875
readOnly: true # Reduce risk while preserving access to GPU/NPU devices
@@ -124,9 +121,6 @@ spec:
124121
volumes:
125122
- name: vol-temp-time-series-analytics-microservice
126123
emptyDir: {}
127-
- name: time-series-analytics-microservice-config
128-
configMap:
129-
name: time-series-analytics-microservice-config
130124
- name: dev-dri
131125
hostPath:
132126
path: /dev/dri

manufacturing-ai-suite/industrial-edge-insights-time-series/Makefile

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
DEFAULT_SAMPLE_APP := wind-turbine-anomaly-detection
88
SAMPLE_APP_LIST := wind-turbine-anomaly-detection weld-anomaly-detection
99
HELM_REGISTRY := oci://registry-1.docker.io/intel
10+
MAKEFLAGS += --no-print-directory
1011

1112
ifdef app
1213
ifeq ($(filter $(app),$(SAMPLE_APP_LIST)),)
@@ -117,6 +118,22 @@ check_env_variables:
117118
esac; \
118119
done
119120

121+
.PHONY: wait_for_tsam
122+
wait_for_tsam:
123+
@echo "Waiting for Time-Series Analytics microservice to be accessible..."; \
124+
max_retries=30; \
125+
retry=0; \
126+
until [ "$$(curl -sk -o /dev/null -w '%{http_code}' https://localhost:3000/ts-api/health)" != "000" ]; do \
127+
retry=$$((retry + 1)); \
128+
if [ $$retry -ge $$max_retries ]; then \
129+
echo "Timed out waiting for Time-Series Analytics microservice after $$max_retries attempts."; \
130+
exit 1; \
131+
fi; \
132+
echo " Not accessible yet (attempt $$retry/$$max_retries), retrying in 5s..."; \
133+
sleep 5; \
134+
done; \
135+
echo "Time-Series Analytics microservice is accessible."
136+
120137
.PHONY: upload_zip_file
121138
upload_zip_file:
122139
@echo "Creating UDF deployment zip for $(SAMPLE_APP)..."
@@ -128,10 +145,11 @@ upload_zip_file:
128145
if [ -d models ] && [ -n "$$(ls -A models 2>/dev/null)" ]; then folders="$$folders models"; fi; \
129146
zip -r $$zip_file $$folders && \
130147
echo "Created: $$zip_file"
148+
@$(MAKE) wait_for_tsam
131149
@echo "Uploading UDF deployment zip for $(SAMPLE_APP) to Time-Series Analytics microservice..."; \
132150
zip_file=$(CURDIR)/apps/$(SAMPLE_APP)/time-series-analytics-config/$(SAMPLE_APP).zip; \
133151
response=$$(curl -s -o /tmp/upload_response.json -w "%{http_code}" \
134-
-X POST https://localhost:3000/ts-api/update_udf_deployment_package \
152+
-X POST https://localhost:${GRAFANA_PORT}/ts-api/update_udf_deployment_package \
135153
-F "file=@$$zip_file" \
136154
-k); \
137155
if [ "$$response" = "200" ]; then \
@@ -150,9 +168,10 @@ post_config:
150168
echo "Error: config.json not found at $$config_file"; \
151169
exit 1; \
152170
fi; \
171+
$(MAKE) wait_for_tsam; \
153172
echo "Posting config for $(SAMPLE_APP) to Time-Series Analytics microservice..."; \
154173
response=$$(curl -s -o /tmp/config_response.json -w "%{http_code}" \
155-
-X POST https://localhost:3000/ts-api/config \
174+
-X POST https://localhost:${GRAFANA_PORT}/ts-api/config \
156175
-H 'accept: application/json' \
157176
-H 'Content-Type: application/json' \
158177
-d @$$config_file \
@@ -186,8 +205,6 @@ up_mqtt_ingestion: check_env_variables down
186205
done; \
187206
$(DOCKER_COMPOSE) up --scale ia-opcua-server=0 -d $(shell $(DOCKER_COMPOSE) config --services | grep -v ia-mqtt-publisher); \
188207
fi; \
189-
echo "Waiting 5 seconds before uploading UDF deployment package..."; \
190-
sleep 5; \
191208
$(MAKE) upload_zip_file app=$(SAMPLE_APP);
192209

193210
# Run Docker containers
@@ -209,8 +226,6 @@ up_opcua_ingestion: check_env_variables down
209226
else \
210227
$(DOCKER_COMPOSE) up --scale ia-opcua-server=$(num_of_streams) --scale ia-mqtt-publisher=0 -d; \
211228
fi; \
212-
echo "Waiting 5 seconds before uploading UDF deployment package..."; \
213-
sleep 5; \
214229
$(MAKE) upload_zip_file app=$(SAMPLE_APP);
215230

216231

@@ -277,7 +292,6 @@ gen_helm_charts:
277292
@rm -rf helm/simulation-data
278293
@cp -rf apps/${SAMPLE_APP}/simulation-data helm/
279294
@cp -f apps/${SAMPLE_APP}/telegraf-config/*.conf helm
280-
@cp -f apps/${SAMPLE_APP}/time-series-analytics-config/config.json helm/
281295
@cp -f configs/telegraf/entrypoint.sh helm/telegraf_entrypoint.sh
282296
@cp -f configs/nginx/nginx-cert-gen.sh helm/nginx-cert-gen.sh
283297
@cp -f configs/nginx/nginx.conf helm/nginx.conf

manufacturing-ai-suite/industrial-edge-insights-time-series/docs/user-guide/get-started/deploy-with-helm.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,10 @@ To copy your own or existing model into Time Series Analytics Microservice in or
189189
```sh
190190
export SAMPLE_APP="wind-turbine-anomaly-detection"
191191
cd edge-ai-suites/manufacturing-ai-suite/industrial-edge-insights-time-series/apps/wind-turbine-anomaly-detection/time-series-analytics-config # path relative to git clone folder
192-
mkdir -p $SAMPLE_APP
193-
cp -r models tick_scripts udfs $SAMPLE_APP/.
192+
rm -f ${SAMPLE_APP}.zip
193+
zip -r ${SAMPLE_APP}.zip models/ tick_scripts/ udfs/
194194
195-
POD_NAME=$(kubectl get pods -n ts-sample-app -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep deployment-time-series-analytics-microservice | head -n 1)
196-
197-
kubectl cp $SAMPLE_APP $POD_NAME:/tmp/ -n ts-sample-app
195+
curl -X POST https://localhost:30001/ts-api/update_udf_deployment_package -F "file=@${SAMPLE_APP}.zip" -k
198196
```
199197

200198
<!--hide_directive:::
@@ -221,12 +219,10 @@ To copy your own or existing model into Time Series Analytics Microservice in or
221219
```sh
222220
export SAMPLE_APP="weld-anomaly-detection"
223221
cd edge-ai-suites/manufacturing-ai-suite/industrial-edge-insights-time-series/apps/weld-anomaly-detection/time-series-analytics-config # path relative to git clone folder
224-
mkdir -p $SAMPLE_APP
225-
cp -r models tick_scripts udfs $SAMPLE_APP/.
226-
227-
POD_NAME=$(kubectl get pods -n ts-sample-app -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep deployment-time-series-analytics-microservice | head -n 1)
222+
rm -f ${SAMPLE_APP}.zip
223+
zip -r ${SAMPLE_APP}.zip models/ tick_scripts/ udfs/
228224
229-
kubectl cp $SAMPLE_APP $POD_NAME:/tmp/ -n ts-sample-app
225+
curl -X POST https://localhost:30001/ts-api/update_udf_deployment_package -F "file=@${SAMPLE_APP}.zip" -k
230226
```
231227

232228
<!--hide_directive:::
@@ -253,9 +249,9 @@ To copy your own or existing model into Time Series Analytics Microservice in or
253249
Run the following command to activate the UDF deployment package:
254250

255251
```sh
256-
curl -k -X 'GET' \
257-
'https://<HOST_IP>:30001/ts-api/config?restart=true' \
258-
-H 'accept: application/json'
252+
cd edge-ai-suites/manufacturing-ai-suite/industrial-edge-insights-time-series/apps/${SAMPLE_APP}/time-series-analytics-config
253+
254+
curl -s -X POST https://localhost:30001/ts-api/config -H 'accept: application/json' -H 'Content-Type: application/json' -d @config.json -k
259255
```
260256

261257
## Step 6: Verify the Results

manufacturing-ai-suite/industrial-edge-insights-time-series/helm/templates/provision-configmap.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,6 @@ data:
6868
---
6969
apiVersion: v1
7070
kind: ConfigMap
71-
metadata:
72-
namespace: {{ .Values.namespace }}
73-
name: time-series-analytics-microservice-config
74-
data:
75-
config.json: |-
76-
{{ .Files.Get "config.json" | indent 4 }}
77-
---
78-
apiVersion: v1
79-
kind: ConfigMap
8071
metadata:
8172
namespace: {{ .Values.namespace }}
8273
name: grafana-dashboard-yml

manufacturing-ai-suite/industrial-edge-insights-time-series/helm/templates/time-series-analytics-microservice.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ spec:
7070
volumeMounts:
7171
- name: vol-temp-time-series-analytics-microservice
7272
mountPath: /tmp
73-
- name: time-series-analytics-microservice-config
74-
mountPath: /app/config.json
7573
subPath: config.json
7674
- name: dev-dri
7775
mountPath: /dev/dri
@@ -126,9 +124,6 @@ spec:
126124
volumes:
127125
- name: vol-temp-time-series-analytics-microservice
128126
emptyDir: {}
129-
- name: time-series-analytics-microservice-config
130-
configMap:
131-
name: time-series-analytics-microservice-config
132127
- name: dev-dri
133128
hostPath:
134129
path: /dev/dri

0 commit comments

Comments
 (0)