This repository was archived by the owner on Apr 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Usage -> User Guide (initial) #382
Closed
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ae23976
guides: rename Usage->Config and
jorgeorpinel 4b08551
redirect /usage -> /config
jorgeorpinel f70bf8e
Merge branch 'master' into config--ref and
jorgeorpinel d7dbc4e
guide: fix image links again (in captions)
jorgeorpinel 42cd4ff
guide: put example repos back in main tabs (Config)
jorgeorpinel 82b74d5
ref: bring comment-create details & examples
jorgeorpinel 7c886ac
Update content/docs/ref/index.md
jorgeorpinel ff6bef4
guide: group lose guides into new section and
jorgeorpinel 9662dd8
Merge branch 'config--ref' of github.com:iterative/cml.dev into confi…
jorgeorpinel 9a0e162
Update content/docs/ref/index.md
jorgeorpinel 4c222e9
Merge branch 'master' into config--ref
jorgeorpinel 4b33274
Merge branch 'config--ref' of github.com:iterative/cml.dev into confi…
jorgeorpinel 608f010
Merge branch 'master' into config--ref
jorgeorpinel 3fc4554
ref: roll back cleanup to comment cmd
jorgeorpinel 9a2d12b
guide: fix link
jorgeorpinel f862dfe
Merge branch 'master' into config--ref and
jorgeorpinel 986736e
Merge branch 'master' into config--ref
jorgeorpinel 2a4e24e
roll back unknown changes
jorgeorpinel 84db09c
Roll back unrelated change
jorgeorpinel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -24,14 +24,19 @@ | |
} | ||
] | ||
}, | ||
"usage", | ||
{ | ||
"label": "CML with DVC", | ||
"slug": "cml-with-dvc" | ||
}, | ||
{ | ||
"label": "Self-hosted Runners", | ||
"slug": "self-hosted-runners" | ||
"slug": "user-guide", | ||
"source": "user-guide/index.md", | ||
"children": [ | ||
{ | ||
"label": "CML with DVC", | ||
"slug": "cml-with-dvc" | ||
}, | ||
{ | ||
"label": "Self-hosted Runners", | ||
"slug": "self-hosted-runners" | ||
Comment on lines
+32
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved these 2 existing docs into the (new) UG section |
||
} | ||
] | ||
}, | ||
{ | ||
"label": "Command Reference", | ||
|
File renamed without changes.
This file contains hidden or 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Using CML | ||
# User Guide: Introduction | ||
|
||
A GitLab, GitHub, or Bitbucket account is required. Familiarity with | ||
Comment on lines
-1
to
3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Repurposed (simplified) much of this doc as the new UG index page |
||
[GitHub Actions](https://help.github.com/en/actions), | ||
|
@@ -9,7 +9,9 @@ also be beneficial. | |
<toggle> | ||
<tab title="GitHub"> | ||
|
||
The key file in any CML project is `.github/workflows/cml.yaml`: | ||
Integrate CML to your | ||
[workflow configuration](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions) | ||
using a `.github/workflows/cml.yaml` file, for example: | ||
|
||
```yaml | ||
name: CML | ||
|
@@ -44,8 +46,10 @@ jobs: | |
cml comment create report.md | ||
``` | ||
|
||
The example above generates visual reports in pull requests: | ||
[](https://github.com/iterative/cml_base_case/pull/2) | ||
This generates visual reports in pull requests (see `cml comment create`): | ||
|
||
 _From sample | ||
[increase forest depth](https://github.com/iterative/cml_base_case/pull/2) PR_ | ||
|
||
We helpfully provide CML and other useful libraries pre-installed on our | ||
[custom Docker images](/doc/self-hosted-runners#docker-images). In the above | ||
|
@@ -65,7 +69,9 @@ and CML set up on an Ubuntu LTS base for convenience. | |
</tab> | ||
<tab title="GitLab"> | ||
|
||
The key file in any CML project is `.gitlab-ci.yml`: | ||
Integrate CML to your | ||
[pipeline configuration](https://docs.gitlab.com/ee/ci/pipelines/#configure-a-pipeline) | ||
using the `.gitlab-ci.yml` file, for example: | ||
|
||
```yaml | ||
train-model: | ||
|
@@ -84,12 +90,19 @@ create-CML-report: | |
- cml comment create report.md | ||
``` | ||
|
||
⚠️ You _must_ provide a | ||
<admon type="warn"> | ||
|
||
You _must_ provide a | ||
[personal or project access token (PAT)](/doc/self-hosted-runners#personal-access-token) | ||
via a `REPO_TOKEN` variable. | ||
|
||
The example above generates visual reports in merge requests: | ||
[](https://gitlab.com/iterative.ai/cml-base-case/-/merge_requests/1) | ||
</admon> | ||
|
||
This generates visual reports in pull requests (see `cml comment create`): | ||
|
||
 _From sample | ||
[Experiment](https://gitlab.com/iterative.ai/cml-base-case/-/merge_requests/1) | ||
MR_ | ||
|
||
We helpfully provide CML and other useful libraries pre-installed on our | ||
[custom Docker images](/doc/self-hosted-runners#docker-images). In the above | ||
|
@@ -108,7 +121,9 @@ set up on an Ubuntu LTS base for convenience. | |
</tab> | ||
<tab title="Bitbucket"> | ||
|
||
The key file in any CML project is `bitbucket-pipelines.yml`: | ||
Integrate CML to your | ||
[pipeline configuration](https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/) | ||
using the `bitbucket-pipelines.yml` file, for example: | ||
|
||
```yaml | ||
image: iterativeai/cml:0-dvc2-base1 | ||
|
@@ -128,19 +143,31 @@ pipelines: | |
- cml comment create report.md | ||
``` | ||
|
||
⚠️ You _must_ provide | ||
<admon type="warn"> | ||
|
||
You _must_ provide | ||
[access credentials](/doc/self-hosted-runners#personal-access-token) via a | ||
`REPO_TOKEN` variable. | ||
|
||
The example above generates visual reports in pull requests: | ||
[](https://bitbucket.org/iterative-ai/cml-base-case/pull-requests/1) | ||
</admon> | ||
|
||
This generates visual reports in pull requests (see `cml comment create`): | ||
|
||
 _From | ||
sample | ||
[Experiment](https://bitbucket.org/iterative-ai/cml-base-case/pull-requests/1) | ||
PR_ | ||
|
||
⚠️ CML works with Bitbucket Cloud, where you can use the | ||
<admon type="warn"> | ||
|
||
CML works with Bitbucket Cloud, where you can use the | ||
[Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) CI/CD | ||
system to run workflows automatically on triggering events. Bitbucket Server is | ||
not yet supported. | ||
|
||
### Example projects | ||
</admon> | ||
|
||
### Example project | ||
|
||
- [Basic CML project](https://bitbucket.org/iterative-ai/cml-base-case) | ||
- [CML with DVC to pull data](https://bitbucket.org/iterative-ai/cml-dvc-case) | ||
|
@@ -149,59 +176,3 @@ not yet supported. | |
|
||
</tab> | ||
</toggle> | ||
|
||
## CML Commands | ||
|
||
CML provides a number of commands to help package the outputs of ML workflows | ||
(including numeric data and visualizations about model performance) into a CML | ||
report. | ||
|
||
Below is a list of CML commands for starting cloud compute runners, writing and | ||
publishing Markdown reports to your CI/CD system. | ||
|
||
∞ **[`runner`](/doc/ref/runner)**\ | ||
Launch a runner hosted by a cloud compute provider or locally on-premise (see [self-hosted runners](/doc/self-hosted-runners))\ | ||
e.g. `cml runner launch --cloud={aws,azure,gcp,kubernetes} ...` | ||
|
||
∞ **[`pr`](/doc/ref/pr)**\ | ||
Commit specified files to a new branch and create a pull request\ | ||
e.g. `cml pr create "**/*.json" "**/*.py" --md >> report.md` | ||
|
||
∞ **[`comment`](/doc/ref/comment)**\ | ||
Post a Markdown report as a commit comment\ | ||
e.g. `cml comment create report.md` | ||
|
||
∞ **[`check`](/doc/ref/check)**\ | ||
Post a Markdown report as a GitHub check\ | ||
e.g. `cml check create report.md` | ||
|
||
∞ **[`tensorboard`](/doc/ref/tensorboard)**\ | ||
Return a link to a <https://tensorboard.dev> page\ | ||
e.g. `cml tensorboard connect --logdir=./logs --md >> report.md` | ||
|
||
### CML Reports | ||
|
||
The `cml comment create` command can be used to post reports. CML reports are | ||
written in Markdown ([GitHub](https://github.github.com/gfm), | ||
[GitLab](https://docs.gitlab.com/ee/user/markdown.html), or | ||
[Bitbucket](https://confluence.atlassian.com/bitbucketserver/markdown-syntax-guide-776639995.html) | ||
flavors). That means they can contain images, tables, formatted text, HTML | ||
blocks, code snippets and more — really, what you put in a CML report is up to | ||
you. Some examples: | ||
|
||
📝 **Text** Write to your report using whatever method you prefer. For example, | ||
copy the contents of a text file containing the results of ML model training: | ||
|
||
```cli | ||
$ cat results.txt >> report.md | ||
``` | ||
|
||
🖼️ **Images** Display images using the markdown or HTML. Note that if an image | ||
is an output of your ML workflow (i.e. it is produced by your workflow), you can | ||
use markdown to embed it in a CML report. For example, if `plot.png` is output | ||
by `python train.py`, run: | ||
|
||
```cli | ||
$ echo '' >> report.md | ||
$ cml comment create report.md | ||
``` |
File renamed without changes.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved here from https://cml.dev/doc/usage#cml-commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@casperdcl don't we need some content in the cmd ref index though? Currently it's empty except for a Generic Options section. Seems a little bare. Imagine a user lands in this page as their entry point to the docs site (per analytics this does happen sometimes) or as one of the first pages visited. It should give some general info on
cml
commands as a whole, link to GS or Usage, etc., I think.Granted, this could be addressed separately and/or we can repeat the text above in you prefer to also keep this general guidance in the Usage (now UG index) page. Lmk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert