更新时间:2024-08-16 gmt 08:00

modelarts cli命令功能介绍-九游平台

功能介绍

modelarts cli,即modelarts命令行工具,是一个跨平台命令行工具,用于连接modelarts服务并在modelarts资源上执行管理命令。用户可以使用交互式命令行提示符或脚本通过终端执行命令。为了方便理解,下面将modelarts cli统称为ma-cli。ma-cli支持用户在modelarts notebook及线下虚拟机中与云端服务交互,使用ma-cli命令可以实现命令自动补全、鉴权、镜像构建、提交modelarts训练作业、提交dli spark作业、obs数据复制等。

使用场景

  • ma-cli已经集成在modelarts开发环境notebook中,可以直接使用。

    登录modelarts控制台,在“开发空间 > notebook”中创建notebook实例,打开terminal,使用ma-cli命令。

  • ma-cli在本地windows/linux环境中需要安装后在本地terminal中使用。安装步骤具体可参考(可选)本地安装ma-cli
    • ma-cli不支持在git-bash上使用。
    • 推荐使用linux bash、zsh、fish,wsl或powershell等terminal。在使用过程中,注意您的敏感信息数据保护,避免敏感信息泄露。

命令预览

$ ma-cli -h
usage: ma-cli [options] command [args]...
options:
  -v, -v, --version       1.2.1
  -c, --config-file text  configure file path for authorization.
  -d, --debug             debug mode. shows full stack trace when error occurs.
  -p, --profile text      cli connection profile to use. the default profile is "default".
  -h, -h, --help          show this message and exit.
commands:
  configure        configures authentication and endpoints info for the cli.
  image            support get registered image list、register or unregister image、debug image, build image in notebook.
  obs-copy         copy file or directory between obs and local path.
  ma-job           modelarts job submission and query job details.
  dli-job          dli spark job submission and query job details.
  auto-completion  auto complete ma-cli command in terminal, support "bash(default)/zsh/fish".

其中,-c、-d、-p,-h参数属于全局可选参数。

  • -c表示在执行此命令时可以手动指定鉴权配置文件,默认使用~/.modelarts/ma-cli-profile.yaml配置文件;
  • -p表示鉴权文件中的某一组鉴权信息,默认是default;
  • -d表示是否开启debug模式(默认关闭),当开启debug模式后,命令的报错堆栈信息将会打印出来,否则只会打印报错信息;
  • -h表示显示命令的帮助提示信息。

命令说明

表1 ma-cli支持的命令

命令

命令详情

configure

ma-cli鉴权命令,支持用户名密码、ak/sk

image

modelarts镜像构建、镜像注册、查询已注册镜像信息等

obs-copy

本地和obs文件/文件夹间的相互复制

ma-job

modelarts训练作业管理,包含作业提交、资源查询等

dli-job

dli spark任务提交及资源管理

auto-completion

命令自动补全

相关文档

网站地图