-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(example-get-started): add GitLab CI to publish reports (#283)
- Loading branch information
1 parent
3eb148c
commit 1ab0473
Showing
4 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
report: | ||
image: dvcorg/cml:0-dvc3-base1 | ||
before_script: | ||
- cml ci | ||
- npm install -g json5 | ||
script: | | ||
if [ $CI_COMMIT_BRANCH = main ]; then | ||
PREVIOUS_REF=HEAD~1 | ||
else | ||
PREVIOUS_REF=main | ||
git fetch --depth=1 origin main:main | ||
fi | ||
dvc pull eval | ||
dvc plots diff $PREVIOUS_REF workspace \ | ||
--show-vega --targets ROC | json5 > vega.json | ||
vl2svg vega.json roc.svg | ||
dvc plots diff $PREVIOUS_REF workspace \ | ||
--show-vega --targets Precision-Recall | json5 > vega.json | ||
vl2svg vega.json prc.svg | ||
dvc plots diff $PREVIOUS_REF workspace \ | ||
--show-vega --targets Confusion-Matrix | json5 > vega.json | ||
vl2svg vega.json confusion.svg | ||
cp eval/plots/images/importance.png importance_workspace.png | ||
git checkout $PREVIOUS_REF -- dvc.lock | ||
cp eval/plots/images/importance.png importance_previous.png | ||
dvc_report=$(dvc exp diff $PREVIOUS_REF --md) | ||
cat <<EOF > report.md | ||
# CML Report | ||
## Plots | ||
![ROC](./roc.svg) | ||
![Precision-Recall](./prc.svg) | ||
![Confusion Matrix](./confusion.svg) | ||
#### Feature Importance: ${PREVIOUS_REF} | ||
![Feature Importance: ${PREVIOUS_REF}](./importance_previous.png) | ||
#### Feature Importance: workspace | ||
![Feature Importance: workspace](./importance_workspace.png) | ||
## Metrics and Params | ||
### ${PREVIOUS_REF} → workspace | ||
${dvc_report} | ||
EOF | ||
cml comment create --publish --pr=false report.md |
This file contains 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
This file contains 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
This file contains 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