Image Functions in ModelArts
During AI service development, developers often face challenges such as complex environment dependencies, unstable development environments, and the difficulty of switching between multiple runtime environments. These issues significantly hinder development efficiency and slow down model iteration. To address these problems and ensure a stable and portable development environment, ModelArts offers a solution using container images. By encapsulating dependencies and runtime configurations into containers, developers can maintain consistent environments, manage dependencies more effectively, and switch between different runtime environments with ease. The container resources provided by ModelArts enable quick and efficient AI development and model experiment iteration.
This section describes the concepts related to images, application scenarios of preset images and custom images, and how to create custom images.
Concepts
Preset images: ModelArts provides preset images based on different frameworks and CUDA versions. When creating a notebook instance, training job, or real-time inference service, you can directly select a preset image provided by ModelArts. For details, see ModelArts Preset Images.
Unified images: are applicable to notebook creation, model training, and real-time inference. These images can be pulled using the docker pull command. For details, see ModelArts Unified Images.
Custom image: created by user by following the ModelArts image creation specifications. For details, see Creating a Custom Image for a Notebook Instance, Creating a Custom Image for Model Training, and Creating a Custom Image for Inference.
Base image: used for image creation. A base image can be a ModelArts preset image or a third-party image.
Applications of Preset Images
You can use ModelArts preset images to create notebook instances, training jobs, and real-time inference services. We recommend the preset image version based on your development requirements and stability of the version. If your development can be carried out using versions preset in ModelArts, for example, MindSpore 1.X, use the preset images. They have been fully verified and have many commonly-used installation packages, relieving you from configuring the environment.
The preset images provided by ModelArts have the following features:
- Out-of-the-box and scenario-specific: Typical dependent environments for AI development are preset in these images to provide optimal software, OS, and network configurations. They have been fully tested on hardware to ensure optimal compatibility and performance.
- Configuration customizable: Preset images are stored in the SWR repository for you to customize and register them as your own images.
- Secure and reliable: Access policies, user permissions control, vulnerability scanning for development software, and OS are configured based on best practices for security hardening to ensure the security of images.
Applications of Custom Images
Preset images cannot meet the requirements for deep learning engines and development library. To resolve this issue, ModelArts allows image customization so that you can customize runtime engines. For details about how to create a custom image, see Creating a Custom Image for a Notebook Instance, Creating a Custom Image for Model Training, and Creating a Custom Image for Inference.
ModelArts runs in containers. You can customize container images to run on ModelArts. Custom images support CLI parameters and environment variables in free-text format, featuring high flexibility for a wide range of compute engines.
When you create a custom image, use the ModelArts preset image as the base image, that is, obtain the preset image using the SWR address in Dockerfile for image creation. You can obtain the SWR address of the image from the preset image list of ModelArts. For details, see Viewing the Preset Image Version List/Image Address.
The rules for creating a custom image vary according to the application scenario. The details are as follows:
- General rule: SWR images can be shared with others only when the image type is Private. This rule applies to development environments, training jobs, and real-time inference services.
- Development environment: Other users can register and use SWR images on the ModelArts image management page only when the SWR image type is Public.
- Training job: When the SWR image type is Public, you can select the image source address as required when using a custom image to create a training job.
Custom Image Services
- SWR
Software Repository for Container (SWR) provides easy, secure, and reliable management over container images throughout their lifecycle, facilitating the deployment of containerized applications. You can upload, download, and manage container images through the SWR console, SWR APIs, or community CLI.
Your custom images must be uploaded to SWR. The custom images used by ModelArts development environments, training jobs, and real-time inference are obtained from the SWR service management list.
Figure 1 Obtaining images
- OBS
Object Storage Service (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.
ModelArts exchanges data with OBS. You can store data in OBS.
- ECS
An Elastic Cloud Server (ECS) is a basic computing unit that consists of vCPUs, memory, OS, and Elastic Volume Service (EVS) disks. After an ECS is created, you can use it as your local PC or physical server.
You can create a custom image on premises or on an ECS.
When you use a custom image, ModelArts may need to access dependency services, such as SWR and OBS. The custom image can only be used after the access is authorized. It is a good practice to use an agency for authorization. After an 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 for ModelArts with One Click.
Using an Image Through a Command Line Tool
Based on the preset images provided by notebook or third-party images, you can use the ModelArts command line tool (ma-cli image Commands for Building Images) to create and register images, and build a custom image for AI development.
The ma-cli image command can be used to obtain registered images, obtain or load image creation templates, create images using Dockerfiles, obtain or clear image creation caches, register or deregister images, and debug whether images can be used in notebook instances. For details, run the ma-cli image -h command.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot