All Products
Search
Document Center

Elastic High Performance Computing:SubmitServerlessJob

Last Updated:Jul 31, 2025

Submits a serverless job to an Elastic High Performance Computing (E-HPC) cluster.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ehpc:SubmitServerlessJob
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringYes

The cluster ID.

You can call the ListClusters operation to query the cluster ID.

ehpc-hz-FYUr32****
JobNamestringYes

The name of the serverless job.

Note The name can contain lowercase letters, digits, and hyphens (-). It cannot start or end with a hyphen.
testjob
ArrayPropertiesobjectNo

The configuration of the array job.

Note The value of an array job index is passed to a serverless job container through the environment variable EHPC_ARRAY_TASK_ID. Users can access the container from business programs.
IndexStartlongNo

The starting value of the array job index. Valid values: 0 to 4999.

1
IndexEndlongNo

The end value of the array job index. Valid values: 0 to 4999. The value must be greater than or equal to the value of IndexStart.

5
IndexSteplongNo

The interval of the array job index.

Note If the array job property is IndexStart=1,IndexEnd=5, and IndexStep=2, the array job contains three subtasks. The values of the subtask indexes are 1,3, and 5.
2
JobPrioritylongNo

The scheduling priority of the serverless job. Valid values: 0 to 999. A greater value indicates a higher priority.

10
EphemeralStorageintegerNo

The size of the temporary storage space added to the serverless job container. Unit: GiB.

Note By default, a space of 30 GiB is provided free of charge. If you require a larger space, you can pass this parameter to specify your required space size.
200
TimeoutlongNo

The validity period of the serverless job. After the validity period expires, the job is forcibly terminated. Unit: seconds.

3600
VSwitchIdarrayNo

The IDs of the vSwitches to which the serverless job container belongs.

stringNo

The vSwitch ID.

Note E-HPC supports only virtual private cloud (VPC) networks. You can call the DescribeVSwitches operation to query the created vSwitches.
vsw-bp1gb5gf5546rn****
InstanceTypearrayNo

The Elastic Compute Service (ECS) instance types used by the serverless job container.

stringNo

The ECS instance type.

ecs.g7.8xlarge
CpufloatNo

The vCPU size of the serverless job container. Unit: cores.

2
MemoryfloatNo

The memory size of the serverless job container. Unit: GiB.

4
SpotStrategystringNo

The bidding policy of the ECS instances. Valid values:

  • NoSpot: The instance is created as a pay-as-you-go instance.
  • SpotWithPriceLimit: The instance is created as a preemptible instance for which you specify the maximum hourly price.
  • SpotAsPriceGo: The instance is created as a preemptible instance for which the market price at the time of purchase is automatically used as the bid price.

Default value: NoSpot.

SpotWithPriceLimit
SpotPriceLimitfloatNo

The maximum hourly price of the preemptible elastic container instance. The value can be accurate to three decimal places.

If you set SpotStrategy to SpotWithPriceLimit, you must specify the SpotPriceLimit parameter.

0.062
RamRoleNamestringNo

The Resource Access Manamement (RAM) role that is associated with the Serverless job container.

testRamRoleName
ContainerobjectYes

The properties of the Serverless job container.

EnvironmentVararray<object>No

The value of the environment variable for the container.

objectNo

The value of the environment variable for the container.

KeystringNo

The name of the environment variable for the container. The name can be 1 to 128 characters in length and can contain letters, digits, and underscores (_). The name cannot start with a digit. Specify the name in the [0-9a-zA-Z] format.

PATH
ValuestringNo

The value of the environment variable for the container. The value must be 0 to 256 bits in length.

/usr/local/bin
WorkingDirstringNo

The working directory of the container.

/usr/local/
ImagestringYes

The container image.

registry-vpc.cn-hangzhou.aliyuncs.com/ehpc/hpl:latest
CommandarrayNo

The container startup commands.

stringNo

The container startup command.

