# @dvcorg/cml 中文文档

规范地址：https://npmcn.com/package/%40dvcorg/cml/

版本：0\.20\.6
npm 元数据更新时间：2024-10-24T14:06:01.065Z
中文译文更新时间：2026-11-13T01:11:24.412Z
软件包许可：Apache-2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40dvcorg/cml
原文对照：https://npmcn.com/package/%40dvcorg/cml/?lang=original
项目主页：https://github.com/iterative/cml#readme
源码仓库：https://github.com/iterative/cml

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：295 kB，82 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- Node.js 要求：\>=16\.0\.0
- 运行依赖：38 个
- 首次发布：2020-05-11T12:27:42.628Z
- 最新版本发布：2024-10-24T14:06:00.774Z
- 近 30 天下载量：2933（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：159（近 12 个月 0 个）

## 中文简介

![](https://static.iterative.ai/img/cml/title_strip_trim.png)

## 安装

```sh
npm install @dvcorg/cml
```

也可以使用：`pnpm add @dvcorg/cml`、`yarn add @dvcorg/cml`、`bun add @dvcorg/cml`

## README

![](https://static.iterative.ai/img/cml/title_strip_trim.png)

[![GHA](https://img.shields.io/github/v/tag/iterative/setup-cml?label=GitHub%20Actions&logo=GitHub)](https://github.com/iterative/setup-cml) [![npm](https://img.shields.io/npm/v/@dvcorg/cml?logo=npm)](https://www.npmjs.com/package/@dvcorg/cml)

**什么是CML? - 是什么? - 是什么? - What is CML?** 连续机器学习(CML)是一个开源 CLI 工具 执行连续一体化和交付(CI/CD),重点是 (原始内容存档于2018-09-29). MLOPS. 用于自动化开发工作流程——包括机器 提供、示范培训和评价,比较跨行业的ML实验 项目历史,以及监测不断变化的数据集.

CML 可以帮助训练和评价模型——然后生成一个可视化报告,其中 结果和衡量标准——在每次拉出请求时自动.

![](https://static.iterative.ai/img/cml/github_cloud_case_lessshadow.png) _一个 示例报告 [神经风格传输模式](https://github.com/iterative/cml_cloud_case)。 。 。 ._

CML 原则 :

-   **[吉特风](https://nvie.com/posts/a-successful-git-branching-model) 数据 科学.** 使用 GitLab 或 GitHub 来管理 ML 实验, 跟踪培训 ML 的操作者 模型或修改后的数据和时间。 将数据和模型编码为 [家庭暴力中心](https://npmcn.com/package/%40dvcorg/cml/#readme-using-cml-with-dvc) 而不是推动一个Git Repo.
-   **用于ML实验的自动报告.** 带有计量标准的自动生成报告 每个 Git 拖放请求中的地块 。 严格的工程实践帮助你的团队 作出知情、由数据驱动的决定.
-   **没有额外服务.** 使用 GitLab 建立自己的 ML 平台, Bitbucket,或叫"GitHub". 可选使用 [云存储](https://npmcn.com/package/%40dvcorg/cml/#readme-configuring-cloud-storage-providers) 以及两个 自行托管或云跑道(如AWS EC2或Azure). 没有数据库, 需要服务或复杂的设置.

问:需要帮助吗? 只想谈谈ML的连续整合? [访问我们的Discord频道!](https://discord.gg/bzA6uY7)

: play or 暂停 按钮:检查我们的 [YouTube视频系列](https://www.youtube.com/playlist?list=PL7WG7YrwYcnDBDuCkFbcyjnZQrdskFsBz) 使用 CML 操作的 MLOPs 教程 !

## 目录

1.  [设置( GitLab, GitHub, Bitbucket) Name](https://npmcn.com/package/%40dvcorg/cml/#readme-setup)
2.  [使用量](https://npmcn.com/package/%40dvcorg/cml/#readme-usage)
3.  [正在启动( 教程)](https://npmcn.com/package/%40dvcorg/cml/#readme-getting-started)
4.  [使用 DVC 的 CML](https://npmcn.com/package/%40dvcorg/cml/#readme-using-cml-with-dvc)
5.  [高级设置( 自动托管, 本地软件包)](https://npmcn.com/package/%40dvcorg/cml/#readme-advanced-setup)
6.  [实例项目](https://npmcn.com/package/%40dvcorg/cml/#readme-see-also)

## 设置

你需要一个GitLab,GitHub,或者Bitbucket账户开始. 用户可能希望 熟悉情况 [Github 动作](https://help.github.com/en/actions) 或者说 [GitLab CI/光盘](https://about.gitlab.com/stages-devops-lifecycle/continuous-integration)。 。 。 . 在这里,将讨论GitHub的使用案例.

### 吉特拉布语Name

请看文件 [带 GitLab CI/CD 的 CML](https://github.com/iterative/cml/wiki/CML-with-GitLab) 特别是 [个人访问令牌](https://github.com/iterative/cml/wiki/CML-with-GitLab#variables) 页:1.

### 键盘

请看文件 [带 Bitbucket 云的 CML](https://cml.dev/doc/usage?tab=Bitbucket)。 。 。 .

### GitHub 图像

任何 CML 项目中的密钥文件是 `.github/workflows/cml.yaml`数字 :

```yaml
name: your-workflow-name
on: [push]
jobs:
  run:
    runs-on: ubuntu-latest
    # optionally use a convenient Ubuntu LTS + DVC + CML image
    # container: ghcr.io/iterative/cml:0-dvc2-base1
    steps:
      - uses: actions/checkout@v3
      # may need to setup NodeJS & Python3 on e.g. self-hosted
      # - uses: actions/setup-node@v3
      #   with:
      #     node-version: '16'
      # - uses: actions/setup-python@v4
      #   with:
      #     python-version: '3.x'
      - uses: iterative/setup-cml@v1
      - name: Train model
        run: |
          # Your ML workflow goes here
          pip install -r requirements.txt
          python train.py
      - name: Write CML report
        env:
          REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          # Post reports as comments in GitHub PRs
          cat results.txt >> report.md
          cml comment create report.md
```

## 使用量

我们帮助提供了 CML 和其他有用的图书馆 预先安装在我们的 [自定义嵌入图像](https://github.com/iterative/cml/blob/mains/Dockerfile)。 。 。 . 在上述例子中,没有评论的领域 `container: ghcr.io/iterative/cml:0-dvc2-base1`会让跑者拉出 CML Docker 图像 。 该图像已经设置了节点JS、 Python 3、 DVC 和 CML 方便使用 Ubuntu LTS 基础.

### CML 函数

CML 提供一些功能来帮助包装 ML 工作流程的产出 (包括数字数据和关于模型性能的可视化) 报告.

以下是用于撰写下调报告和交付的 CML 函数表 报告给你的CI系统.

| 函数 | 说明 | 示例输入 |
| --- | --- | --- |
| `cml runner launch` | 在当地或由云提供商主持发射跑道 | 见 [参数](https://github.com/iterative/cml#arguments) |
| `cml comment create` | 返回 CML 报告作为您 GitLab/ GitHub 工作流程中的评论 | `<path to report> --head-sha <sha>` |
| `cml check create` | 返回 CML 报表作为 GitHub 的检查 | `<path to report> --head-sha <sha>` |
| `cml pr create` | 将给定的文件提交到新分支并创建拉动请求 | `<path>...` |
| `cml tensorboard connect` | 返回链接到 Tensorboard 。 dev 页 | `--logdir <path to logs> --title <experiment title> --md` |

#### CML 报告

这个 `cml comment create` 命令可用于发布报告。 CML 报告为 以下标写( i)[GitHub 图像](https://github.github.com/gfm), (中文(简体) ), [吉特拉布语Name](https://docs.gitlab.com/ee/user/markdown.html),或 [键盘](https://confluence.atlassian.com/bitbucketserver/markdown-syntax-guide-776639995.html) 风味。 这意味着它们可以包含图像,表格,格式化的文本,HTML 块, 代码片段, 以及更多—— 实际上, 您在 CML 报告中给出的内容是 你吗? 一些例子:

: sspiral 注解: **文本** 用你喜欢的方法写报告. 例如,复制包含 ML 模型结果的文本文件的内容 培训:

```bash
cat results.txt >> report.md
```

: 框架 图片 : **图像** 使用下标或 HTML 显示图像。 请注意: 如果图像是您 ML 工作流程的输出( 即由您生成) 工作流程,可以上传并自动包含到您的CML报告. 对于 示例,如果 `graph.png` 输出为 `python train.py`,运行 :

```bash
echo "![](./graph.png)" >> report.md
cml comment create report.md
```

### 开始

1.  我们的叉子 [实例项目存储器](https://github.com/iterative-test/cml-example-base)。 。 。 .

> :警告:注意,如果你使用GitLab, [您需要创建个人访问托肯](https://github.com/iterative/cml/wiki/CML-with-GitLab#variables) 这个例子可以发挥作用.

![](https://static.iterative.ai/img/cml/fork_project.png)

> : warning: GitHub 浏览器界面中可以全部完成以下步骤. 但是,为了配合命令 我们建议克隆你的叉子 您的本地工作站:

```bash
git clone https://github.com/<your-username>/example_cml
```

2.  要创建 CML 工作流程, 请将以下内容复制到新文件 , `.github/workflows/cml.yaml`数字 :

```yaml
name: model-training
on: [push]
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
      - uses: iterative/setup-cml@v1
      - name: Train model
        env:
          REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          pip install -r requirements.txt
          python train.py

          cat metrics.txt >> report.md
          echo "![](./plot.png)" >> report.md
          cml comment create report.md
```

3.  在您选择的文本编辑器中,编辑 `train.py` 改为 `depth = 5`。 。 。 .
    
4.  提交并推进更改 :
    

```bash
git checkout -b experiment
git add . && git commit -m "modify forest depth"
git push origin experiment
```

5.  在 GitHub 中,打开拉动请求以比较 `experiment` 分支改为 `main`。 。 。 .

![](https://static.iterative.ai/img/cml/make_pr.png)

很快,你应该看到一个评论 从 `github-actions` 显示在拉出 请使用您的 CML 报告。 这是由于 `cml send-comment` 函数在工作流程中.

![](https://static.iterative.ai/img/cml/first_report.png)

这是CML工作流程的大纲:

-   您将更改推向您的 GitHub 仓库,
-   您的工作流程中 `.github/workflows/cml.yaml` 文件会运行,以及
-   生成报告并张贴到 GitHub.

CML 函数允许您显示工作流程的相关结果, 如模型 性能测量和可视化——用GitHub的检查和评论. 什麽 您想要运行的工作流程, 并想要在您的 CML 报告中显示, 最多 你吗.

### 使用 DVC 的 CML

在许多ML项目中,数据不是存储在Git寄存器中,而是需要存储 从外部来源下载. [家庭暴力中心](https://dvc.org/) 是一种常见的方法 将数据带入您的 CML 运行程序 。 DVC 也允许您直观地看到测量值的不同 承诺做这样的报告:

![](https://static.iterative.ai/img/cml/dvc_long_report.png)

这个 `.github/workflows/cml.yaml` 用于创建此报表的文件是 :

```yaml
name: model-training
on: [push]
jobs:
  run:
    runs-on: ubuntu-latest
    container: ghcr.io/iterative/cml:0-dvc2-base1
    steps:
      - uses: actions/checkout@v3
      - name: Train model
        env:
          REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        run: |
          # Install requirements
          pip install -r requirements.txt

          # Pull data & run-cache from S3 and reproduce pipeline
          dvc pull data --run-cache
          dvc repro

          # Report metrics
          echo "## Metrics" >> report.md
          git fetch --prune
          dvc metrics diff main --show-md >> report.md

          # Publish confusion matrix diff
          echo "## Plots" >> report.md
          echo "### Class confusions" >> report.md
          dvc plots diff --target classes.csv --template confusion -x actual -y predicted --show-vega main > vega.json
          vl2png vega.json -s 1.5 > confusion_plot.png
          echo "![](./confusion_plot.png)" >> report.md

          # Publish regularization function diff
          echo "### Effects of regularization" >> report.md
          dvc plots diff --target estimators.csv -x Regularization --show-vega main > vega.json
          vl2png vega.json -s 1.5 > plot.png
          echo "![](./plot.png)" >> report.md

          cml comment create report.md
```

> :警告:如果使用有云存储的DVC,请注意环境 变量.

#### 配置云存储提供者

还有很多 [支持的存储提供者](https://dvc.org/doc/command-reference/remote/modify#available-parameters-per-storage-type)。 。 。 . 以下是一些最常用供应商的几个例子:

S3和S3兼容存储器(Minio, DigitalOcean Spaces, IBM Cloud Object 存储器.)

```yaml
# Github
env:
  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }}
```

> : 点 右: `AWS_SESSION_TOKEN` 是可选的.

> : 点 右: `AWS_ACCESS_KEY_ID` 财务报告和审定财务报表 `AWS_SECRET_ACCESS_KEY` 也可以使用 以 `cml runner` 以启动EC2实例。 见\[环境变 .

阿苏雷

```yaml
env:
  AZURE_STORAGE_CONNECTION_STRING:
    ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
  AZURE_STORAGE_CONTAINER_NAME: ${{ secrets.AZURE_STORAGE_CONTAINER_NAME }}
```
阿里云

```yaml
env:
  OSS_BUCKET: ${{ secrets.OSS_BUCKET }}
  OSS_ACCESS_KEY_ID: ${{ secrets.OSS_ACCESS_KEY_ID }}
  OSS_ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
  OSS_ENDPOINT: ${{ secrets.OSS_ENDPOINT }}
```
谷歌存储

> :警告:通常情况下, `GOOGLE_APPLICATION_CREDENTIALS` 这是 **路径** 会 议 日 程 和 议 程 `json` 包含证书的文件。 然而在行动中 这个秘密 变量是 **目录** 文档。 复制 `json` 内容并添加 作为秘密.

```yaml
env:
  GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
```
谷歌驱动器

> :警告:在配置后 [谷歌驱动证书](https://dvc.org/doc/command-reference/remote/add) 你会找到一个 `json` 文件位于 `your_project_path/.dvc/tmp/gdrive-user-credentials.json`复制其内容 并加为密可变.

```yaml
env:
  GDRIVE_CREDENTIALS_DATA: ${{ secrets.GDRIVE_CREDENTIALS_DATA }}
```

## 高级设置

### 自行主持(现场或云)

GitHub Actions默认运行在由GitHub托管的跑者上. 然而,还有 利用GPU, 或者在云中训练.

> : 点起: **小费!** 看看这个 [官方 GitHub 文档](https://help.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) 开始安排自己的跑道.

#### 用 CML 分配云计算资源

当工作流程需要计算资源(例如GPU)时,CML可以 使用 `cml runner`你可以旋转起来 aWS、Azure、GCP或Kubernetes上的例子.

例如,以下工作流程部署a `g4dn.xlarge` 实例在 AWS EC2 并训练一个样板 工作完成后,这个案例 自动关闭.

你可能注意到,这个工作流程与 [基本使用大小写](https://npmcn.com/package/%40dvcorg/cml/#readme-usage) 见上文。 唯一的补充是 `cml runner` 还有几个 将您的云服务证书传递到 工作流程.

请注意: `cml runner` 将自动重新启动您的工作( 无论来自 [GitHub 动作35天工作流程超时](https://docs.github.com/en/actions/reference/usage-limits-billing-and-administration#usage-limits) 或一个 [AWS EC2 点实例中断](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html)) (中文(简体) ).

```yaml
name: Train-in-the-cloud
on: [push]
jobs:
  deploy-runner:
    runs-on: ubuntu-latest
    steps:
      - uses: iterative/setup-cml@v1
      - uses: actions/checkout@v3
      - name: Deploy runner on EC2
        env:
          REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        run: |
          cml runner launch \
            --cloud=aws \
            --cloud-region=us-west \
            --cloud-type=g4dn.xlarge \
            --labels=cml-gpu
  train-model:
    needs: deploy-runner
    runs-on: [self-hosted, cml-gpu]
    timeout-minutes: 50400 # 35 days
    container:
      image: ghcr.io/iterative/cml:0-dvc2-base1-gpu
      options: --gpus all
    steps:
      - uses: actions/checkout@v3
      - name: Train model
        env:
          REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
        run: |
          pip install -r requirements.txt
          python train.py

          cat metrics.txt > report.md
          cml comment create report.md
```

在上述工作流程中 `deploy-runner` 级发射 EC2 `g4dn.xlarge` 实例 `us-west` 区域。 这个 `model-training` 步骤然后运行在 新启动的案例。 \[环境变量\] `secrets` 所需经费.

> : 塔达: **注意,工作可以使用任何多克容器!** 使用这样的函数 作为 `cml send-comment` 从工作,唯一的要求是 [已安装 CML](https://npmcn.com/package/%40dvcorg/cml/#readme-local-package)。 。 。 .

#### Docker 图像

CML Docker 图像 (`ghcr.io/iterative/cml` 或者说 `iterativeai/cml`已装入 与皮森,库达, `git`, (中文(简体) ), `node` 以及完整数据的其他基本内容 科学。 不同版本的这些基本内容可从不同来源获得 图像标记。 标签公约是 `{CML_VER}-dvc{DVC_VER}-base{BASE_VER}{-gpu}`数字 :

| `{BASE_VER}` | 软件包括:`-gpu`(中文(简体) ) |
| --- | --- |
| 0 个 | Ubuntu 18.04, Python 2.7 (CUDA 10.1, CuDNN 7) (中文(简体) ) |
| 1个 | Ubuntu 20.04, Python 3.8 (CUDA 11.2, CuDNN 8) (中文(简体) ) |

譬如说, `iterativeai/cml:0-dvc2-base1-gpu`,或 `ghcr.io/iterative/cml:0-dvc2-base1`。 。 。 .

#### 参数

这个 `cml runner launch` 函数接受以下参数:

```
  --labels                                  One or more user-defined labels for
                                            this runner (delimited with commas)
                                                       [string] [default: "cml"]
  --idle-timeout                            Time to wait for jobs before
                                            shutting down (e.g. "5min"). Use
                                            "never" to disable
                                                 [string] [default: "5 minutes"]
  --name                                    Name displayed in the repository
                                            once registered
                                                    [string] [default: cml-{ID}]
  --no-retry                                Do not restart workflow terminated
                                            due to instance disposal or GitHub
                                            Actions timeout            [boolean]
  --single                                  Exit after running a single job
                                                                       [boolean]
  --reuse                                   Don't launch a new runner if an
                                            existing one has the same name or
                                            overlapping labels         [boolean]
  --reuse-idle                              Creates a new runner only if the
                                            matching labels don't exist or are
                                            already busy               [boolean]
  --docker-volumes                          Docker volumes, only supported in
                                            GitLab         [array] [default: []]
  --cloud                                   Cloud to deploy the runner
                         [string] [choices: "aws", "azure", "gcp", "kubernetes"]
  --cloud-region                            Region where the instance is
                                            deployed. Choices: [us-east,
                                            us-west, eu-west, eu-north]. Also
                                            accepts native cloud regions
                                                   [string] [default: "us-west"]
  --cloud-type                              Instance type. Choices: [m, l, xl].
                                            Also supports native types like i.e.
                                            t2.micro                    [string]
  --cloud-permission-set                    Specifies the instance profile in
                                            AWS or instance service account in
                                            GCP           [string] [default: ""]
  --cloud-metadata                          Key Value pairs to associate
                                            cml-runner instance on the provider
                                            i.e. tags/labels "key=value"
                                                           [array] [default: []]
  --cloud-gpu                               GPU type. Choices: k80, v100, or
                                            native types e.g. nvidia-tesla-t4
                                                                        [string]
  --cloud-hdd-size                          HDD size in GB              [number]
  --cloud-ssh-private                       Custom private RSA SSH key. If not
                                            provided an automatically generated
                                            throwaway key will be used  [string]
  --cloud-spot                              Request a spot instance    [boolean]
  --cloud-spot-price                        Maximum spot instance bidding price
                                            in USD. Defaults to the current spot
                                            bidding price [number] [default: -1]
  --cloud-startup-script                    Run the provided Base64-encoded
                                            Linux shell script during the
                                            instance initialization     [string]
  --cloud-aws-security-group                Specifies the security group in AWS
                                                          [string] [default: ""]
  --cloud-aws-subnet,                       Specifies the subnet to use within
  --cloud-aws-subnet-id                     AWS           [string] [default: ""]

```

#### 环境变量

> :警告:您需要 [创建个人访问符 (PAT)](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) 包含寄存器读取/写入访问权限和工作流程权限。 实例 工作流程,此令牌被存储为 `PERSONAL_ACCESS_TOKEN`。 。 。 .

: 信息 来源:如果使用 `--cloud` 选项,您还需要 提供您云计算资源的秘密访问证书。 在那个 例如, `AWS_ACCESS_KEY_ID` 财务报告和审定财务报表 `AWS_SECRET_ACCESS_KEY` (有特权) 以创建并销毁 EC2 实例.

对AWS来说,同样的证书也可以用于: [配置云存储](https://npmcn.com/package/%40dvcorg/cml/#readme-configuring-cloud-storage-providers)。 。 。 .

#### 代理支持

通过已知环境变量的 CML 支持代理 `http_proxy` 财务报告和审定财务报表 `https_proxy`。 。 。 .

#### 现场( 当地) 运行者

这意味着使用室内机器作为自备跑手。 这个 `cml runner launch` 函数用于设置本地自动托管的跑车。 在一个 本地机器或原地GPU集群, [将 CML 作为软件包安装](https://npmcn.com/package/%40dvcorg/cml/#readme-local-package) 然后运行 :

```bash
cml runner launch \
  --repo=$your_project_repository_url \
  --token=$PERSONAL_ACCESS_TOKEN \
  --labels="local,runner" \
  --idle-timeout=180
```

机器会从您的项目仓库中收听工作流程 .

### 本地软件包

在以上示例中,CML由 `setup-cml` 动作,或来 预安装在自定义 Docker 图像中 。 你也可以这样 作为软件包安装 CML :

```bash
npm install --location=global @dvcorg/cml
```

你用得着 `cml` 不通过下载正确的独立二进制的节点 您的系统从资产部分 [释放](https://github.com/iterative/cml/releases)。 。 。 .

您可能需要安装额外的依赖关系来使用 DVC 地块和 Vega- Lite CLI 命令 :

```bash
sudo apt-get install -y libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev \
                        librsvg2-dev libfontconfig-dev
npm install -g vega-cli vega-lite
```

CML 和 Vega- Lite 软件包安装需要节点JS 软件包管理器 (单位:千美元)`npm`)与NodeJS同船. 安装指令如下.

#### 安装节点JS

-   **GitHub 图像**: 当使用 GitHub 默认值时, 可能没有必要 容器或CML的一个多克容器。 自营的跑者可能需要 使用设置动作安装节点JS:

```bash
uses: actions/setup-node@v3
  with:
    node-version: '16'
```

-   **吉特拉布语Name**:需要直接安装.

```bash
curl -sL https://deb.nodesource.com/setup_16.x | bash
apt-get update
apt-get install -y nodejs
```

## 另见

这些是使用CML的一些实例项目.

-   [基本CML项目](https://github.com/iterative-test/cml-example-minimal)
-   [用 DVC 调取数据的 CML](https://github.com/iterative-test/cml-example-dvc)
-   [带有 Tensor 板的 CML](https://github.com/iterative-test/cml-example-tensorboard)
-   [带小EC2实例的CML](https://github.com/iterative-test/cml-example-cloud) 键 :
-   [带 EC2 GPU 的 CML](https://github.com/iterative-test/cml-example-cloud-gpu) 键 :

键:需要 [PAT 计划](https://npmcn.com/package/%40dvcorg/cml/#readme-environment-variables)。 。 。 .

# : 警告: 维护: 警告:

-   ~2023-07 Nvidia 已投放容器 CUDA 图像,带有 [10.x 电话](https://hub.docker.com/r/nvidia/cuda/tags?page=1&name=10)编号 :[cudnn7 (中文(简体) )](https://hub.docker.com/r/nvidia/cuda/tags?page=1&name=cudnn7) 财务报告和审定财务报表 [11.2.1 国家](https://hub.docker.com/r/nvidia/cuda/tags?page=1&name=11.2.1), (中文(简体) ), CML 图像将加速更新

## 常见问题

### 如何安装 @dvcorg/cml？

在项目目录运行 npm install @dvcorg/cml，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 cml、cml-send-github-check、cml-send-comment、cml-publish、cml-tensorboard-dev、cml-runner、cml-pr，可以用 npx cml 直接运行。

### @dvcorg/cml 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/dvcorg\_\_cml 是否存在。

### @dvcorg/cml 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @dvcorg/cml 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=16\.0\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @dvcorg/cml 可以商用吗？

@dvcorg/cml 使用 Apache-2\.0 许可。宽松许可：允许商业使用、修改和再分发，并附带明确的专利授权；分发时需保留许可与 NOTICE 文件，修改过的文件要注明改动。以上为概括，不构成法律意见，请以许可原文为准。

### @dvcorg/cml 的下载量有多少？

根据 npm 官方下载统计，@dvcorg/cml 在 2026/10/13 – 2026/11/11 这 30 天内被下载 2,933 次，日均约 98 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @dvcorg/cml 还在维护吗？

最新版本 0\.20\.6 发布于 2024/10/24（2 年前）；至今共发布 159 个版本，其中过去 12 个月发布了 0 个；首次发布于 2020/05/11。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

