Updated on 2023-09-06 GMT+08:00

Introduction to Custom Images

ModelArts provides multiple frequently-used built-in engines. However, when users have special requirements for the deep learning engine and development library, the built-in AI engines cannot meet user requirements. ModelArts provides the custom image function to allow users to customize engines.

The bottom layer of ModelArts uses the container technology. Custom images refer to that users create container images and run them on ModelArts. The custom image function supports command line parameters and environment variables in free-text format. The custom images are highly flexible and support the job boot requirements of any computing engine.

Associated Services

Using a custom image may require the following cloud services: Software Repository for Container (SWR), Object Storage Service (OBS), and Elastic Cloud Server (ECS).

  • SWR

    SWR provides easy, secure, and reliable management over Docker container images throughout their lifecycle, facilitating the deployment of containerized applications. You can upload, download, and manage container images through SWR console, SWR APIs, or community CLI.

    Obtain the custom images used by ModelArts for training or creating AI applications from the SWR service management list. Upload the custom images you create to SWR.

    Figure 1 Obtaining the image list
  • OBS

    OBS is a cloud storage service optimized for storing massive amounts of data. It provides unlimited, secure, and highly reliable storage capabilities at a relatively low cost.

    Creating an AI application or creating a training job requires large volumes of data. You can store the data in OBS.

  • ECS

    An ECS is a basic computing component that consists of CPUs, memory, OS, and elastic volume service (EVS). After creating an ECS, you can use it like your local computer or physical server.

    You can create a custom image using a local environment or an ECS.

When you use a custom image, ModelArts may need to access dependent services, such as SWR and OBS. The custom image can be used only after the access to these dependent services is authorized. It is a good practice to use an agency for authorization. After the agency is configured, the permissions to access dependent services are delegated to ModelArts so that ModelArts can use the dependent services and perform operations on resources on your behalf. For details, see Configuring Agency Authorization.

Application Scenarios of Custom Images

  • For Training Models

    If you have developed a model or training script locally and the AI engine you use is not supported by ModelArts, you can create a custom image based on the basic image packages provided by ModelArts and upload the custom image to SWR. Then, you can use the custom image to create a training job on ModelArts and use the resources provided by ModelArts to train models.

  • For Creating AI Applications

    If you use an AI engine that is not supported by ModelArts to develop a model, you can create a custom image, import the image to ModelArts and use it to create an AI application for unified management, and deploy the AI application as a service.

Process of Creating a Custom Image

  1. Use a local host or purchase an ECS to set up the Docker environment.
  2. Obtain the basic image from the local environment.
  3. Write a Dockerfile based on your requirements to build a custom image. For details about how to efficiently write a Dockerfile, see Writing a Quality Dockerfile.
  4. After a custom image is created, upload the image to your SWR by referring to Uploading an Image Through a Container Engine Client.