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

查询ModelArts已注册镜像

Dockerfile一般需要提供一个基础镜像的地址,目前支持从docker hub等开源镜像仓拉取公开镜像,以及SWR的公开或私有镜像。其中ma-cli提供了查询ModelArts预置镜像和用户已注册镜像列表及SWR地址。

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

  Get registered image list.

  Example:

  # Query images by image type and only image id, show name and swr_path
  ma-cli image get-image --type=DEDICATED

  # Query images by image id
  ma-cli image get-image --image-id ${image_id}

  # Query images by image type and show more information
  ma-cli image get-image --type=DEDICATED -v

  # Query images by image name
  ma-cli image get-image --filter=torch

Options:
  -t, --type [BUILD_IN|DEDICATED|ALL]
                                  Image type(default ALL)
  -f, --filter TEXT               Image name to filter
  -v, --verbose                   Show detailed information on image.
  -i, --image-id TEXT             Get image details by image id
  -n, --image-name TEXT           Get image details by image name
  -wi, --workspace-id TEXT        The workspace where you want to query image(default "0")
  -pn, --page-num INTEGER RANGE   Specify which page to query  [x>=1]
  -ps, --page-size INTEGER RANGE  The maximum number of results for this query  [x>=1]
  -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 参数说明

参数名

参数类型

是否必选

参数说明

-t / --type

String

查询的镜像类型,支持BUILD_IN、DEDICATED和ALL三种查询类型。

  • BUILD_IN:预置镜像
  • DEDICATED:用户已注册的自定义镜像
  • ALL:所有镜像

-f / --filter

String,

镜像名关键字。根据镜像名关键字过滤镜像列表。

-v / --verbose

Bool

显示详细的信息开关,默认关闭。

-i / --image-id

String

查询指定镜像ID的镜像详情。

-n / --image-name

String

查询指定镜像名称的镜像详情。

-wi / --workspace-id

String

查询指定工作空间下的镜像信息。

-pn / --page-num

Int

镜像页索引,默认是第1页。

-ps / --page-size

Int

每页显示的镜像数量,默认是20。

示例

查询ModelArts已注册的自定义镜像。

ma-cli image get-image --type=DEDICATED