From b19261209449f5a6018fc143a7ba44786ede01c4 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 29 Nov 2022 18:48:55 +0000 Subject: [PATCH] home: fixup bitbucket --- .../pages/Home/UseCasesSection/index.tsx | 140 +++++++++--------- 1 file changed, 71 insertions(+), 69 deletions(-) diff --git a/src/components/pages/Home/UseCasesSection/index.tsx b/src/components/pages/Home/UseCasesSection/index.tsx index 37a86e8f..76a369f4 100644 --- a/src/components/pages/Home/UseCasesSection/index.tsx +++ b/src/components/pages/Home/UseCasesSection/index.tsx @@ -109,6 +109,7 @@ const UseCasesSection: React.ForwardRefRenderFunction = () => (
pip install -r requirements.txt
python train.py # generate plot.png
+
# Create CML report
cat metrics.txt >> report.md
@@ -131,19 +132,20 @@ const UseCasesSection: React.ForwardRefRenderFunction = () => (
image: iterativeai/cml:0-dvc2-base1
pipelines:
-
default:
-
- step:
-
name: Train model
-
script:
+
default:
+
- step:
+
name: Train and Report
+
script:
-
- pip install -r requirements.txt
-
- python train.py # generate plot.png
+
- 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
+
# Create CML report
+
- cat metrics.txt >> report.md
+
- echo '![](./plot.png "Confusion Matrix")' >> report.md
+
- cml comment create report.md
@@ -254,30 +256,32 @@ const UseCasesSection: React.ForwardRefRenderFunction = () => (
image: iterativeai/cml:0-dvc2-base1
pipelines:
-
default:
-
- step:
-
name: Train model
-
script:
+
default:
+
- step:
+
name: Train model
+
script:
-
- dvc pull data
+
- dvc pull data
-
- pip install -r requirements.txt
-
- dvc repro
+
- pip install -r requirements.txt
+
- dvc repro
-
+
- step:
+
name: Create CML report
+
script:
-
# 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
+
# 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 Bitbucket
+
- cml comment create report.md
@@ -334,7 +338,7 @@ const UseCasesSection: React.ForwardRefRenderFunction = () => (
container: docker://ghcr.io/iterative/cml:0-dvc2-base1
steps:
- uses: actions/checkout@v3
-
- name: Train model
+
- name: Train and Report
env:
REPO_TOKEN: {"${{ secrets.GITHUB_TOKEN }}"}
@@ -366,23 +370,23 @@ const UseCasesSection: React.ForwardRefRenderFunction = () => (
image: iterativeai/cml:0-dvc2-base1
pipelines:
-
default:
-
- step:
-
name: Train model
-
script:
+
default:
+
- step:
+
name: Train and Report
+
script:
+
- pip install -r requirements.txt
-
- pip install -r requirements.txt
-
- cml tensorboard connect
-
--logdir=./logs
-
--name="Go to tensorboard"
-
--md >> report.md
+
- cml tensorboard connect
+
--logdir=./logs
+
--name="Go to tensorboard"
+
--md >> report.md
-
- cml comment create report.md
+
- cml comment create report.md
-
- python train.py # generate ./logs
+
- python train.py # generate ./logs
@@ -472,7 +476,7 @@ const UseCasesSection: React.ForwardRefRenderFunction = () => (
- uses: actions/checkout@v3
with:
ref: {"${{ github.event.pull_request.head.sha }}"}
-
- name: Train model
+
- name: Train and Report
run: |
pip install -r requirements.txt
@@ -497,42 +501,40 @@ const UseCasesSection: React.ForwardRefRenderFunction = () => ( )} bitbucket={( - +
pipelines:
-
default:
-
- step:
-
name: deploy-runner
-
image: iterativeai/cml:0-dvc2-base1
-
script:
-
- |
+
default:
+
- step:
+
name: Launch Runner
+
image: iterativeai/cml:0-dvc2-base1
+
script:
+
# Supports AWS, Azure, GCP, K8s
-
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:
+
- cml runner launch
+
--cloud=aws
+
--cloud-region=us-west
+
--cloud-type=m5.2xlarge
+
--cloud-spot
+
--labels=cml.runner
+
- step:
+
runs-on: [self.hosted, cml.runner]
+
+
name: Train and Report
+
image: iterativeai/cml:0-dvc2-base1
+
script:
-
- pip install -r requirements.txt
-
- python train.py # generate plot.png
+
- 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
+
- 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
- + Bitbucket Cloud report example