Updated on 2024-06-12 GMT+08:00

ModelArts CLI Overview

Description

ModelArts CLI, also called ma-cli, is a cross-platform command line tool used to connect to ModelArts and run management commands on ModelArts resources. You can use the interactive command prompt or script to run commands on a terminal. ma-cli allows you to interact with cloud services through ModelArts notebook and on-premises VMs. You can run ma-cli commands for command autocomplete and authentication, as well as creating images, submitting ModelArts training jobs and DLI Spark jobs, and copying OBS data.

Application Scenarios

  • ma-cli has been integrated into ModelArts notebook and can be directly used.

    Log in to the ModelArts console, choose DevEnviron > Notebook, create a notebook instance, start a terminal, and run ma-cli commands.

  • In local Windows or Linux, install ma-cli and then use it on a local terminal. For details, see (Optional) Installing ma-cli Locally.
    • ma-cli cannot be used in Git Bash.
    • Terminals such as Linux Bash, Zsh, Fish, WSL, and PowerShell are recommended. To ensure the security of your sensitive information, it is important to prevent any potential leakage when using terminals.

Command Preview

$ ma-cli -h
Usage: ma-cli [OPTIONS] COMMAND [ARGS]...

Options:
  -V, -v, --version       1.2.1
  -C, --config-file TEXT  Configure a file path for authorization.
  -D, --debug             Debugging mode, in which the full stack trace will be displayed when an error occurs.
  -P, --profile TEXT      CLI connection profile to be used. The default profile is DEFAULT.
  -h, -H, --help          Show the help information and exit.

Commands:
  configure        Configure authentication and endpoints for the CLI.
  image            Obtain registered images, register or unregister images, debug images, and create images in Notebook.
  obs-copy         Copy files or directories between OBS and a local path.
  ma-job           Submit ModelArts jobs and obtain jod details.
  dli-job          Submit DLI spark jobs and obtain jod details.
  auto-completion  Auto complete ma-cli command in terminal, support "bash(default)/zsh/fish".

Among the preceding parameters, parameters -C, -D, -P, and -h are globally optional.

  • -C indicates that you can manually specify the authentication configuration file when running this command. By default, the ~/.modelarts/ma-cli-profile.yaml configuration file is used.
  • -P indicates a group of authentication information in the authentication file. The default value is DEFAULT.
  • -D indicates whether to enable the debugging mode (disabled by default). After the debugging mode is enabled, the error stack information of the command will be printed. If this mode is disabled, only the error information will be printed.
  • -h indicates that the help information about the command will be displayed.

Commands

Table 1 ma-cli commands

Command

Description

configure

ma-cli authentication using a username and password or an SK/SK

image

ModelArts image creation, registration, and registered image query

obs-copy

Copying files or folders between a local path and OBS

ma-job

Managing ModelArts training jobs, including job submission and resource query

dli-job

DLI Spark job submission and resource management

auto-completion

Command autocomplete