All Products
Search
Document Center

Elastic High Performance Computing:SubmitServerlessJob

Last Updated:Apr 09, 2024

Submits a serverless job to the E-HPC cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringYes

The ID of the E-HPC cluster.

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

ehpc-hz-FYUr32****
JobNamestringYes

The name of the serverless job.

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 start 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 that is added to the serverless job container. Unit: GiB.

Note By default, the serverless job container provides 30 GiB of free storage quota. If you require storage of more than 30 GiB, you can use this parameter to specify the temporary storage to add to the job container.
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 VPC networks. You can call the DescribeVSwitches operation to query existing vSwitches.
vsw-bp1gb5gf5546rn****
InstanceTypearrayNo

The ECS instance types used by the serverless job container.

stringNo

The specifications of the ECS instance.

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 for the instance. Valid values:

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

Default value: NoSpot.

SpotWithPriceLimit
SpotPriceLimitfloatNo

The maximum hourly price of the preemptible instance. The value can contain up to three decimal places.

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

0.062
RamRoleNamestringNo

The name of the RAM role that is associated with the serverless job container.

testRamRoleName
ContainerobjectYes

The properties of the serverless job container.

EnvironmentVarobject []No

The environment variable of the container.

ValuestringNo

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

/usr/local/bin
WorkingDirstringNo

The working directory of the container.

/usr/local/
ImagestringYes

The image of the container.

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

The container startup commands.

stringNo

The command that you run to start the container.

python3
ArgarrayNo

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

stringNo

The arguments that are passed to the container startup command.

hello.py
GpuintegerNo

The number of GPUs of the container.

1
VolumeMountobject []No

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. Specify this parameter with caution.
/data
DependsOnobject []No

The serverless job dependencies.

JobIdstringNo

The ID of the dependent job.

10
TypestringNo

The type of the dependency. Valid values:

  • AfterSucceeded: All subtasks of the array job or the dependent job are successfully run. The exit code is 0.
  • AfterFailed: Any subtask of the array job or the dependent job fails. The exit code is not 0.
  • AfterAny: The dependent job completes.
  • AfterCorresponding: The subtasks of the array job is successfully run. The exit code is 0.

Default value: AfterSucceeded.

AfterAny

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.An error occurred while calling the ECS API operation.
406DbErrorA database service error occurred.Database request failed.
406AliyunErrorAn Alibaba Cloud product error occurred.An Alibaba Cloud product error occurred.
406AgentErrorThe agent service request failed: %sThe agent request failed.
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 changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 406
    delete Error Codes: 407
    delete Error Codes: 409
    delete Error Codes: 500
    delete Error Codes: 503
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: RetryStrategy
2023-07-25The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 406 change
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 407
    delete Error Codes: 409
    delete Error Codes: 500
    delete Error Codes: 503
2023-07-21The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 406 change
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 407
    delete Error Codes: 409
    delete Error Codes: 500
    delete Error Codes: 503