[Industrial Edge Insights Time Series and Multimodal] PR workflow (by @sathyendranv via pull_request) #130
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Apache v2 license | |
| # Copyright (C) 2025 Intel Corporation | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # | |
| name: "[Industrial Edge Insights Time Series and Multimodal] PR workflow" | |
| run-name: "[Industrial Edge Insights Time Series and Multimodal] PR workflow (by @${{ github.actor }} via ${{ github.event_name }})" | |
| on: | |
| pull_request: | |
| paths: | |
| - 'manufacturing-ai-suite/industrial-edge-insights-time-series/*' | |
| - 'manufacturing-ai-suite/industrial-edge-insights-multimodal/*' | |
| workflow_call: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: read | |
| pull-requests: read | |
| security-events: write | |
| actions: read | |
| jobs: | |
| industrial-edge-insights-time-series-pre-merge-build: | |
| permissions: | |
| contents: read | |
| packages: read # needed for actions/checkout | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Runner workspace path | |
| run: | | |
| echo "Cleaning up previous run" | |
| if [ -n "$(docker ps -aq)" ]; then | |
| docker stop $(docker ps -aq) | |
| fi | |
| if [ -n "$(docker ps -aq)" ]; then | |
| docker rm $(docker ps -aq) | |
| fi | |
| docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi -f | |
| - name: Checkout edge-ai-libraries (main) | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: open-edge-platform/edge-ai-libraries | |
| ref: main | |
| path: edge-ai-libraries | |
| persist-credentials: false | |
| - name: Building Time Series Analytics microservices | |
| run: | | |
| cd ./edge-ai-libraries/microservices/time-series-analytics/docker | |
| docker compose down -v | |
| docker compose build | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: timeseries | |
| persist-credentials: false | |
| - name: Building Time Series Sample App | |
| run: | | |
| cd ./timeseries/manufacturing-ai-suite/industrial-edge-insights-time-series | |
| make down | |
| # Generate random values for sensitive environment variables | |
| INFLUXDB_USERNAME=$(cat /dev/urandom | tr -dc 'a-zA-Z' | head -c 8) | |
| base=$(tr -dc 'a-zA-Z' </dev/urandom | head -c9) | |
| digit=$(tr -dc '0-9' </dev/urandom | head -c1) | |
| pos=$((RANDOM % 10)) | |
| INFLUXDB_PASSWORD=${base:0:$pos}${digit}${base:$pos} | |
| VISUALIZER_GRAFANA_USER=$(cat /dev/urandom | tr -dc 'a-zA-Z' | head -c 8) | |
| VISUALIZER_GRAFANA_PASSWORD=${base:0:$pos}${digit}${base:$pos} | |
| sed -i "s/INFLUXDB_USERNAME=.*/INFLUXDB_USERNAME=${INFLUXDB_USERNAME}/g" .env | |
| sed -i "s/INFLUXDB_PASSWORD=.*/INFLUXDB_PASSWORD=${INFLUXDB_PASSWORD}/g" .env | |
| sed -i "s/VISUALIZER_GRAFANA_USER=.*/VISUALIZER_GRAFANA_USER=${VISUALIZER_GRAFANA_USER}/g" .env | |
| sed -i "s/VISUALIZER_GRAFANA_PASSWORD=.*/VISUALIZER_GRAFANA_PASSWORD=${VISUALIZER_GRAFANA_PASSWORD}/g" .env | |
| make build | |
| - name: Deploying Wind Turbine Anomaly Detection Sample App | |
| run: | | |
| cd "${{ github.workspace }}" | |
| cd ./timeseries/manufacturing-ai-suite/industrial-edge-insights-time-series | |
| echo "Deploying Wind Turbine Anomaly Detection Sample App" | |
| echo "Deploying using mqtt ingestion" | |
| make up_mqtt_ingestion app=wind-turbine-anomaly-detection | |
| echo "Deploying using opcua ingestion" | |
| make up_opcua_ingestion app=wind-turbine-anomaly-detection | |
| - name: Undeploying Wind Turbine Anomaly Detection Sample App | |
| run: | | |
| cd "${{ github.workspace }}" | |
| cd ./timeseries/manufacturing-ai-suite/industrial-edge-insights-time-series | |
| make down | |
| - name: Deploying Weld Anomaly Detection Sample App | |
| run: | | |
| cd "${{ github.workspace }}" | |
| cd ./timeseries/manufacturing-ai-suite/industrial-edge-insights-time-series | |
| echo "Deploying Weld Anomaly Detection Sample App" | |
| make up_mqtt_ingestion app=weld-anomaly-detection | |
| - name: Undeploying Weld Anomaly Detection Sample App | |
| run: | | |
| cd "${{ github.workspace }}" | |
| cd ./timeseries/manufacturing-ai-suite/industrial-edge-insights-time-series | |
| make down | |
| - name: Building Multimodal Sample App | |
| run: | | |
| cd ./timeseries/manufacturing-ai-suite/industrial-edge-insights-multimodal | |
| make down | |
| # Generate random values for sensitive environment variables | |
| INFLUXDB_USERNAME=$(cat /dev/urandom | tr -dc 'a-zA-Z' | head -c 8) | |
| base=$(tr -dc 'a-zA-Z' </dev/urandom | head -c9) | |
| digit=$(tr -dc '0-9' </dev/urandom | head -c1) | |
| pos=$((RANDOM % 10)) | |
| INFLUXDB_PASSWORD=${base:0:$pos}${digit}${base:$pos} | |
| VISUALIZER_GRAFANA_USER=$(cat /dev/urandom | tr -dc 'a-zA-Z' | head -c 8) | |
| VISUALIZER_GRAFANA_PASSWORD=${base:0:$pos}${digit}${base:$pos} | |
| MTX_WEBRTCICESERVERS2_0_USERNAME=$(cat /dev/urandom | tr -dc 'a-zA-Z' | head -c 8) | |
| MTX_WEBRTCICESERVERS2_0_PASSWORD=$(openssl rand -hex 10) | |
| HOST_IP=$(hostname -I | awk '{print $1}') | |
| sed -i "s/INFLUXDB_USERNAME=.*/INFLUXDB_USERNAME=${INFLUXDB_USERNAME}/g" .env | |
| sed -i "s/INFLUXDB_PASSWORD=.*/INFLUXDB_PASSWORD=${INFLUXDB_PASSWORD}/g" .env | |
| sed -i "s/VISUALIZER_GRAFANA_USER=.*/VISUALIZER_GRAFANA_USER=${VISUALIZER_GRAFANA_USER}/g" .env | |
| sed -i "s/VISUALIZER_GRAFANA_PASSWORD=.*/VISUALIZER_GRAFANA_PASSWORD=${VISUALIZER_GRAFANA_PASSWORD}/g" .env | |
| sed -i "s/MTX_WEBRTCICESERVERS2_0_USERNAME=.*/MTX_WEBRTCICESERVERS2_0_USERNAME=${MTX_WEBRTCICESERVERS2_0_USERNAME}/g" .env | |
| sed -i "s/MTX_WEBRTCICESERVERS2_0_PASSWORD=.*/MTX_WEBRTCICESERVERS2_0_PASSWORD=${MTX_WEBRTCICESERVERS2_0_PASSWORD}/g" .env | |
| sed -i "s/HOST_IP=.*/HOST_IP=${HOST_IP}/g" .env | |
| make build | |
| - name: Deploying Multimodal Weld Defect Detection Sample App | |
| run: | | |
| cd "${{ github.workspace }}" | |
| cd ./timeseries/manufacturing-ai-suite/industrial-edge-insights-multimodal | |
| echo "Deploying Multimodal Weld Defect Detection Sample App" | |
| make up | |
| - name: Undeploying Multimodal Weld Defect Detection Sample App | |
| run: | | |
| cd "${{ github.workspace }}" | |
| cd ./timeseries/manufacturing-ai-suite/industrial-edge-insights-multimodal | |
| make down | |
| industrial-edge-insights-time-series-scans: | |
| uses: ./.github/workflows/industrial-edge-insights-time-series-scans.yml | |
| with: | |
| target: all-scans |