Updated on 2023-11-21 GMT+08:00

Obtaining Registered ModelArts Images

A path to a base image is provided in a Dockerfile typically. Public images and SWR public or private images can be obtained from open-source image repositories such as Docker Hub. ma-cli allows you to obtain ModelArts preset images and registered images and their SWR addresses.

$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.
Table 1 Parameters

Parameter

Type

Mandatory

Description

-t / --type

String

No

Type of the images to be obtained. The options are BUILD_IN, DEDICATED, and ALL.

  • BUILD_IN: preset images
  • DEDICATED: custom images registered with ModelArts
  • ALL: all images

-f / --filter

String

No

Keyword of an image name, which is used to filter images

-v / --verbose

Bool

No

Whether to display detailed information. This function is disabled by default.

-i / --image-id

String

No

Obtain details about an image with a specified ID.

-n / --image-name

String

No

Obtain details about an image with a specified name.

-wi / --workspace-id

String

No

Obtain images in a specified workspace.

-pn / --page-num

Int

No

Image page index. The default value is page 1.

-ps / --page-size

Int

No

Number of images displayed on each page. The default value is 20.

Examples

Obtain custom images registered with ModelArts.

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