Service deployment

Updated at: 2025-03-27 08:53
important

This topic contains important information on necessary precautions. We recommend that you read this topic carefully before proceeding.

Elastic Algorithm Service (EAS) allows you to deploy models downloaded from open source communities or models trained by yourself as inference services or web applications. For models from different sources, EAS supports various deployment methods, including a series of scenario-based deployment methods for quick deployment in the console.

Recommendations

  • For beginners, try deployment in the console first. The scenario-based methods are easy to use.

  • For algorithm developers, try custom deployment in the console or the local client (EASCMD).

Use the console

  1. Log on to the PAI console. Select a region on the top of the page. Then, select the desired workspace and click Enter Elastic Algorithm Service (EAS).

  2. On the Inference Service tab, click Deploy Service. On the Deploy Service page, choose a deployment method.

    Method

    Description

    Method

    Description

    Custom Model Deployment

    • Custom Deployment: A flexible deployment method. Supports deploying models as online services or web applications using processor or image. For parameter details, see Custom deployment parameters.

    • JSON Deployment: Deploys the model based on the provided JSON file. For parameter details, see JSON deployment parameters.

    Scenario-based Model Deployment

    Various one-click deployment solutions for specific scenarios.

  3. After configuring the parameters, click Deploy. When the status changes to Running, the service is deployed.

Use local client (EASCMD)

EASCMD client allows you to create, view, update, and delete model services on your server. The following example shows how to use EASCMD client on Linux 64-bit.

1. Download and authenticate

If you are using Data Science Workshop (DSW) environment and an official image, the EASCMD client is pre-installed in /etc/dsw/eascmd64. Otherwise, download and authenticate the client.

2. Prepare JSON configuration file

For first-time users, you can configure deployment parameters in the console. The corresponding JSON configuration file will be displayed in the Service Configuration section. You can add some configuration items not displayed in the console by referring to JSsON deployment parameters.

Example of service.json:

{
    "cloud": {
        "computing": {
            "instances": [
                {
                    "type": "ecs.c7a.large"
                }
            ]
        }
    },
    "containers": [
        {
            "image": "****-registry.cn-beijing.cr.aliyuncs.com/***/***:latest",
            "port": 8000,
            "script": "python app.py"
        }
    ],
    "metadata": {
        "cpu": 2,
        "instance": 1,
        "memory": 4000,
        "name": "demo"
    }
}
Note

If you are using DSW environment and need to upload a JSON configuration file, see Upload or download data files.

3. Deploy the service

Run the following command in the directory that stores the JSON file to deploy the model service. The following example is for Linux. For more commands, see Run commands to use the EASCMD client.

eascmdwin64 create <service.json>

Replace <service.json> with the actual JSON file name.

Sample return:

[RequestId]: 1651567F-8F8D-4A2B-933D-F8D3E2DD****
+-------------------+----------------------------------------------------------------------------+
| Intranet Endpoint | http://166233998075****.cn-shanghai.pai-eas.aliyuncs.com/api/predict/test_eascmd |
|             Token | YjhjOWQ2ZjNkYzdiYjEzMDZjOGEyNGY5MDIxMzczZWUzNGEyMzhi****                   |
+-------------------+--------------------------------------------------------------------------+
[OK] Creating api gateway
[OK] Building image [registry-vpc.cn-shanghai.aliyuncs.com/eas/test_eascmd_cn-shanghai:v0.0.1-20221122114614]
[OK] Pushing image [registry-vpc.cn-shanghai.aliyuncs.com/eas/test_eascmd_cn-shanghai:v0.0.1-20221122114614]
[OK] Waiting [Total: 1, Pending: 1, Running: 0]
[OK] Waiting [Total: 1, Pending: 1, Running: 0]
[OK] Service is running

Manage EAS services

On the Inference Service tab, you can view, stop, start, or delete the deployed services. You can also manage model services through EASCMD.

Warning

If you stop or delete a service, requests that rely on the service will fail. Proceed with caution.

Operation

Description

Operation

Description

View service details

Click the service name to go to the Overview tab. You can switch to other tabs to view monitoring, logs, events, and other information.

Query container logs

EAS implements log aggregation and filtering at the service instance level. If a service instance fails, you can troubleshoot error messages based on the container logs:

  1. Click the service name to go to the Overview tab.

  2. In the Service Instance section, click Containers in the Actions column.

  3. In the Containers dialog box, click Logs in the Actions column.

Change deployment resources

On the service details page, click Modify Configuration in the Resource Information section.

Update service version

On the Inference Service tab, click Update in the Actions column of the service.

Warning

During an update, the service is paused. Requests that rely on the service will fail until the service recovers. Proceed with caution.

After the service is updated, click the version number in the Current Version column to view Version Information or switch between versions.image

Manual scaling

On the Inference Service tab, click Scale in the Actions column of the service. Edit Instance Count to increase or decrease the resources used by the service.

Auto scaling

Configure automatic scaling of resources based on business requirements.

Special scenarios and advanced settings

  • Service group: EAS provides the service group feature, which enables canary release scenarios where multiple sub-services share traffic.

  • Scheduled service deployment: Use DataWorks to automatically deploy services on a scheduled basis.

  • Mount storage to services: EAS supports various forms of storage mounting, including Object Storage Service (OSS), File Storage NAS, and Git repositories.

  • Service warm up: The model warm up feature reduces the wait time of the initial request, allowing the service to enter a normal service state immediately after going online.

References

After deploying a service, you can:

For models developed in Visualized Modeling (Designer):

  • On this page (1)
  • Recommendations
  • Use the console
  • Use local client (EASCMD)
  • 1. Download and authenticate
  • 2. Prepare JSON configuration file
  • 3. Deploy the service
  • Manage EAS services
  • Special scenarios and advanced settings
  • References
Feedback