python3
ArgarrayNo

The arguments of the container startup command. You can specify up to 10 arguments.

stringNo

The startup argument.

hello.py
GpuintegerNo

The number of GPUs used by the container.

1
VolumeMountarray<object>No

The data volumes that are mounted to the container.

objectNo

The data volumes mounted to the container.

MountPathstringNo

The directory to which the volume is mounted.

Note The data stored in this directory is overwritten by the data on the volume. Exercise caution when you specify this parameter.
/data
FlexVolumeDriverstringNo

The driver type when you use the FlexVolume plug-in to mount a volume. Valid values:

  • alicloud/nas: a NAS driver.
  • alicloud/oss: an OSS driver.
alicloud/oss
FlexVolumeOptionsstringNo

The options of the FlexVolume object. Each option is a key-value pair in a JSON string.

{"bucket":"hpctest","url": "oss-cn-hangzhou-internal.aliyuncs.com ","path":"/data","ramRole":"AliyunECSInstanceForEHPCRole"}
DependsOnarray<object>No

The dependencies of the serverless job.

objectNo

The serverless job dependencies.

JobIdstringNo

The ID of the dependent job.

10
TypestringNo

The dependency type. Valid values:

  • AfterSucceeded: All subtasks of the dependent job or array job succeed. The exit code is 0.
  • AfterFailed: All subtasks of the dependent job or array job fail. The exit code is not 0.
  • AfterAny: The dependent job completes (succeeds or fails).
  • AfterCorresponding: The subtask corresponding to the dependent array job succeeds. The exit code is 0.

Default value: AfterSucceeded.

AfterAny
RetryStrategyobjectNo

The retry policy of the serverless job.

AttemptsintegerNo

The number of retries for the serverless job. Valid values: 1 to 10.

5
EvaluateOnExitarray<object>No

The retry rules for the serverless job. You can specify up to 10 rules.

objectNo
ActionstringNo

The job action. Valid values:

  • Retry: The job starts a retry when a specific exit code is hit.
  • Exit: The job exits when a specific exit code is hit.
Retry
OnExitCodestringNo

The job exit code, which is used together with Action to form a job retry rule. Valid values: 0 to 255.

10

Response parameters

ParameterTypeDescriptionExample
object
JobIdstring

The ID of the serverless job.

10
RequestIdstring

The request ID.

04F0F334-1335-436C-A1D7-6C044FE73368

Examples

Sample success responses

JSONformat

{
  "JobId": 10,
  "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParamsThe specified parameter %s is invalid.The specified parameter %s is invalid.
400NotEnabledYou have not enabled this serviceYou have not enabled this service
400InDebtYour account has overdue payments.Your account has overdue payments.
403InvalidClusterStatusThe operation failed due to invalid cluster status.The cluster status does not support the operation.
403ConflictOptA conflicting operation is running.A conflicting operation is running. Please try again later.
404ClusterNotFoundThe specified cluster does not exist.The specified instance does not exist.
406EcsErrorAn error occurred while calling the ECS API operation.ECS API call error. %s
406DbErrorA database service error occurred.Database request failed.
406AliyunErrorAn Alibaba Cloud product error occurred.Alibaba Cloud product error. %s
406AgentErrorThe agent service request failed: %sOperation unsuccessful: %s
406ServiceAPIErrorFailed to call the operation. Cause:%sAn error occurred while calling the API. %s
407NotAuthorizedYou are not authorized by RAM for this request.The request is not authorized by RAM.
409PartFailurePart of the batch operation failed.Part of the batch operation failed.
500UnknownErrorAn unknown error occurred.An unknown error occurred.
503ServiceUnavailableThe request has failed due to a temporary failure of the serverThe request has failed due to a temporary failure of the server.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-09-06The Error code has changed. The request parameters of the API has changedView Change Details
2023-07-25The Error code has changedView Change Details
2023-07-21The Error code has changedView Change Details