更新时间:2024-04-30 GMT+08:00

注册SWR镜像到ModelArts镜像管理

调试完成后,使用ma-cli image register命令将新镜像注册到ModelArts镜像管理服务中,进而在能够在ModelArts中使用该镜像。

$ma-cli image register -h
Usage: ma-cli image register [OPTIONS]

  Register image to ModelArts.

  Example:

  # Register image into ModelArts service
  ma-cli image register --swr-path=xx

  # Share SWR image to DLI service
  ma-cli image register -swr xx -td

  # Register image into ModelArts service and specify architecture to be 'AARCH64'
  ma-cli image register --swr-path=xx --arch AARCH64

Options:
  -swr, --swr-path TEXT           SWR path without swr endpoint, eg:organization/image:tag.  [required]
  -a, --arch [X86_64|AARCH64]     Image architecture (default: X86_64).
  -s, --service [NOTEBOOK|MODELBOX]
                                  Services supported by this image(default NOTEBOOK).
  -rs, --resource-category [CPU|GPU|ASCEND]
                                  The resource category supported by this image (default: CPU and GPU).
  -wi, --workspace-id TEXT        The workspace to register this image (default: "0").
  -v, --visibility [PUBLIC|PRIVATE]
                                  PUBLIC: every user can use this image. PRIVATE: only image owner can use this image (Default: PRIVATE).
  -td, --to-dli                   Register swr image to DLI, which will share SWR image to DLI service.
  -d, --description TEXT          Image description (default: "").
  -C, --config-file PATH          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.
表1 参数说明

参数名

参数类型

是否必选

参数说明

-swr / --swr-path

String

需要注册的镜像的SWR路径。

-a / --arch

Sring

注册镜像的架构,X86_64或者AARCH64,默认是X86_64。

-s / --service

String

注册镜像的服务类型,NOTEBOOK或者MODELBOX,默认是NOTEBOOK。

可以输入多个值,如-s NOTEBOOK -s MODELBOX。

-rs / --resource-category

String

注册镜像能够使用的资源类型,默认是CPU和GPU。

-wi / --workspace-id

String

注册镜像到指定的工作空间,workspace ID默认是0。

-v / --visibility

Bool

注册的镜像可见性,PRIVATE(仅自己可见)或者PUBLIC(所有用户可见),默认是PRIVATE。

-td / --to-dli

Bool

注册镜像到DLI服务。

-d/ --description

String

填写镜像描述,默认为空。

示例

注册SWR镜像到ModelArts。

ma-cli image register --swr-path=xx