Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 9d22b7c

Browse files
committed
Merge branch 'master' into nav--menu
2 parents 19b43d8 + bbf58dd commit 9d22b7c

File tree

71 files changed

+3930
-5812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3930
-5812
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ defaults: &defaults
88
working_directory: ~/repo
99
docker:
1010
# Specify the version you desire here.
11-
- image: circleci/node:16
11+
- image: cimg/node:18.14.1
1212

1313
# Specify service dependencies here if necessary.
1414
# CircleCI maintains a library of pre-built images,
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Check Deployment
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
passci:
6+
description: 'Pass CI'
7+
required: true
8+
type: boolean
9+
pull_request:
10+
types: [opened, synchronize, reopened, labeled]
11+
12+
jobs:
13+
check-deployment:
14+
uses: iterative/gatsby-theme-iterative/.github/workflows/check-deployment.yml@main
15+
with:
16+
passci: ${{ inputs.passci || false }}

.github/workflows/link-check-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ on:
55
- cron: '0 0 * * *'
66
jobs:
77
run:
8-
uses: iterative/link-check/.github/workflows/link-check-all.yml@v0.13.1
8+
uses: iterative/link-check/.github/workflows/link-check-all.yml@v0.14.0

.github/workflows/link-check-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ on:
33
deployment_status:
44
jobs:
55
run:
6-
uses: iterative/link-check/.github/workflows/link-check-deployment-status.yml@v0.13.1
6+
uses: iterative/link-check/.github/workflows/link-check-deployment-status.yml@v0.14.0

content/docs/cml-with-dvc.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ jobs:
2121
# container: docker://ghcr.io/iterative/cml:0-dvc2-base1
2222
steps:
2323
- uses: actions/checkout@v3
24-
with:
25-
ref: ${{ github.event.pull_request.head.sha }}
2624
- uses: actions/setup-python@v4
2725
with:
2826
python-version: '3.x'
@@ -91,8 +89,6 @@ Windows, Python 3 should be setup first.
9189
```yaml
9290
steps:
9391
- uses: actions/checkout@v3
94-
with:
95-
ref: ${{ github.event.pull_request.head.sha }}
9692
- uses: iterative/setup-dvc@v1
9793
```
9894

