All Products
Search
Document Center

Platform For AI:Mount storage to services

Last Updated:Jun 04, 2025

EAS services support multiple storage mounting methods, allowing you to mount model files, code files, or other configuration files to service instances. Using the mounting feature, you can achieve data sharing between multiple service instances and directly modify mounted files during model iterations or code updates without repackaging and redeploying service images, thereby reducing development and operational costs. This document describes the types of mounts supported by EAS services and provides instructions on how to configure storage mounting.

Introduction to mounting methods

EAS services support the following mounting methods:

  • OSS mounting: Supports mounting Object Storage Service (OSS) files or directories, suitable for large-scale unstructured data storage and access.

  • NAS mounting: Supports mounting General-purpose NAS, Extreme NAS and Lingjun AI Computing Service CPFS file system paths.

    Note
    • Mounting Lingjun AI Computing Service CPFS file systems is supported only when deploying EAS services using Lingjun AI Computing Service resource quotas.

    • Only internal network addresses within the same region are supported for mounting. You need to establish a direct connection to the vSwitch where the NAS is located. For network connection methods, see Configure network connectivity.

  • Git mounting: Supports mounting code from Git repositories in read-only mode to service instances, pulling code when instances start. After code changes, service instances need to be restarted for changes to take effect.

  • Image mounting: Docker Image mounting does not directly mount directories from the image to service instances. Instead, it copies files from the specified directory in the image to a local Shared Volume, and then mounts the local Shared Volume during service runtime. Therefore, when the data volume in the directory to be mounted is large, it consumes more local storage and extends service instance startup time. Use this feature according to your needs.

  • EmptyDir mounting: If you want instances to read and write to local disk directories during runtime, and ensure that written content is not lost after instance abnormal restarts, you can use EmptyDir storage mounting.

  • Code configuration: Supports creating Git code repositories as PAI code sets, registering them as public AI assets for easy mounting and reference when deploying services.

  • Custom datasets: Supports creating related data or configuration files as PAI datasets, registering them as public AI assets for easy mounting and reference when deploying services.

    Note

    Only Object Storage Service (OSS) type custom datasets are supported for mounting.

  • PAI models: Register models required for services as PAI public AI assets for unified management in PAI. For more information, see Register and manage models. You can directly mount and use them when deploying services.

Configure storage mounting

When deploying services, you can use mounting methods to complete model configuration or code configuration. The supported mounting types and their required parameters are as follows:

OSS mounting

OSS mounting requires you to authorize EAS with one-click authorization in the EAS console to read your OSS directories. For more information, see Permission Management.

  • Configuration methods

    • Console

      image

    • JSON configuration

      {
        "storage": [
              {
                  "oss": {
                      "path": "oss://bucket/path/",
                      "readOnly": false
                  },
                  "mount_path": "/mnt/data/"
              }
          ]
      }
  • Parameters

    Parameter (Console)

    Parameter (JSON configuration)

    Description

    Uri

    oss.path

    Configure as the OSS source path, which is the Object Storage Service OSS bucket path. For information about how to create a bucket, see Quick Start.

    Mount path

    mount_path

    The destination path to mount in the service instance, used to read source files or data. For example, /mnt/data.

    Read-only

    oss.readOnly

    You can set access control list by enabling or disabling the read-only switch.

NAS mounting

NAS mounting (including General-purpose NAS, Extreme NAS, and Lingjun AI Computing Service CPFS) only supports internal network addresses in the same region. You can use internal NAS addresses and need to establish a direct connection to the vSwitch where the NAS is located. For network connection methods, see Configure network connectivity.

  • Configuration methods

    • Consoleimage

    • JSON configuration

      {
        "storage": [
              {
                  "nfs": {
                      "path": "/",
                      "server": "06ba74****-a****.cn-hangzhou.nas.aliyuncs.com",
                      "readOnly": false
                  },
                  "mount_path": "/mnt/data/"
              }
          ]
      }
  • Parameters

    Parameter (Console)

    Parameter (JSON configuration)

    Description

    Storage permission resource group

    nfs.resourceGroup

    File system resource group, used to filter corresponding file systems by resource group. For more information about resource groups, see Best practices for resource group design.

    When All storage permission resource groups is selected, no configuration is required in JSON.

    Select file system

    None

    The ID of the created NAS file system. You can log on to the NAS console and view the NAS file system ID in the corresponding region.

    File system mount target

    nfs.server

    The address of the NAS mount target. EAS services will access the NAS file system through the mount target. For information about how to view it, see View mount target addresses.

    Note

    After selecting a mount target through the console, the system automatically selects the virtual private cloud that matches the mount target.

    File system path

    nfs.path

    The path of the NAS file system to be mounted. This is the file system path inside the NAS instance, for example /. Make sure this path exists, otherwise errors will occur during use.

    Mount path

    mount_path

    The destination path to mount in the service instance, used to read source files or data. For example, /mnt/data.

    Read-only

    nfs.readOnly

    Specifies whether to mount in read-only mode.

Git mounting

