[Wind Turbine Sample App] PR workflow (by @pooja-intel via pull_request) #57
Workflow file for this run
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: "[Wind Turbine Sample App] PR workflow" | |
run-name: "[Wind Turbine Sample App] PR workflow (by @${{ github.actor }} via ${{ github.event_name }})" | |
on: | |
pull_request: | |
paths: | |
- 'manufacturing-ai-suite/wind-turbine-anomaly-detection/*' | |
workflow_call: | |
workflow_dispatch: | |
permissions: {} | |
jobs: | |
windturbine-sample-app-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 Wind Turbine Anomaly Detection Sample App | |
run: | | |
cd ./timeseries/manufacturing-ai-suite/wind-turbine-anomaly-detection | |
make down | |
# Generate random values for sensitive environment variables | |
INFLUXDB_USERNAME=$(openssl rand -hex 4) | |
INFLUXDB_PASSWORD=$(openssl rand -hex 6) | |
VISUALIZER_GRAFANA_USER=$(openssl rand -hex 4) | |
VISUALIZER_GRAFANA_PASSWORD=$(openssl rand -hex 6) | |
MR_PSQL_PASSWORD=$(openssl rand -hex 4) | |
MR_MINIO_ACCESS_KEY=$(openssl rand -hex 4) | |
MR_MINIO_SECRET_KEY=$(openssl rand -hex 4) | |
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/MR_PSQL_PASSWORD=.*/MR_PSQL_PASSWORD=${MR_PSQL_PASSWORD}/g" .env | |
sed -i "s/MR_MINIO_ACCESS_KEY=.*/MR_MINIO_ACCESS_KEY=${MR_MINIO_ACCESS_KEY}/g" .env | |
sed -i "s/MR_MINIO_SECRET_KEY=.*/MR_MINIO_SECRET_KEY=${MR_MINIO_SECRET_KEY}/g" .env | |
make build | |
- name: Deploying Wind Turbine Anomaly Detection Sample App | |
run: | | |
cd "${{ github.workspace }}" | |
cd ./timeseries/manufacturing-ai-suite/wind-turbine-anomaly-detection | |
echo "Deploying Wind Turbine Anomaly Detection Sample App" | |
echo "Deploying using mqtt ingestion" | |
make up_mqtt_ingestion | |
echo "Deploying using opcua ingestion" | |
make up_opcua_ingestion | |
- name: Undeploying Wind Turbine Anomaly Detection Sample App | |
run: | | |
cd "${{ github.workspace }}" | |
cd ./timeseries/manufacturing-ai-suite/wind-turbine-anomaly-detection | |
make down |