Save your DSW instance environment as a custom image and push it to Container Registry (ACR) for reuse or sharing. This preserves your code, dependencies, and system configurations, and works with other PAI services such as DLC and EAS.
Important
-
Instance status: The DSW instance must be in the Running state. If it is Stopped, the Create Image button is grayed out.
-
Region consistency: The DSW and ACR instances must be in the same region. A region mismatch is the most common cause of missing image repositories or namespaces.
-
Image size limit: A single image layer cannot exceed 10 GiB. Exceeding this limit causes the build to fail.
-
Environment limitations: DSW is a containerized environment and does not support installing or using Docker.
-
Differences between ACR Personal Edition and ACR Enterprise Edition:
Feature
ACR Personal Edition
ACR Enterprise Edition
Cost
Free.
Requires a paid instance. Billing of enterprise instances.
Network configuration
Public network. No special configuration required.
Must be in the same VPC as the DSW instance. Internal network access provides more stable transfers.
Performance and stability
Depends on public network bandwidth. Large images (near 10 GiB) may fail due to network fluctuations or timeouts.
High speed and stability over the VPC internal network. Ideal for large images and production environments.
Region flexibility
Only one ACR Personal Edition instance per Alibaba Cloud account. If your DSW instance is in a different region, you cannot use it.
Supports multiple regions, allowing use with DSW instances across regions.
Recommended scenarios
Personal learning, functional testing, and backing up environments with small images.
Team collaboration, production environments, high-stability workloads, and cross-region image access.
Procedure
Step 1: Prepare ACR
Choose ACR Personal Edition or Enterprise Edition based on your needs.
-
ACR Personal Edition: Create an ACR Personal Edition instance, then create a namespace, and then create an image repository in that namespace.
-
ACR Enterprise Edition:
-
Create a security group and bind it to the VPC you created.
-
Create an ACR Enterprise Edition instance, add a VPC connection, and bind it to the VPC and vSwitch that you created. Then, create a namespace, and then create an image repository in that namespace.
Step 2: Create the image
For a DSW instance in the Running state, click Create Image to the right of the instance. Select Image (Container Registry Personal Edition) or Image (Container Registry Enterprise Edition), configure the following key parameters, and then click Save.
|
Parameter |
Description |
|
Image Name (Image Version Name in Container Registry) |
Display name for the custom image. Also used as the image tag in ACR. |
|
Container Registry Namespace |
Select an existing namespace. |
|
Container Registry Repository |
Select an existing image repository. |
|
Custom Excluded Path |
Exclude specific files or directories to speed up image creation, save storage, and protect sensitive data. If not specified, the system uses a default exclusion list. Note
Each image layer cannot exceed 10 GiB, or the build fails. Exclude non-essential paths.
|
After the image is created, hover over the
icon to view the image address, or click here to go to the ACR console for image details.
Step 3: Use the custom image
To use the custom image, create a new DSW instance. On the instance creation page, for the Images parameter, select Custom Image.
FAQ
Q: Why does DSW image creation fail or time out?
-
Image size exceeds the limit: Each image layer cannot exceed 10 GiB. Reduce the image size or use ACR Enterprise Edition for large images.
-
Region mismatch: The DSW instance and the ACR instance must be in the same region. Otherwise, the target image repository cannot be found during image creation.
-
Insufficient system disk space: If the available space on the system disk is less than the size of the data to be written to the image layer, the process fails with an "insufficient capacity of ephemeral storage" error.
-
Network issues: ACR Personal Edition pushes over the public network, which may fail for large images. Use ACR Enterprise Edition in the same VPC for faster, more stable internal network transfers.
Q: Why is the "Create Image" button disabled or the repository missing?
-
Incorrect instance status: Create Image is available only when the DSW instance is Running. The button is grayed out in other states.
-
Prerequisites not met or misconfigured:
-
Create an ACR instance in the same region as the DSW instance, then create a namespace and image repository within it.
-
Verify that the DSW and ACR instances are in the same region.
-
Q: Can I install and use Docker in a DSW instance?
No. DSW runs in a container and does not support Docker. To use a specific Docker image, select Custom Image when creating a DSW instance and enter the ACR image address.
Q: How to upgrade NVIDIA drivers or CUDA in DSW?
Do not upgrade the driver version. DSW drivers and CUDA versions are pre-installed and locked. Manual changes can corrupt the instance beyond recovery. Instead, stop the instance, create a new one, and select an official image with the required CUDA and driver versions.
For example, the official image modelscope:1.9.4-pytorch2.0.1tensorflow2.13.0-gpu-py38-cu118-ubuntu20.04. In this tag, cu118 indicates that the CUDA version is 11.8.
Q: Why does instance creation fail with custom images?
-
Image pull permissions: For private images or VPC access, check the DSW network configuration and ACR authorization policies. Errors such as "pull access denied" or "authorization failed" indicate a permissions issue.
-
Image incompatibility: Build custom images on a standard Linux distribution. Use an official image as the base image.
-
Incorrect image address format: Verify that the image address is correctly formatted.