CI/CD cho Machine Learning
Ravi Bhadauria
Machine Learning Engineer

Chuỗi stage định nghĩa quy trình ML và phụ thuộc
Được định nghĩa trong tệp dvc.yaml
deps)cmd)outs)metrics và plotsTương tự workflow GitHub Actions
dvc stage adddvc stage add \
-n preprocess \
-d raw_data.csv -d preprocess.py \
-o processed_data.csv \
python preprocess.py
dvc.yamlstages:
preprocess:
cmd: python preprocess.py
deps:
- preprocess.py
- raw_data.csv
outs:
- processed_data.csv
dvc stage add \
-n train \
-d train.py -d processed_data.csv \
-o plots.png -o metrics.txt \
python train.py
stages: preprocess: cmd: python preprocess.py deps: - preprocess.py - raw_data.csv outs: - processed_data.csvtrain: cmd: python train.py deps: - processed_data.csv - train.py outs: - plots.png
dvc repro-> dvc repro Running stage 'preprocess': > python preprocess.pyRunning stage 'train': > python train.py Updating lock file 'dvc.lock'
dvc.lock được tạo.dvc, lưu băm MD5git add dvc.lock && git commit -m "first pipeline repro"`-> dvc repro
Stage 'preprocess' didn't change, skipping
Running stage 'train' with command: ...
-> dvc dag
+------------+
| preprocess |
+------------+
*
*
*
+-------+
| train |
+-------+
dvc.yaml và dvc.lockdvc stage adddvc reprodvc dagCI/CD cho Machine Learning