All Products
Search
Document Center

Elastic High Performance Computing:SubmitServerlessJob

Last Updated:Aug 28, 2026

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

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ehpc:SubmitServerlessJob

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ClusterId

string

Yes

The cluster ID.

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

ehpc-hz-FYUr32****

JobName

string

Yes

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

ArrayProperties

object

No

The configuration of the array job.

Note

The array job index value is passed to the serverless job container through the EHPC_ARRAY_TASK_ID environment variable. Applications running in the container can read this value.

IndexStart

integer

No

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

1

IndexEnd

integer

No

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

IndexStep

integer

No

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

JobPriority

integer

No

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

10

EphemeralStorage

integer

No

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

Note

By default, 30 GiB is provided free of charge. Specify this parameter if you need more space.

200

Timeout

integer

No

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

3600

VSwitchId

array

No

The vSwitch IDs for the serverless job container.

string

No

The vSwitch ID.

Note

E-HPC supports only virtual private cloud (VPC) networks. You can call the DescribeVSwitches operation to query available vSwitches.

vsw-bp1gb5gf5546rn****

InstanceType

array

No

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

string

No

The ECS instance type.

ecs.g7.8xlarge

Cpu

number

No

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

2

Memory

number

No

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

4

SpotStrategy

string

No

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

SpotPriceLimit

number

No

The maximum hourly price of the preemptible elastic container instance. The value supports up to three decimal places.

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

0.062

RamRoleName

string

No

The Resource Access Management (RAM) role associated with the serverless job container.

testRamRoleName

Container

object

Yes

The properties of the serverless job container.

EnvironmentVar

array<object>

No

The environment variables for the container.

object

No

The value of the environment variable for the container.

Key

string

No

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

Value

string

No

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

/usr/local/bin

WorkingDir

string

No

The working directory of the container.

/usr/local/

Image

string

Yes

The container image.

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

Command

array

No

The container startup commands.

string

No

The container startup command.

python3

Arg

array

No

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

string

No

The startup argument.

hello.py

Gpu

integer

No

The number of GPUs used by the container.

1

VolumeMount

array<object>

No

The data volumes mounted to the container.

object

No

The data volumes mounted to the container.

MountPath

string

No

The directory where the volume is mounted.

Note

Data in this directory is overwritten by the volume data. Specify this parameter with caution.

/data

FlexVolumeDriver

string

No

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

FlexVolumeOptions

string

No

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"}

DependsOn

array<object>

No

The dependencies of the serverless job.

object

No

The serverless job dependencies.

JobId

string

No

The ID of the dependent job.

10

Type

string

No

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

RetryStrategy

object

No

The retry policy of the serverless job.

Attempts

integer

No

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

5

EvaluateOnExit

array<object>

No

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

object

No

Action

string

No

The job action. Valid values:

  • Retry: Retries the job when the specified exit code is returned.

  • Exit: Stops the job when the specified exit code is returned.

Retry

OnExitCode

string

No

The exit code that triggers the action specified by Action. Valid values: 0 to 255.

10

Response elements

Element

Type

Description

Example

object

JobId

string

The ID of the serverless job.

10

RequestId

string

The request ID.

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

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParams The specified parameter %s is invalid. The specified parameter %s is invalid.
400 NotEnabled You have not enabled this service You have not enabled this service
400 InDebt Your account has overdue payments. Your account has overdue payments.
500 UnknownError An unknown error occurred. An unknown error occurred.
403 InvalidClusterStatus The operation failed due to invalid cluster status. The cluster status does not support the operation.
403 ConflictOpt A conflicting operation is running. A conflicting operation is running. Please try again later.
404 ClusterNotFound The specified cluster does not exist. The specified instance does not exist.
503 ServiceUnavailable The request has failed due to a temporary failure of the server The request has failed due to a temporary failure of the server.
406 EcsError An error occurred while calling the ECS API operation. ECS API call error. %s
406 DbError A database service error occurred. Database request failed.
406 AliyunError An Alibaba Cloud product error occurred. Alibaba Cloud product error. %s
406 AgentError The agent service request failed: %s Operation unsuccessful: %s
406 ServiceAPIError Failed to call the operation. Cause:%s An error occurred while calling the API. %s
407 NotAuthorized You are not authorized by RAM for this request. The request is not authorized by RAM.
409 PartFailure Part of the batch operation failed. Part of the batch operation failed.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.