CreateJob
Creates an E-HPC Instant job.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ehpc:CreateJob |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| JobName |
string |
Yes |
The job name. The name must be 2 to 64 characters in length and can contain letters, Chinese characters, and digits. It can also contain hyphens (-) and underscores (_). |
testjob |
| JobDescription |
string |
No |
The job description. |
Demo |
| Tasks |
array<object> |
Yes |
The list of tasks. Only one task is supported. |
|
|
array<object> |
No |
The task details. |
||
| ExecutorPolicy |
object |
No |
The task execution policy. |
|
| ArraySpec |
object |
No |
The array job details. The index values of sub-jobs are passed to the runtime environment through environment variables and can be referenced by your business programs. The environment variables include:
|
|
| 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. |
9 |
| IndexStart |
integer |
No |
The start value of the array job index. Valid values: 0 to 4999. |
0 |
| IndexStep |
integer |
No |
The step of the array job index. Note
If the array job attributes are IndexStart=1, IndexEnd=5, and IndexStep=2, the array job includes three sub-jobs with the index values of 1, 3, and 5. Your business programs can access these values through environment variables. |
1 |
| MaxCount |
integer |
No |
The maximum number of nodes on which the job can run. Note
The value must meet the following formula: |
1 |
| TaskName |
string |
No |
The task name. The name must be 2 to 32 characters in length and can contain letters, Chinese characters, and digits. It can also contain hyphens (-) and underscores (_). |
task0 |
| TaskSpec |
object |
No |
The task specification details. |
|
| Resource |
object |
No |
The resource information of the runtime environment. |
|
| Cores |
number |
No |
The number of CPUs in the runtime environment. |
2 |
| Disks |
array<object> |
No |
The cloud disk array. |
|
|
object |
No |
The cloud disk array. |
||
| Size |
integer |
No |
The size of the cloud disk. Unit: GiB. |
40 |
| Type |
string |
No |
The cloud disk type. Only System is supported, which indicates a system cloud disk. |
System |
| EnableHT |
boolean |
No |
Specifies whether to enable hyper-threading in the runtime environment. Default value: true. |
true |
| HostNamePrefix |
string |
No |
The hostname prefix of the runtime environment. The limits are as follows:
|
compute |
| InstanceTypes |
array |
No |
The instance types of the runtime environment. Up to five instance types are supported. |
|
|
string |
No |
The instance type of the runtime environment. Note
This parameter takes effect only when the |
ecs.c7a.8xlarge |
|
| Memory |
number |
No |
The memory size of the runtime environment. Unit: GiB. |
4 |
| RetryPolicy |
object |
No |
The task retry policy. |
|
| ExitCodeActions |
array<object> |
No |
The retry rules. Up to 10 rules are supported. |
|
|
object |
No |
The retry rule. |
||
| Action |
string |
Yes |
The next action of the task.
|
Retry |
| ExitCode |
integer |
Yes |
The task exit code, which is used together with Action to form the job retry rule. Valid values: 0 to 255. |
1 |
| RetryCount |
integer |
No |
The number of retries. Valid values: 1 to 10. Default value: 3. |
5 |
| TaskExecutor |
array<object> |
Yes |
The task execution configuration. |
|
|
array<object> |
No |
The task execution configuration. |
||
| Container |
object |
No |
The container environment. |
|
| AppId |
string |
No |
The container application ID. |
ci-vm-32k6LXAi3cOG |
| Arg |
array |
No |
The arguments for the container startup command. Up to 10 arguments are supported. |
|
|
string |
No |
The argument for the container startup command. |
60s |
|
| Command |
array |
No |
The list of container startup commands. Up to 20 commands are supported, and each command can be up to 256 characters in length. Note
|
|
|
string |
No |
The content of the container startup command. Each command can contain up to 256 characters. |
sleep |
|
| EnvironmentVars |
array<object> |
No |
The environment variables of the container. Up to 20 environment variables are supported. |
|
|
object |
No |
The environment variable of the container. |
||
| Name |
string |
No |
The name of the environment variable. The name must be 1 to 128 characters in length and can contain letters, digits, and underscores (_). It cannot start with a digit. |
PATH |
| Value |
string |
No |
The value of the environment variable. The value must be 0 to 256 characters in length. |
/usr/local/bin |
| GpuDriverVersion |
string |
No |
Specifies the GPU driver version. |
tesla=535 |
| Image |
string |
Yes |
The container image. |
registry-vpc.cn-hangzhou.aliyuncs.com/ehpc/hpl:latest |
| ImageRegistryOptions |
string |
No |
The mount parameters for a self-managed image registry. The parameters are in key-value pairs and passed in JSON format.
|
{"ImageRegistryType":"https","ImageRegistryServer":"xxx","ImageRegistryUserName":"xxx","ImageRegistryPassword":"xxx"} |
| Privileged |
boolean |
No |
Specifies whether to run the container in privileged mode. Default value: false. |
true |
| WorkingDir |
string |
No |
The working directory of the container. |
/usr/local/ |
| VM |
object |
No |
The virtual machine environment. |
|
| AppId |
string |
No |
The virtual machine application ID. |
ci-vm-9jc58Pm5Leky |
| EnvironmentVars |
array<object> |
No |
The environment variables of the virtual machine. |
|
|
object |
No |
The environment variables of the virtual machine. |
||
| Name |
string |
No |
The name of the environment variable. |
PATH |
| Value |
string |
No |
The value of the environment variable. |
/usr/local/bin |
| Image |
string |
Yes |
The image ID. |
m-xxxx |
| Password |
string |
No |
The logon password for the virtual machine environment. The password must be 8 to 30 characters in length and must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include: ()`~!@#$%^&*-_+=|{}[]:;'<>,.?/ In a Windows environment, the password cannot start with a forward slash (/). Note
If you specify the Password parameter, use HTTPS to send requests to prevent password leaks. |
EHPC@1234 |
| PrologScript |
string |
No |
The pre-processing script. The script must be Base64-encoded. |
ZWNobyBoZWxsbyBlY3Mh |
| Script |
string |
No |
The job execution script. The script must be Base64-encoded. |
ZWNobyBoZWxsbyBlY3Mh |
| VolumeMount |
array<object> |
No |
The list of data volumes mounted to the task. Up to 10 data volumes are supported. |
|
|
object |
No |
The data volume mounted to the task. |
||
| MountOptions |
string |
No |
The mount parameters for the data volume. The parameters are in key-value pairs and passed in JSON format.
Note
server indicates the mount target address of the NAS file system; path indicates the subdirectory under the NAS path, which must start with / and must already exist; vers indicates the NFS protocol version used to mount the NAS file system, and v3 is recommended; options indicates the custom parameters used when mounting the NAS file system, in the format of "xxx,xxx,xxx".
Note
bucket indicates the name of the OSS bucket; url indicates the endpoint of the OSS bucket, which can be obtained on the Overview page of the bucket in the OSS console; path indicates the directory structure relative to the root directory of the bucket when mounting, which defaults to / and must already exist; akId indicates the AccessKey ID used for direct authorization with an AccessKey pair; akSecret indicates the AccessKey secret used for direct authorization with an AccessKey pair. |
{"server":"xxxxx-xxxxx.cn-heyuan.nas.aliyuncs.com","vers":"3","path":"/data","options":"nolock,tcp,noresvport"} |
| MountPath |
string |
No |
The directory where the data volume is mounted to the task. Note
The content in the mount directory will be directly overwritten by the content of the volume. Use this parameter with caution. |
/mnt |
| ReadOnly |
boolean |
No |
Specifies whether the data volume is read-only. Default value: false. |
false |
| VolumeDriver |
string |
No |
The supported data volume types.
|
alicloud/nas |
| TaskSustainable |
boolean |
No |
Specifies whether the job runs for a long time.
Default value: false. Valid values:
|
true |
| DeploymentPolicy |
object |
No |
The resource deployment policy. |
|
| AllocationSpec |
string |
No |
The resource type.
|
Dedicated |
| Level |
string |
No |
The computing power level. This parameter is valid only when the resource type is Economic. Valid values:
Default value: General. |
General |
| Network |
object |
No |
The network configuration information. |
|
| EnableExternalIpAddress |
boolean |
No |
Specifies whether to create a public IP address for the job.
Default value: false. Valid values:
|
true |
| Vswitch |
array |
No |
The vSwitch array. |
|
|
string |
No |
The vSwitch ID. |
vsw-xxxx |
|
| Pool |
string |
No |
The job resource pool. |
compute |
| Priority |
integer |
No |
The job priority. A larger value indicates a higher scheduling priority for the job. Valid values: 1 to 100. |
1 |
| Tag |
array<object> |
No |
The tags of the job. You can specify up to 20 tags. |
|
|
object |
No |
The tag of the job. |
||
| Key |
string |
Yes |
The tag key. If you specify this parameter, it cannot be an empty string. The tag key can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://. |
TestKey |
| Value |
string |
No |
The tag value. If you specify this parameter, it can be an empty string. The tag value can be up to 128 characters in length and cannot contain http:// or https://. |
TestValue |
| SecurityPolicy |
object |
No |
The type of the job scheduler. Valid values:
Default value: HPC. |
HPC |
| SecurityGroup |
object |
No |
The security group. |
|
| SecurityGroupIds |
array |
No |
The security group IDs. |
|
|
string |
No |
The security group ID. |
sg-xxxxxxxxxxxxxxx |
|
| DependencyPolicy |
object |
No |
The security policy. |
|
| JobDependency |
array<object> |
No |
The job dependencies. You can specify up to 10 dependencies. |
|
|
object |
No |
The job dependency. |
||
| JobId |
string |
Yes |
The job ID. |
job-bjxxxxxxxxxxxx |
| Type |
string |
No |
The dependency type. Valid values:
Valid values:
|
AfterSucceeded |
| JobTemplateId |
string |
No |
The dependency policy. |
jt-xxxx |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| JobId |
string |
The job ID. |
job-xxxx |
| RequestId |
string |
The request ID. |
896D338C-E4F4-41EC-A154-D605E5DE**** |
| Tasks |
array<object> |
The list of tasks. |
|
|
object |
The task details. |
||
| ExecutorIds |
array |
The list of executor IDs included in the task. |
|
|
string |
The executor ID. The format is JobId-TaskName-ArrayIndex. |
[\"job-xxxx-task0_11-2\"] |
|
| TaskName |
string |
The task name. |
task0 |
Examples
Success response
JSON format
{
"JobId": "job-xxxx",
"RequestId": "896D338C-E4F4-41EC-A154-D605E5DE****",
"Tasks": [
{
"ExecutorIds": [
"[\\\"job-xxxx-task0_11-2\\\"]"
],
"TaskName": "task0"
}
]
}
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 | InDebt | Your account has overdue payments. | Your account has overdue payments. |
| 400 | NotEnabled | You have not enabled this service. | You have not enabled this service |
| 403 | GetResourceFailed | Failed to get resource. | Failed to get resource |
| 403 | RecommendEmpty.InstanceTypeSoldOut | The resource is out of stock. | Resources are sold out |
| 403 | DuplicateTagKey | Duplicate tag key exists: %s. | Duplicate tag key exists. |
| 403 | PoolNotFound | The specified pool was not found. | Resource pool does not exist |
| 403 | PoolStatusInvalid | The specified pool in invalid status. | Invalid Resource Pool Status |
| 403 | QuotaExceeded.PrivateIpAddress | Insufficient private IP addresses in vSwitch: %s. | |
| 403 | SecurityGroupInstanceLimitExceed | The maximum number of instances in a security group is exceeded. | The number of instances in the security group has reached the maximum limit. |
| 403 | QuotaExceeded.Resource | Insufficient resource quota. | Insufficient resource quota |
| 403 | QuotaExceeded.Executor | Insufficient pool executor quota. | The resource pool execution node quota is insufficient. |
| 404 | ImageNotFound | The specified image does not exist. | The specified image does not exist. Please verify the parameter. |
| 404 | SecurityGroupNotExists | The security group does not exist. | The security group does not exist. |
| 404 | JobTemplateNotFound | The specified job template is not found. | The specified job template does not exist. |
| 406 | AliyunError | An Alibaba Cloud product error occurred. | Alibaba Cloud product error. %s |
| 406 | EcsError | An error occurred while calling the ECS API operation. | An error occurred while calling the ECS API operation. |
| 406 | DbError | A database error occurred. | A database error occurred. |
| 406 | TagError | Tag operation error. | Tag operation error. |
| 407 | NotAuthorized | No authorization is granted. | No authorization is granted. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.