All Products
Search
Document Center

Platform For AI:Use an accelerated image in PAI

Last Updated:Jan 06, 2025

Alibaba Cloud Container Registry (ACR) supports on-demand loading of container images. You can create accelerated versions of your image and decompress image data online instead of downloading the entire image. This improves application distribution efficiency and provides better scalability. When you create a container, you can load the accelerated image on demand, so that containers can start quickly. By default, Platform for AI (PAI) supports this feature. This topic describes how to accelerate your image and use the accelerated image in Data Science Workshop (DSW), Deep Learning Containers (DLC), and Elastic Algorithm Service (EAS).

Prerequisites

  • PAI (DSW, DLC, or EAS) is activated and a workspace is created. For more information, see Activate PAI and create the default workspace.

  • The Container Registry service is activated.

  • A Container Registry Enterprise Edition instance is created. For more information, see Create a Container Registry Enterprise Edition instance.

    Note

    The editions of Container Registry Enterprise Edition instances that support accelerated images vary based on the image acceleration mode.

    • Full mode: Standard Edition and Advanced Edition

    • Index-only mode: Basic Edition, Standard Edition, and Advanced Edition

  • The virtual private cloud (VPC) of the ACK cluster or ACK Serverless cluster is added to the access control list (ACL) of the Container Registry Enterprise Edition instance. Accelerated images can only run in VPCs. For more information, see Configure a VPC ACL.

Enable image acceleration

You can enable image acceleration for a repository. This way, each image that is pushed to the repository is automatically converted to an accelerated image. The time required to convert a pushed image to an accelerated image depends on the size of the pushed image. The conversion does not affect the original image.

Note

The namespace name and repository name of accelerated images are the same as the namespace name and repository name of the original images. The tag format of accelerated images varies based on the image acceleration mode.

  • For the index-only mode, the tag format of accelerated images is the tag of the original images plus the _accelerated suffix. The accelerated images support only the containerd runtime, and the tag of the original images cannot be deleted when the accelerated images are used.

  • For the full mode, the tags of accelerated images are in one of the following formats:

    • The tag of the original images plus the _accelerated suffix. The accelerated images in this format support the Docker and Containerd runtimes.

    • The tag of the original images plus the _containerd_accelerated suffix. The accelerated images in this format support only the containerd runtime.

      Note: The images whose tags contain the _containerd_accelerated suffix cannot be deleted when the images are used.

  1. Log on to the Container Registry console.

  2. In the top navigation bar, select a region.

  3. In the left-side navigation pane, click Instances.

  4. On the Instances page, click the Enterprise Edition instance that you want to manage.

  5. In the left-side navigation pane of the management page of the Container Registry Enterprise Edition instance, choose Repository > Repositories.

  6. On the Repositories page, find the repository for which you want to enable image acceleration. Click the name of the repository or click Manage in the Actions column.

  7. On the page that appears, click Edit in the upper-left corner.

  8. In the Modify Settings dialog box, turn on Enable image acceleration, select a mode, and then click Confirm.

    • Full Mode: This mode significantly accelerates container startup. The size of an accelerated image is approximately 130% of the size of the original image. The system requires approximately 25 seconds to generate an accelerated image for a 1 GB-sized image. If an accelerated image layer has been generated for an image layer, the system does not re-generate an accelerated image layer for the image layer.

    • Index-only Mode: This mode provides an acceleration effect that is approximately 70% the effect of full mode on container startup. The size of an accelerated image is approximately 3% of the size of the original image. The system requires approximately 3 seconds to generate an accelerated image for a 1 GB-sized image. The system does not re-generate indexes for image layers that already have indexes.

      Important

      The index-only mode is in public preview. We recommend that you verify the mode in a test environment before you use the mode in the production environment.

      Note
      • The index-only mode can be used only for images that are compressed by tar and tgz. The mode cannot be used for images that are compressed by other compression methods, such as zstd.

      • To use the index-only mode to accelerate an image, you must bind the original image to the accelerated image. You cannot delete the original image. If you use the full mode, you can independently use the accelerated image.

      • The index-only mode does not support the Docker runtime.

    After you enable image acceleration for a repository, each image that the system pushes to the repository is automatically converted into an accelerated image. If you want to be notified each time an image is converted into an accelerated image, you can configure event notifications. For example, specify an expression-based trigger and set the expression to _accelerated$. For more information, see Event Notification.

Use accelerated images in DLC, DSW, or EAS

After the image is converted to an accelerated image, the namespace and repository name of the accelerated image are the same as those of the original image. The tag is the original image tag suffixed with _accelerated. You can use the accelerated image as a custom image in DLC or DSW.

Use an accelerated image to create a DLC job

Create a DLC job in the workspace. The following section describes key parameters. For more information about other parameters, see Create a training job.

image

  • Node Image: Select Image Address and specify the accelerated image address. The accelerated image address is the original image URL suffixed with _accelerated.

  • VPC: If you select Public Resource Group, you need to configure Virtual Private Cloud (VPC). Select the VPC network that is referenced in the Container Registry Enterprise Edition instance.

Use an accelerated image to create a DSW instance

Create a DSW instance in the workspace. The following section describes key parameters. For more information about other parameters, see Create and manage DSW instances.

image

  • Select Image: Select Image Address and specify the accelerated image address. The accelerated image address is the original image URL suffixed with _accelerated.

  • Networking: If you set Resource Quota to Public Resource Group, you need to configure the network. Select the VPC network that is referenced in the Container Registry Enterprise Edition instance.

Use an accelerated image to deploy an EAS service

Deploy an EAS service in the workspace. The following section describes key parameters. For more information about other parameters, see Deploy a model service in the PAI console.

image

  • Image Configuration: Select Image Address and specify the accelerated image address. The accelerated image address is the original image URL suffixed with _accelerated.

  • VPC: Select the VPC network that is referenced in the Container Registry Enterprise Edition instance.

References

For more information about DLC, DSW, or EAS, see: