You can use the EASCMD client to create services in Elastic Algorithm Service (EAS) of Platform for AI (PAI). Before you create a service, you must specify the related parameters in a JSON object. This topic describes the parameters in the JSON object.
For more information about how to use the EASCMD client, see Download the EASCMD client and complete identity authentication.
Parameters
The following tables describe the parameters in the JSON object.
Parameter | Required | Description |
name | Yes | The name of the service. The name must be unique in a region. |
token | No | The authentication token. If you do not specify this parameter, the system automatically generates a token. |
model_path | Yes | The path of the input model package. Specify the model_path and the processor_path parameters in one of the following formats:
|
oss_endpoint | No | The public endpoint of OSS in a region. Example: oss-cn-beijing.aliyuncs.com. For more information, see Regions and endpoints. Note If you do not specify this parameter, the system uses the endpoint of OSS in the current region to download the model package or processor package. If you want to access OSS in a different region, you must specify this parameter. For example, if you want to deploy a service in the China (Hangzhou) region but want to use an OSS endpoint in the China (Beijing) region for the model_path parameter, you must specify this parameter. |
model_entry | No | The entry file of the model package. The file can be an arbitrary file. If you do not specify this parameter, the value of the model_path parameter is used. The main file path in the model package is passed to the initialize() function of the processor. |
model_config | No | The configuration of the model. The value is of the TEXT type. The value of this parameter is passed to the second parameter of the initialize() function in the processor. |
processor | No |
|
processor_path | No | The path of the processor package. For more information, see the description of the model_path parameter. |
processor_entry | No | The main file of the processor package. such as libprocessor.so, or app.py. The main file contains the implementations of the If you set the processor_type parameter to cpp or python, you must specify this parameter. |
processor_mainclass | No | The main class in the JAR package of the processor. such as com.aliyun.TestProcessor. If you set the processor_type parameter to java, you must specify this parameter. |
processor_type | No | The language that is used to implement the processor. Valid values:
|
warm_up_data_path | No | The path of the request file that is used for model warm-up. For more information, see Warm up model services . |
runtime.enable_crash_block | No | Specifies whether the service instance automatically restarts if the instance crashes due to a processor code exception. Valid values:
|
cloud | No | If you use the public resource group to deploy a service, you must use the cloud.computing.instance_type parameter to specify the instance type that is used to deploy the service.
For more information, see Usage notes for the shared resource group. |
autoscaler | No | The horizontal auto-scaling configuration of the model service. For more information, see Auto-scaling. |
containers | No | The container information of the custom image that you want to use to deploy the service. For more information, see Deploy a model service by using a custom image. |
storage | No | The storage information of the service. |
metadata | Yes | The metadata of the service. For more information, see the Table 1. metadata parameters section of this topic. |
features | No | The features of the service. For more information, see the Table 2. features parameters section of this topic. |
networking | No | The call configurations of the service. For more information, see the Table 3. networking parameters section of this topic. |
Example
Sample JSON file:
{{
"name": "test_eascmd",
"processor": "tensorflow_cpu_1.12",
"model_path": "oss://examplebucket/exampledir/",
"oss_endpoint": "oss-cn-beijing.aliyuncs.com",
"model_entry": "",
"model_config": "",
"processor": "",
"processor_path": "",
"processor_entry": "",
"processor_mainclass": "",
"processor_type": "",
"warm_up_data_path": "",
"runtime": {
"enable_crash_block": false
},
"cloud": {
"computing": {
"instance_type": "ecs.gn6i-c24g1.6xlarge"
}
},
"autoscaler": {
"min": 2,
"max": 5,
"strategies": {
"qps": 10
}
},
"storage": [
{
"mount_path": "/data_oss",
"oss": {
"endpoint": "oss-cn-shanghai-internal.aliyuncs.com",
"path": "oss://bucket/path/"
}
}
],
"metadata": {
"resource": "eas-r-9lkbl2jvdm0puv****",
"instance": 1,
"workspace_id": 1405**,
"gpu": 0,
"cpu": 1,
"memory": 2000,
"gpu_memory": 10,
"gpu_core_percentage": 10,
"qos": "",
"cuda": "11.2",
"enable_grpc": false,
"enable_webservice": false,
"rpc": {
"batching": false,
"keepalive": 5000,
"io_threads": 4,
"max_batch_size": 16,
"max_batch_timeout": 50,
"max_queue_size": 64,
"worker_threads": 5,
"rate_limit": 0,
"enable_sigterm": false
},
"rolling_strategy": {
"max_surge": 1,
"max_unavailable": 1
},
"eas.termination_grace_period": 30,
"scheduling": {
"spread": {
"policy": "host"
}
}
},
"features": {
"eas.aliyun.com/extra-ephemeral-storage": "100Gi"
},
"networking": {
"disable_internet_endpoint": false
}
}