Deploy with Helm#
This guide provides step-by-step instructions for deploying the Industrial Edge Insights - Time Series sample application using Helm.
Prerequisites#
K8s installation on single or multi node must be done as prerequisite to continue the following deployment. Note: The Kubernetes cluster is set up with
kubeadm,kubectlandkubeletpackages on single and multi nodes withv1.30.2. Refer to tutorials such as https://adamtheautomator.com/installing-kubernetes-on-ubuntu and many other online tutorials to setup kubernetes cluster on the web with host OS as Ubuntu 22.04.For Helm installation, refer to helm website
Note If Ubuntu Desktop is not installed on the target system, follow the instructions from Ubuntu to install Ubuntu desktop. The target system refers to the system where you are installing the application.
Step 1: Generate or download the Helm charts#
Choose one of the following approaches to get the Helm charts:
Option A: Download the Helm charts
Download Helm chart:
helm pull oci://registry-1.docker.io/intel/wind-turbine-anomaly-detection-sample-app --version 1.1.0-rc2
Extract the Helm chart:
tar -xvzf wind-turbine-anomaly-detection-sample-app-1.1.0-rc2.tgz cd wind-turbine-anomaly-detection-sample-app
Proceed to Step 2 to configure your
values.yamlfile present in the current directory.
Option B: Generate Helm charts
Navigate to the source directory:
cd edge-ai-suites/manufacturing-ai-suite/industrial-edge-insights-time-series # path relative to git clone folder
Generate the charts:
make gen_helm_charts app=wind-turbine-anomaly-detection version=1.1.0-rc2 cd helm/
Proceed to Step 2 to configure your
values.yamlfile present in the current directory.
Option A: Download the Helm charts
Download Helm chart:
helm pull oci://registry-1.docker.io/intel/weld-anomaly-detection-sample-app --version 1.0.0-rc2
Extract the Helm chart:
tar -xvzf weld-anomaly-detection-sample-app-1.0.0-rc2.tgz cd weld-anomaly-detection-sample-app
Proceed to Step 2 to configure your
values.yamlfile present in the current directory.
Option B: Generate Helm charts
Navigate to the source directory:
cd edge-ai-suites/manufacturing-ai-suite/industrial-edge-insights-time-series # path relative to git clone folder
Generate the charts:
make gen_helm_charts app=weld-anomaly-detection version=1.0.0-rc2 cd helm/
Proceed to Step 2 to configure your
values.yamlfile present in the current directory.
Step 2: Configure and update the environment variables#
Update the following fields in
values.yamlfile of the helm chartINFLUXDB_USERNAME: INFLUXDB_PASSWORD: VISUALIZER_GRAFANA_USER: VISUALIZER_GRAFANA_PASSWORD: HTTP_PROXY: # example: http_proxy: http://proxy.example.com:891 HTTPS_PROXY: # example: http_proxy: http://proxy.example.com:891
Step 3: Install Helm charts#
Note:
Uninstall the Helm charts if already installed.
Note the
helm installcommand fails if the above required fields are not populated as per the rules called out invalues.yamlfile.
To install Helm charts, use one of the following options:
OPC-UA ingestion flow:
helm install ts-wind-turbine-anomaly --set env.TELEGRAF_INPUT_PLUGIN=opcua . -n ts-sample-app --create-namespace
MQTT ingestion flow:
helm install ts-wind-turbine-anomaly --set env.TELEGRAF_INPUT_PLUGIN=mqtt_consumer . -n ts-sample-app --create-namespace
Note: To deploy with GPU support for inferencing, use the following command:
helm install ts-wind-turbine-anomaly \ --set privileged_access_required=true \ --set env.TELEGRAF_INPUT_PLUGIN=<input_plugin> \ . -n ts-sample-app --create-namespaceThe
privileged_access_required=truesetting enables Time Series Analytics Microservice access to GPU device through/dev/dri.
To install Helm charts, run the following command:
helm install ts-weld-anomaly . -n ts-sample-app --create-namespace
Step 4: Copy the udf package for helm deployment to Time Series Analytics Microservice#
To copy your own or existing model into Time Series Analytics Microservice in order to run this sample application in Kubernetes environment:
The following udf package is placed in the repository under
edge-ai-suites/manufacturing-ai-suite/industrial-edge-insights-time-series/apps/wind-turbine-anomaly-detection/time-series-analytics-config.- time-series-analytics-config/ - models/ - windturbine_anomaly_detector.pkl - tick_scripts/ - windturbine_anomaly_detector.tick - udfs/ - requirements.txt - windturbine_anomaly_detector.py
Copy your new UDF package (using the wind turbine anomaly detection UDF package as an example) to the
time-series-analytics-microservicepod:export SAMPLE_APP="wind-turbine-anomaly-detection" 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 mkdir -p $SAMPLE_APP cp -r models tick_scripts udfs $SAMPLE_APP/. 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) kubectl cp $SAMPLE_APP $POD_NAME:/tmp/ -n ts-sample-app
To copy your own or existing model into Time Series Analytics Microservice in order to run this sample application in Kubernetes environment:
The following udf package is placed in the repository under
edge-ai-suites/manufacturing-ai-suite/industrial-edge-insights-time-series/apps/weld-anomaly-detection/time-series-analytics-config.- time-series-analytics-config/ - models/ - weld_anomaly_detector.cb - tick_scripts/ - weld_anomaly_detector.tick - udfs/ - requirements.txt - weld_anomaly_detector.py
Copy your new UDF package (using the weld anomaly detection UDF package as an example) to the
time-series-analytics-microservicepod:export SAMPLE_APP="weld-anomaly-detection" 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 mkdir -p $SAMPLE_APP cp -r models tick_scripts udfs $SAMPLE_APP/. 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) kubectl cp $SAMPLE_APP $POD_NAME:/tmp/ -n ts-sample-app
Note: Run the commands only after performing the Helm install.
Step 5: Activate the New UDF Deployment Package#
NOTE: To activate the UDF inferencing on GPU, additionally run the following command as a prerequisite before activating the UDF deployment package:
curl -k -X 'POST' \ 'https://<HOST_IP>:30001/ts-api/config' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '<Add contents of edge-ai-suites/manufacturing-ai-suite/industrial-edge-insights-time-series/apps/wind-turbine-anomaly-detection/time-series-analytics-config/config.json with device value updated to gpu from cpu>'GPU Inferencing is supported only for
Wind Turbine Anomaly Detectionsample app
Run the following command to activate the UDF deployment package:
curl -k -X 'GET' \
'https://<HOST_IP>:30001/ts-api/config?restart=true' \
-H 'accept: application/json'
Step 6: Verify the Results#
Follow the verification steps in the Get Started guide.
Uninstall Helm Charts#
helm uninstall ts-wind-turbine-anomaly -n ts-sample-app
kubectl get all -n ts-sample-app # It may take a few minutes for all application resources to be cleaned up.
helm uninstall ts-weld-anomaly -n ts-sample-app
kubectl get all -n ts-sample-app # It may take a few minutes for all application resources to be cleaned up.
Configure Alerts in Time Series Analytics Microservice#
To configure alerts in Time Series Analytics Microservice, follow the steps in Time Series Analytics Helm Deployment.
Deploy the Application with a Custom UDF#
To deploy the application with a custom UDF, follow the steps in Custom UDF Helm Deployment.
Troubleshooting#
Check pod details or container logs to diagnose failures:
kubectl get pods -n ts-sample-app kubectl describe pod <pod_name> -n ts-sample-app # Shows details of the pod kubectl logs -f <pod_name> -n ts-sample-app # Shows logs of the container in the pod