Image acceleration
Create accelerated images in Container Registry (ACR) and use them in DSW, DLC, and EAS. Accelerated images use on-demand loading: image data is loaded without a full download and is decompressed online, so containers start faster because only the required image layers are loaded. PAI fully managed services support on-demand loading from ACR repositories by default.
Prerequisites
PAI (DSW, DLC, and EAS) is activated and a workspace is created. For more information, see Activate PAI and create a default workspace.
Container Registry is activated.
-
An Enterprise instance is created. For more information, see Create an Enterprise instance.
ImportantSupported instance specifications vary by mode:
Full mode: Standard or Advanced Edition.
Index-only mode: Basic, Standard, or Advanced Edition.
A VPC is configured for the ACK or ACK Serverless cluster in the Enterprise instance. Image acceleration requires VPC access. For more information, see Configure VPC-based access control.
Convert accelerated images
You can configure automatic conversion at the repository level. When you push an image to the repository, the image is automatically converted to an accelerated image. The conversion time depends on the image size. The original image is not affected.
The accelerated image uses the same namespace and repository name as the original image. The tag format depends on the mode:
Index-only mode: The tag is the original tag with the
_acceleratedsuffix. This mode supports only the Containerd runtime. The original image tag cannot be deleted while the accelerated image is in use.-
Full mode:
The tag is the original tag with the
_acceleratedsuffix. This mode supports both Docker and Containerd runtimes.-
The tag is the original tag with the
_containerd_acceleratedsuffix. This mode supports only the Containerd runtime.Images with the
_containerd_acceleratedsuffix cannot be deleted while they are in use.
Log on to the Container Registry console.
In the top navigation bar, select a region.
In the left-side navigation pane, click Instances .
On the Instances page, click the Enterprise Edition instance that you want to manage.
In the left-side navigation pane of the Enterprise instance, choose Repositories > Image Repositories .
On the Image Repositories page, click the target repository name or click Manage in the Actions column.
In the Modify Basic Information dialog box, turn on Image Acceleration , select a mode, and then click OK . After you configure image acceleration, all subsequently pushed images are automatically converted. To receive a notification when the conversion is complete, configure an event notification. For example, set the event filter expression to
_accelerated$. For more information, see Event notification.Full mode : Provides the highest acceleration performance. The accelerated image size is approximately 130% of the original image size. Converting a 1 GB image takes approximately 25 seconds. Previously generated image layers aren't regenerated.
-
Index-only mode : Provides approximately 70% of the acceleration performance of Full mode. The accelerated image size is approximately 3% of the original image size. Converting a 1 GB image takes approximately 3 seconds. Image layers that already have indexes aren't regenerated.
__
Important
Index-only mode is in public preview. We recommend that you test this mode in a test environment before using it in production.
__
Note
Index-only mode supports only images compressed with
tarortgz. Images compressed with other methods such aszstdare not supported.Index-only mode requires the original image to be present. The original image cannot be deleted while the accelerated image is in use. Full mode can use the accelerated image independently.
Index-only mode does not support the Docker runtime.
Use accelerated images in DLC, DSW, or EAS
After conversion, the accelerated image uses the same namespace and repository name as the original image. The tag is the original tag with the _accelerated suffix. You can use accelerated images as custom images in DLC and DSW.
Create a DLC job with an accelerated image
Create a DLC job in a workspace. The following list describes the key parameters. For other parameters, see the DLC topic Create a training job.
Image config: Select Image Address and enter the accelerated image address. The format is the standard image URL with the
_acceleratedsuffix.VPC: When you use public resource groups, configure VPC access. Select the VPC that is associated with the Enterprise ACR instance.
Create a DSW instance with an accelerated image
Create a DSW instance in a workspace. The following list describes the key parameters. For other parameters, see the DSW topic Create a DSW instance.
Image config: On the tab, enter the accelerated image address. The format is the standard image URL with the
_acceleratedsuffix.VPC: When Resource Type is set to Public Resource Group, configure the VPC. Select the VPC that is associated with the Enterprise ACR instance.
Deploy an EAS service with an accelerated image
Deploy an EAS service in a workspace. The following list describes the key parameters. For other parameters, see the EAS topic Custom deployment.
Image Configuration: On the tab, enter the accelerated image address. The format is the standard image URL with the
_acceleratedsuffix.VPC: Select the VPC that is associated with the Enterprise ACR instance.
Related information
For more information about DLC, DSW, and EAS, see the following topics: