Skip to content

pmrowla/setup-cml

 
 

Repository files navigation

Setup CML Action

CML

Continuous Machine Learning (CML) is an open-source library for implementing continuous integration & delivery (CI/CD) in machine learning projects. Use it to automate parts of your development workflow, including machine provisioning; model training and evaluation; comparing ML experiments across your project history, and monitoring changing datasets.

The iterative/setup-cml can be used as a GitHub Action to provide CML functions in your workflow. The action allows users to install CML without using the CML Docker container.

This action gives you:

  • Access to all CML functions. For example:
    • cml comment create for publishing data visualization and metrics from your CI workflow as comments in a pull request.
    • cml pr create to open a pull request.
    • cml runner launch, a function that enables workflows to provision cloud and on-premise computing resources for training models.
  • The freedom 🦅 to mix and match CML with your favorite data science tools and environments.

Note that CML does not include DVC and its dependencies (see the Setup DVC Action).

Usage

This action is tested on ubuntu-latest, macos-latest and windows-latest.

Basic usage:

steps:
  - uses: actions/checkout@v3
  - uses: iterative/setup-cml@v1

A specific version can be pinned to your workflow.

steps:
  - uses: actions/checkout@v3
  - uses: iterative/setup-cml@v1
    with:
      version: '0.18.1'

Self-hosted example:

runs-on: [self-hosted]
steps:
  - uses: actions/setup-node@v3
    with:
      node-version: '16'
  - uses: actions/checkout@v3
  - uses: iterative/setup-cml@v1
    with:
      sudo: false

Inputs

The following inputs are supported.

  • version - (optional) The version of CML to install (e.g. '0.18.1'). Defaults to latest for the most recent CML release.
  • sudo - (optional) Enables the use of sudo whilst installing CML. Defaults to true
  • force - (optional) Forces the install. Useful in scenarios where CML is already installed and in use. Defaults to false

A complete example

A sample CML report from a machine learning project displayed in a Pull Request.

Assume that we have a machine learning script, train.py which outputs an image plot.png:

steps:
  - uses: actions/checkout@v2
  - uses: iterative/setup-cml@v1
  - env:
      REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Can use the default token for most functions
    run: |
      python train.py --output plot.png

      echo 'My first CML report' > report.md
      echo '![](./plot.png)' >> report.md
      cml comment create --publish report.md

In general GitHub's runner token can be given enough permissions to perform most functions. When using the cml runner launch command a PAT is required

CML functions

CML provides several helper functions. See the docs.

About

GitHub Action for CML setup

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%