All Products
Search
Document Center

Elastic Container Instance:Overview

最終更新日:Mar 29, 2024

Elastic Container Instance provides the DataCache feature. You can cache a large amount of business data, such as training models, to your on-premises device. When you create an elastic container instance, you can mount and use the DataCache. This reduces the startup time of the instance, prevents repeated data downloads, and saves the costs of using the instance. This topic describes the feature, scenarios, creation method, usage method, and billing of a DataCache.

Feature description

To decouple data loading from container image loading, Elastic Container Instance provides the DataCache feature. Before you create a business application, you can create a DataCache to cache the data required by the business application to your on-premises device. Then, when you create the business application, you can mount and use the cached data.

The DataCache feature eliminates the need to package data into application images. This prevents frequent image updates due to data changes. You also do not need to download data from a remote repository. This prevents slow application startup due to data downloads.

Scenarios

The DataCache feature is suitable for scenarios in which a large amount of data is used or data is frequently updated. For example, in machine learning scenarios, you can perform the following operations to deploy a model application:

  • If you do not use the DataCache feature

    1. Download the model data to the development environment.

    2. Package the model data and application to build a container image and create an image cache.

    3. Deploy the application based on the image cache.

    数据缓存概述1.png

  • If you use the DataCache feature

    1. Create a DataCache to pull the model data.

    2. Package the application to build a container image and create an image cache.

    3. Deploy the application based on the image cache and the DataCache.

    数据缓存概述2.png

The preceding procedure shows that if you do not use the DataCache feature, the container image may be oversized. When the model is updated, you must re-build an image, re-publish an image tag, re-create an image cache, and re-deploy the application. If you use the DataCache feature to decouple the data from the image, you only need to re-create a DataCache and re-mount the DataCache to the application when the model is updated.

Creation method

You can create a DataCache by setting the properties of the DataCache. The major properties of a DataCache include:

  • Storage Path

    When you create a DataCache, you can specify a bucket and the storage path of the DataCache in the bucket. If you do not specify a bucket, the DataCache is stored in the bucket that is named default.

  • Data Source

    Typically, business data is stored in Aspara File Storage NAS (NAS) file systems or Object Storage Service (OSS) buckets. Models may be stored in ModelScope or Hugging Face. Elastic Container Instance provides cache supports for these data sources. You can pull data from the following data sources to create a DataCache:

    • URL: a specific data download link, a model or dataset on ModelScope or Hugging Face.

    • NAS: a NAS file system.

    • OSS: an OSS bucket.

    • SNAPSHOT: an Alibaba Cloud snapshot.

  • Size

    Before you create a DataCache, you must determine the size of the DataCache based on the actual data volume. If you do not specify a size, the DataCache is 20 GiB in size by default. If the data volume exceeds 20 GiB, the DataCache fails to be created.

  • Retention Period

    If you do not specify a retention period when you create a DataCache, the DataCache is always retained. If you do not use a DataCache for an extended period of time, we recommend that you set a retention period to avoid unnecessary snapshot costs.

Usage method

When you use a DataCache to create an elastic container instance, you can specify a bucket that is used to store the DataCache and mount the data storage path by using HostPath. In this case, the system automatically creates and mounts a pay-as-you-go cloud disk. The storage capacity of the cloud disk is equal to the size of the DataCache. The cloud disk is created and released together with the elastic container instance.

Billing

  • Create a DataCache

    When you create a DataCache, the system automatically creates temporary resources that include an elastic container instance and a cloud disk. Then, the system creates a snapshot based on the temporary resources. You must pay for the temporary resources and snapshot.

  • Use a DataCache

    When you use a DataCache to create an elastic container instance, the system automatically creates a cloud disk whose size is equal to the size of the DataCache. Then, the system mounts the cloud disk to the elastic container instance. You are charged for the cloud disk and the elastic container instance.

For more information about billing of DataCaches, see DataCaches.