Mount in read-only mode to service instances:

  • Configuration methods

    • Consoleimage

    • JSON configuration

      {
        "storage": [
              {
                  "git": {
                      "repo": "https://codeup.aliyun.com/xxx/eas/aitest.git",
                      "branch": "master",
                      "commit": "xxx",
                      "username": "username",
                      "password": "password or access token"
                  },
                  "mount_path": "/mnt/data/"
              }
          ]
      }
  • Parameters

    Parameter (Console)

    Parameter (JSON configuration)

    Description

    Git address

    git.repo

    The HTTPS address of the Git repository to be mounted. The Git protocol is not supported.

    Code branch

    git.branch

    The branch of the Git repository to pull, default is master.

    Code Commit

    git.commit

    The commit ID of the Git repository to pull.

    Git username

    git.username

    The login username for the private Git repository.

    Access Token

    git.password

    The login password for the private Git repository. For information about how to obtain it, see Appendix: Obtaining a GitHub account Token.

    Mount path

    mount_path

    The destination path to mount in the service instance. For example, /mnt/data.

Image mounting

  • Configuration method

    {
        "storage": [
            {
                "image": {
                    "image": "registry-vpc.cn-xxxx.aliyuncs.com/eas/image_name:v1",
                    "path": "/path/to/mount/"
                },
                "mount_path": "/data_image"
            }
        ]
    }
    Note

    Only internal network addresses in the same region are supported for mounting. If the image to be mounted is private, you need to specify the authentication information for the image repository using the dockerAuth parameter. For information about using the dockerAuth parameter, see Deploy a model service by using a custom image.

  • Parameters

    Parameter (JSON configuration)

    Description

    image.image

    The internal address of the image repository to be mounted.

    image.path

    The path in the image to be mounted to the service instance.

    mount_path

    The destination path to mount in the service instance. For example, /data_image.

EmptyDir mounting

  • Configuration method

    {
        "name": "service_name",
        "storage": [
            {
                "empty_dir": {},
                "mount_path": "/data_image"
            }
        ]
    }
  • Parameters

    Parameter (JSON configuration)

    Description

    mount_path

    The destination path to mount in the service instance.

    empty_dir

    Indicates an EmptyDir type with an empty Map value, which stores data on the local disk. You cannot configure other properties in this parameter.

Configure shared memory

When high storage performance is required, you can use the following configuration file to configure shared memory.

{
    "storage": [
        {
            "empty_dir": {
              "medium": "memory",
              "size_limit": 20
            },
            "mount_path": "/dev/shm"
        }
    ]
}

Parameters:

Parameter (JSON configuration)

Description

medium

Set this parameter to memory.

mount_path

Set this parameter to /dev/shm.

size_limit

Used to limit the memory upper limit, in GB.

Code configuration

Mount in read-only mode to service instances:

  • Configuration methods

    • Consoleimage

    • JSON configuration

      "storage": [
              {
                  "code": {
                      "id": "code-4d3b42a1152****"
                  },
                  "mount_path": "/mnt/data/"
              }
          ]
  • Parameters

    Parameter (Console)

    Parameter (JSON configuration)

    Description

    Code configuration

    code.id

    The registered code set. For information about how to create a code set and obtain the code set ID, see Code configuration.

    Mount path

    mount_path

    The destination path to mount in the service instance. For example, /data_image.

Custom datasets

Only Object Storage Service (OSS) type datasets are supported for mounting:

  • Configuration methods

    • Consoleimage

    • JSON configuration

      "storage": [
              {
                  "dataset": {
                      "id": "d-pcsah1t86bm8******",
                      "version": "v1",
                      "read_only": false
                  },
                  "mount_path": "/mnt/data/"
              }
          ]
  • Parameters

    Parameter (Console)

    Parameter (JSON configuration)

    Description

    Custom dataset

    dataset.id

    The registered Object Storage Service (OSS) type custom dataset. For information about how to create a custom dataset and obtain the dataset ID, see Create and manage datasets.

    Version

    version

    The dataset version, for example, v1.

    Read-only

    dataset.read_only

    Specifies whether to mount in read-only mode.

    Mount path

    mount_path

    The destination path to mount in the service instance. For example, /mnt/data/.

PAI models

Mount in read-only mode to service instances:

  • Configuration method

    image

  • Parameters

    Parameter (Console)

    Description

    PAI model

    The registered PAI model. For information about how to create a model, see Register and manage models.

    Mount path

    The destination path to mount in the service instance. For example, /mnt/data/.

JSON configuration example

The complete configuration example is as follows. For more information, see JSON deployment parameter description.

{
    "name": "service_name",
    "model_path": "http://path/to/model",
    "processor": "pmml",
    "storage": [
        {
            "oss": {
                "path": "oss://bucket/path/",
                "readOnly": false
            },
            "mount_path": "/mnt/data/"
        },
        {
            "nfs": {
                "path": "/",
                "server": "06ba74****-a****.cn-hangzhou.nas.aliyuncs.com",
                "readOnly": false
            },
            "mount_path": "/mnt/data/"
        },
        {
            "image": {
                "image": "registry-vpc.cn-shanghai.aliyuncs.com/eas/test_image:v1",
                "path": "/path/to/mount/"
            },
            "mount_path": "/data_image"
        },
        {
            "empty_dir": {
              "medium": "memory",
              "size_limit": 20
            },
            "mount_path": "/dev/shm"
        },
        {
            "git": {
                "repo": "https://codeup.aliyun.com/xxx/eas/aitest.git",
                "branch": "master",
                "commit": "xxx",
                "username": "username",
                "password": "password or access token"
            },
            "mount_path": "/mnt/data/"
        }
    ],
    "metadata": {
        "cpu": 1,
        "instance": 1,
        "resource": "eas-r-xxx"
    }
}