CI/CD per Machine Learning
Ravi Bhadauria
Machine Learning Instructor
ifjobs: hp_tune_and_publish_report: # Esegui quando il nome del branch inizia con hp_tune/ if: startsWith(github.head_ref, 'hp_tune/')steps: ... - name: | DVC pipeline per ottimizzazione iperparametri run: dvc repro -f hp_tune
jobs: train_and_publish_report: # Esegui quando il nome del branch inizia con train/ if: startsWith(github.head_ref, 'train/')steps: ... - name: Esegui la pipeline DVC per il training run: dvc repro train

hp_tune/

steps: - name: Create training branch env: REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Il nome del branch inizia con train/ export BRANCH_NAME=train/$(git rev-parse --short "${{ github.sha }}")# Crea PR per il training cml pr create \ --user-email [email protected] \ --user-name HPBot \ --message "Hyperparameter tuning" \ --branch $BRANCH_NAME \ --target-branch main \ rfc_best_params.json



GITHUB_TOKEN non può avviare workflow su PR create da sé
Soluzioni alternative
steps:
- env:
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
-> git checkout train/1f34fs
-> git commit --amend --no-edit && git push -f

CI/CD per Machine Learning