+ image: iterativeai/cml:0-dvc2-base1
+ pipelines:
+ default:
+ - step:
+ name: Train model
+ script:
+
+ - pip install -r requirements.txt
+ - python train.py # generate plot.png
+
+
+ # Create CML report
+ - cat metrics.txt >> report.md
+ - echo '![](./plot.png "Confusion Matrix")' >> report.md
+ - cml comment create report.md
+
+
+
+ image: iterativeai/cml:0-dvc2-base1
+ pipelines:
+ default:
+ - step:
+ name: Train model
+ script:
+
+ - dvc pull data
+
+
+
+ - pip install -r requirements.txt
+ - dvc repro
+
+
+
+ # Compare metrics to main
+ - git fetch --depth=1 origin main:main
+ - dvc metrics diff --show-md main >> report.md
+ # Plot training loss function diff
+ - dvc plots diff
+ --target loss.csv --show-vega main > vega.json
+ - vl2png vega.json > plot.png
+ - echo '![](./plot.png "Training Loss")' >> report.md
+ # Post CML report as a comment in GitLab
+ - cml comment create report.md
+
+
+
+ image: iterativeai/cml:0-dvc2-base1
+ pipelines:
+ default:
+ - step:
+ name: Train model
+ script:
+
+ - pip install -r requirements.txt
+ - cml tensorboard connect
+ --logdir=./logs
+ --name="Go to tensorboard"
+ --md >> report.md
+
+
+ - cml comment create report.md
+
+
+
+ - python train.py # generate ./logs
+
+
+
+ pipelines:
+ default:
+ - step:
+ name: deploy-runner
+ image: iterativeai/cml:0-dvc2-base1
+ script:
+ - |
+
+ cml runner \
+ --cloud=aws \
+ --cloud-region=us-west \
+ --cloud-type=m5.2xlarge \
+ --cloud-spot \
+ --labels=cml.runner
+
+ - step:
+ name: run
+
+ runs-on: [self.hosted, cml.runner]
+
+ image: iterativeai/cml:0-dvc2-base1
+ script:
+
+ - pip install -r requirements.txt
+ - python train.py # generate plot.png
+
+
+ - echo "## Report from your EC2 instance" >> report.md
+ - cat metrics.txt >> report.md
+ - echo '![](./plot.png "Confusion Matrix")' >> report.md
+ - cml comment create report.md
+
+
+
+
+ # GPU not yet supported, see https://github.com/iterative/cml/issues/1015
+
+ pipelines:
+ default:
+ - step:
+ name: deploy-runner
+ image: iterativeai/cml:0-dvc2-base1
+ script:
+ - |
+
+ cml runner \
+ --cloud=aws \
+ --cloud-region=us-west \
+ --cloud-type=m5.2xlarge \
+ --cloud-spot \
+ --labels=cml
+
+ - step:
+ name: run
+
+ runs-on: [self.hosted, cml]
+
+ image: iterativeai/cml:0-dvc2-base1
+ script:
+
+ - apt-get update -y
+ - apt install imagemagick -y
+ - pip install -r requirements.txt
+
+ - git fetch --prune
+ - dvc repro
+
+ - echo "# Style transfer" >> report.md
+ - git show origin/master:final_owl.png > master_owl.png
+ - convert +append final_owl.png master_owl.png out.png
+ - convert out.png -resize 75% out_shrink.png
+ - echo "### Workspace vs. Main" >> report.md
+ - cml publish out_shrink.png --md --title 'compare' >> report.md
+ - echo "## Training metrics" >> report.md
+ - dvc params diff master --show-md >> report.md
+ - echo >> report.md
+ - cml send-comment report.md
+
+
+