ML/.github/workflows/MLPipelinePullRequest.yml
2023-09-13 23:01:14 +01:00

97 lines
3 KiB
YAML

name: Build and test model using a dummy prediction pipeline
on:
# push:
# branches:
# - "model-**"
pull_request:
branches: [ "master" ]
label:
types: ["created", "edited"]
permissions: write-all
jobs:
No-Label:
if: ${{ github.event.label.name != 'major' }} || ${{ github.event.label.name != 'minor' }} || ${{ github.event.label.name != 'patch' }}
runs-on: ubuntu-latest
steps:
- name: No label associated with PR
run: |
echo "Please choose one of these tags: 'major', 'major', 'patch'"
exit(1)
# Verify-Model:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Install packages to retrieve artifacts
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.ROBOT_AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.ROBOT_AWS_SECRET_ACCESS_KEY }}
# run: |
# pip install --upgrade pip
# pip install -r modules/ml-pipeline/src/pipeline/src/requirements/version_control/requirements.txt
# - name: Retrieve artifacts (dvc.lock)
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.ROBOT_AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.ROBOT_AWS_SECRET_ACCESS_KEY }}
# run: |
# cd modules/ml-pipeline/src/pipeline/src
# dvc pull -r experiments
# - name: Build Prediction docker Image
# run: |
# cd modules/ml-pipeline/src/pipeline/
# docker build . --file Prediction.Dockerfile --tag prediction_test
# - name: Run Prediction docker container
# run: |
# docker run prediction_test
# Trigger-CML:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Install packages to retrieve artifacts
# run: |
# pip install --upgrade pip
# pip install -r modules/ml-pipeline/src/pipeline/src/requirements/version_control/requirements.txt
# - name: Retrieve artifacts (dvc.lock)
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.ROBOT_AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.ROBOT_AWS_SECRET_ACCESS_KEY }}
# run: |
# cd modules/ml-pipeline/src/pipeline/src
# dvc pull -r experiments
# - uses: actions/setup-python@v4
# - uses: iterative/setup-cml@v1
# - name: Generate report
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.ROBOT_AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.ROBOT_AWS_SECRET_ACCESS_KEY }}
# REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# cd modules/ml-pipeline/src/pipeline/src
# echo "## Model metrics" > report.md
# # Compare metrics to master
# git fetch --depth=1 origin master:master
# dvc metrics diff --md --all master >> report.md
# cml comment create report.md
# # echo "## Residuals plot from model" >> report.md
# # metrics_location=$(find . -maxdepth 10 -name "residuals.png")
# # echo $metrics_location
# # cd $metric_location
# # echo "![](./residuals.png)" >> report.md