@@ -103,8 +99,6 @@ steps:
10399
runs-on: windows-latest
104100
steps:
105101
- uses: actions/checkout@v3
106-
with:
107-
ref: ${{ github.event.pull_request.head.sha }}
108102
- uses: actions/setup-python@v4
109103
with:
110104
python-version: '3.x'
@@ -126,16 +120,16 @@ to the [latest release](https://github.com/iterative/dvc/releases)).
126120
</tab>
127121
<tab title="GitLab">
128122

129-
![](/img/github/dvc-report.png 'GitLab DVC report example')
123+
![](/img/gitlab/dvc-report.png 'GitLab DVC report example')
130124

131125
The `.gitlab-ci.yml` file to create this report is:
132126

133127
```yaml
134128
train-and-report:
135129
image: iterativeai/cml:0-dvc2-base1 # Python, DVC, & CML pre-installed
136130
script:
137-
- dvc pull data --run-cache # Pull data & run-cache from S3
138131
- pip install -r requirements.txt # Install dependencies
132+
- dvc pull data --run-cache # Pull data & run-cache from S3
139133
- dvc repro # Reproduce pipeline
140134
141135
# Create CML report
@@ -156,6 +150,39 @@ See the [example repository](https://gitlab.com/iterative.ai/cml-dvc-case) for
156150
more, or check out the
157151
[use cases for machine learning](https://dvc.org/doc/use-cases/ci-cd-for-machine-learning).
158152

153+
</tab>
154+
<tab title="Bitbucket">
155+
156+
![](/img/bitbucket/dvc-report.png 'Bitbucket DVC report example')
157+
158+
The `bitbucket-pipelines.yml` file to create this report is:
159+
160+
```yaml
161+
image: iterativeai/cml:0-dvc2-base1 # Python, DVC, & CML pre-installed
162+
pipelines:
163+
default:
164+
- step:
165+
name: Train model
166+
script:
167+
- pip install -r requirements.txt # Install dependencies
168+
- dvc pull data --run-cache # Pull data & run-cache from S3
169+
- dvc repro # Reproduce pipeline
170+
- step:
171+
name: Create CML report
172+
script:
173+
- echo "## Metrics: workflow vs. main" >> report.md
174+
- git fetch --depth=1 origin main:main
175+
- dvc metrics diff --show-md main >> report.md
176+
177+
- echo "## Plots" >> report.md
178+
- echo "### Training loss function diff" >> report.md
179+
- dvc plots diff --target loss.csv --show-vega main > vega.json
180+
- vl2png vega.json > plot.png
181+
- echo '![](./plot.png "Training Loss")' >> report.md
182+
183+
- cml comment create report.md
184+
```
185+
159186
</tab>
160187
</toggle>
161188

content/docs/ref/comment.md

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## create
44

5-
Post a Markdown report as a comment on a commit or pull/merge request.
5+
Post a markdown report as a comment on a commit, pull/merge request, or issue.
66

77
```usage
88
cml comment create [options] <markdown report file>
@@ -19,36 +19,58 @@ cml comment update [options] <markdown report file>
1919

2020
<admon type="tip">
2121

22-
If there's an associated pull/merge request, consider using `update` with the
23-
`--pr` flag.
24-
25-
</admon>
26-
27-
<admon type="tip">
28-
29-
If [`cml pr`](/doc/ref/pr) was used earlier in the workflow, use
30-
`--commit-sha=HEAD` to post comments to the new PR if desired.
22+
When using multiple reports, use
23+
[`--watermark-title=<...>`](#managing-multiple-comments) to specify which
24+
comment to `update`.
3125

3226
</admon>
3327

3428
## Options
3529

3630
Any [generic option](/doc/ref) in addition to:
3731

38-
- `--commit-sha=<rev>`, `--head-sha=<rev>`:
39-
[Git revision](https://git-scm.com/docs/gitrevisions) linked to this comment
40-
[default: `HEAD`].
41-
- `--pr`: Post to an existing PR/MR associated with the specified commit.
32+
- `--target=<pr|commit|issue>[/ref]`: Where to post/associate with the comment
33+
(`pr`, `commit`, `issue`), optionally with a reference (`issue/12`, `pr/17`,
34+
`commit/`[rev](https://git-scm.com/docs/gitrevisions) [default: `pr` falling
35+
back to `commit/HEAD`].
4236
- `--watch`: Watch for changes and automatically update the comment (doesn't
4337
exit, consider
4438
[appending `&` to run in the background](<https://en.wikipedia.org/wiki/Job_control_(Unix)#Implementation>)).
4539
- `--publish=<true|false>`: Upload any local images found in the Markdown report
4640
[default: `true`].
4741
- `--publish-native`: Use `--driver`'s native capabilities to `--publish` assets
4842
instead of `--publish-url` (not available on `--driver=github`).
49-
- `--publish-url=<url>`: Self-hosted image server URL [default:
43+
- `--publish-url=<...>`: Self-hosted image server URL [default:
5044
`https://asset.cml.dev`], see
5145
[minroud-s3](https://github.com/iterative/minroud-s3).
46+
- `--watermark-title=<...>`: Hidden comment marker (useful to
47+
[specify which comment to update](#managing-multiple-comments) in subsequent
48+
`cml comment update` calls); `"{workflow}"` and `"{run}"` are auto-replaced.
49+
50+
## Examples
51+
52+
### Managing multiple comments
53+
54+
Repeatedly running `cml comment create` may produce too many comments. Meanwhile
55+
`cml comment update` will only produce/update one comment. What if you'd like to
56+
have exactly two comments (corresponding to two different markdown reports,
57+
possibly from different parallel workflows) visible at a time?
58+
59+
To mark and subsequently update a particular comment, use
60+
`--watermark-title="some text"`. To mark a comment according to the workflow or
61+
run ID, include the placeholder text `"{workflow}"` and `"{run}"`. For example:
62+
63+
```cli
64+
# Create and constantly update 2 separate comments
65+
$ cml comment update --watch --watermark-title='first {workflow} report' report.md &
66+
$ cml comment update --watch --watermark-title='second {workflow} report' debug.md &
67+
$ python train.py --report-file=report.md --debug-file=debug.md
68+
69+
# Same, but create a new pair of comments if rerunning a workflow
70+
$ cml comment update --watch --watermark-title='first {run} report' report.md &
71+
$ cml comment update --watch --watermark-title='second {run} report' debug.md &
72+
$ python train.py --report-file=report.md --debug-file=debug.md
73+
```
5274

5375
## FAQs and Known Issues
5476

content/docs/ref/pr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cml pr create [options] <pathspec>...
66

77
Commit specified files to a new branch and create a pull request. If sending a
88
report afterwards, consider using
9-
[`cml comment update --pr`](/doc/ref/comment#update).
9+
[`cml comment update`](/doc/ref/comment#update).
1010

1111
<admon type="info">
1212

0 commit comments

Comments
 (0)