Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

.gitlab-ci.yml 2.1 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  1. report:
  2. rules:
  3. - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
  4. - if: $CI_COMMIT_BRANCH == 'main'
  5. image: dvcorg/cml:0-dvc3-base1
  6. before_script:
  7. - cml ci && cml --version
  8. - npm install -g json5
  9. script: |
  10. if [ $CI_COMMIT_REF_NAME = main ]; then
  11. PREVIOUS_REF=HEAD~1
  12. COMMIT_HASH1=$CI_COMMIT_BEFORE_SHA
  13. COMMIT_HASH2=$CI_COMMIT_SHA
  14. else
  15. PREVIOUS_REF=main
  16. git fetch --depth=1 origin main:main
  17. COMMIT_HASH1=$CI_MERGE_REQUEST_DIFF_BASE_SHA
  18. COMMIT_HASH2=$CI_COMMIT_SHA
  19. fi
  20. dvc pull eval
  21. dvc plots diff $PREVIOUS_REF workspace \
  22. --show-vega --targets ROC | json5 > vega.json
  23. vl2svg vega.json roc.svg
  24. dvc plots diff $PREVIOUS_REF workspace \
  25. --show-vega --targets Precision-Recall | json5 > vega.json
  26. vl2svg vega.json prc.svg
  27. dvc plots diff $PREVIOUS_REF workspace \
  28. --show-vega --targets Confusion-Matrix | json5 > vega.json
  29. vl2svg vega.json confusion.svg
  30. cp eval/plots/images/importance.png importance_workspace.png
  31. git checkout $PREVIOUS_REF -- dvc.lock
  32. cp eval/plots/images/importance.png importance_previous.png
  33. dvc_report=$(dvc exp diff $PREVIOUS_REF --md)
  34. cat <<EOF > report.md
  35. # CML Report
  36. [![DVC](https://img.shields.io/badge/-Open_in_Studio-grey?style=flat-square&logo=dvc)](https://studio.iterative.ai/team/Iterative/views/example-get-started-2gpv7kdqx2?panels=plots%2C%3Bcompare%2C&commits=${COMMIT_HASH2}%3B${COMMIT_HASH1}&activeCommits=${COMMIT_HASH1}%3Aprimary%3B${COMMIT_HASH2}%3Apurple)
  37. ## Plots
  38. ![ROC](./roc.svg)
  39. ![Precision-Recall](./prc.svg)
  40. ![Confusion Matrix](./confusion.svg)
  41. #### Feature Importance: ${PREVIOUS_REF}
  42. ![Feature Importance: ${PREVIOUS_REF}](./importance_previous.png)
  43. #### Feature Importance: workspace
  44. ![Feature Importance: workspace](./importance_workspace.png)
  45. ## Metrics and Params
  46. ### ${PREVIOUS_REF} → workspace
  47. ${dvc_report}
  48. EOF
  49. if [ $CI_COMMIT_REF_NAME = main ]; then
  50. cml comment create --target=commit report.md
  51. else
  52. cml comment update --target=pr report.md
  53. fi
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...