Updated on 2024-10-29 GMT+08:00

Creating a Custom Image

Generally, you will need to reconstruct the ModelArts development environment, for example, by installing, upgrading, or uninstalling some packages. However, the root permission is required when certain packages are installed or upgraded. The running notebook instance does not have the root permission. As a result, you need to install the software that requires the root permission in the notebook instance, which is currently unavailable in the preset development environment. You can write a Dockerfile based on a preset base image or third-party image to customize your image.

Process for Creating a Custom Image

Figure 1 Creating a custom image (for scenarios 1 and 2)

Scenario 1: Build and register an image based on the preset image or third-party image in a notebook instance, configure the Docker environment on the server, and compile the Dockerfile. For details, see Creating a Custom Image on ECS and Using It.

Scenario 2: Use ma-cli to create and register an image based on the preset or third-party image provided by a notebook instance for AI development. In this case, the notebook instance is the platform for creating the image. For details, see Creating a Custom Image Using Dockerfile.

Scenario 3: Create a notebook instance using a preset image, install custom software and dependencies on the preset image, and save the running instance environment as a container image. For details, see Creating a Custom Image Using the Image Saving Function.

Specifications for Custom Images

The base image for creating a custom image must meet either of the following conditions:

  • It is an open-source image from the official website of Ascend or Docker Hub and it meets the following OS constraints:

    x86: Ubuntu 18.04 or Ubuntu 20.04

    Arm: Euler 2.8.3 or Euler 2.10.7

    There may be a compatibility issue for Ubuntu 20.04.6. Use an earlier version.

  • If an image error occurs due to unmet requirements, check the image specifications and rectify the fault by referring to Troubleshooting for Custom Images in Notebook Instances. If the fault persists, contact Huawei technical support.

Registering a Created Image

After a custom image is created, register it on the ModelArts Image Management page before using it in notebook.

Only the IAM users of the account can register and use the SWR images when the image type is Private.

Other users can register and use SWR images when the image type is Public.

  1. Log in to the ModelArts management console and choose Image Management. Then, click Register.
  2. Configure parameters and click Register.
    • SWR Source: Select a built image as the image source. You can copy the complete SWR address or click to select the target image for registration.
      Figure 2 Selecting an image source
    • Architecture and Type: Configure them based on the actual framework of the custom image.
  3. View the registered image on the Image Management page.