Creates a job to run in a cluster. You can specify information such as data source configurations, code source configurations, the start command, and compute resource configuration for each node where the job runs.
Operation description
Before you use this operation, review the billing methods and pricing for PAI-DLC.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
paidlc:CreateJob |
create |
*All Resource
|
None | None |
Request syntax
POST /api/v1/jobs HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body parameters. |
|
| DisplayName |
string |
Yes |
The name of the job. The name must follow these rules:
|
tf-mnist-test |
| JobType |
string |
Yes |
The job type. This parameter is case-sensitive. The supported job types are:
Valid values:
|
TFJob |
| JobSpecs |
array |
Yes |
JobSpecs describes the runtime configurations for the job, such as the registry address, start command, node resource declaration, and number of replicas. A PAI-DLC job consists of different types of nodes. Nodes of the same type have the same configuration. This configuration is called a JobSpec. JobSpecs is an array of JobSpec objects that describes the configurations for all types of nodes. |
|
| JobSpec |
No |
The runtime configuration of the job. |
||
| UserCommand |
string |
Yes |
The start command for all nodes in the job. |
python /root/code/mnist.py |
| DataSources |
array<object> |
No |
The list of data sources used by the job. |
|
|
object |
No |
The list of all data sources that the job uses. Each data source is mounted to a local directory in the container of each node based on the data source configuration. The local directory is specified by the `MountPath` parameter in the data source configuration. The process specified in the start command can then directly access the distributed file system of each data source through its `MountPath`. |
||
| DataSourceId |
string |
No |
The ID of the data source. |
d-cn9dl******* |
| MountPath |
string |
No |
The path to which the data source is mounted for this job. This parameter is optional. By default, the mount path specified in the data source configuration is used. |
/root/data |
| Uri |
string |
No |
The path of the data source. |
oss://bucket.oss-cn-hangzhou-internal.aliyuncs.com/path/ |
| Options |
string |
No |
The mount properties for the custom dataset. Currently, only OSS is supported. |
{ "fs.oss.download.thread.concurrency": "10", "fs.oss.upload.thread.concurrency": "10", "fs.jindo.args": "-oattr_timeout=3 -oentry_timeout=0 -onegative_timeout=0 -oauto_cache -ono_symlink" } |
| DataSourceVersion |
string |
No |
||
| MountAccess |
string |
No |
||
| EnableCache |
boolean |
No |
||
| CodeSource |
object |
No |
The code source for the job. Before the job nodes start, PAI-DLC automatically downloads the code from the specified code source and mounts it to a local directory in the container. |
|
| CodeSourceId |
string |
No |
The code source ID. |
code-20210111103721-xxxxxxx |
| Branch |
string |
No |
The branch of the code repository that the job references. This parameter is optional. By default, the branch specified in the code source configuration is used. |
master |
| Commit |
string |
No |
The commit ID of the code to download for the job. This parameter is optional. By default, the commit ID specified in the code source configuration is used. |
44da109b5****** |
| MountPath |
string |
No |
The path to which the code source is mounted for this job. This parameter is optional. By default, the mount path specified in the code source configuration is used. |
/root/data |
| UserVpc |
object |
No |
The user's VPC configuration. |
|
| VpcId |
string |
No |
The ID of the user's VPC. |
vpc-abcdef**** |
| SwitchId |
string |
No |
The ID of the vSwitch. This parameter is optional.
|
vs-abcdef**** |
| SecurityGroupId |
string |
No |
The ID of the security group. |
sg-abcdef**** |
| ExtendedCIDRs |
array |
No |
The extended CIDR blocks.
|
|
|
string |
No |
An extended CIDR block. |
192.168.0.1/24 |
|
| DefaultRoute |
string |
No |
The default route. Valid values:
|
eth0 |
| ThirdpartyLibs |
array |
No |
The list of third-party Python libraries to install. |
|
|
string |
No |
Specify a third-party Python library and its version requirements, for example: |
numpy==1.16.1 |
|
| ThirdpartyLibDir |
string |
No |
The name of the folder that contains the `requirements.txt` file for third-party Python libraries. Before PAI-DLC runs the specified `UserCommand` on each node, it retrieves the `requirements.txt` file from this folder and runs the |
/root/code/ |
| Envs |
object |
No |
The environment variable configuration. |
|
|
string |
No |
An environment variable in the Important The environment variable must comply with POSIX standards. |
ENABLE_DEBUG_MODE |
|
| JobMaxRunningTimeMinutes |
integer |
No |
The maximum running time of the job in minutes. |
1024 |
| WorkspaceId |
string |
No |
The workspace ID. |
ws-20210126170216-xxxxxxx |
| ResourceId |
string |
No |
The ID of the resource group. This parameter is optional.
|
rs-xxx |
| Priority |
integer |
No |
The priority of the job. This parameter is optional. The default value is 1. The value can be an integer from 1 to 9. A larger value indicates a higher priority.
|
8 |
| Settings | JobSettings |
No |
Additional parameter settings for the job. |
|
| ElasticSpec |
JobElasticSpec |
No |
This parameter is not supported. You can ignore it. |
|
| DebuggerConfigContent |
string |
No |
This parameter is not supported. You can ignore it. |
“” |
| Options |
string |
No |
Additional configurations for the job. Use this parameter to adjust the behavior of mounted data sources. For example, if the job has an OSS data source mounted, you can set this parameter to |
key1=value1,key2=value2 |
| SuccessPolicy |
string |
No |
The success policy for a distributed multi-node job. This is currently supported only for multi-node TensorFlow jobs.
|
AllWorkers |
| CredentialConfig |
CredentialConfig |
No |
The access credential configuration. |
|
| Accessibility |
string |
No |
The visibility of the job. Valid values:
|
PRIVATE |
| CustomEnvs |
array<object> |
No |
||
|
object |
No |
|||
| Key |
string |
No |
||
| Value |
string |
No |
||
| Visible |
string |
No |
||
| TemplateId |
string |
No |
The ID of the job template. |
tplabc1234567 |
| TemplateVersion |
integer |
No |
The version of the job template. |
1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response is a string in the JSON format. |
||
| JobId |
string |
The ID of the job created by this call. |
dlc7******* |
| RequestId |
string |
The ID of the request. It is used for diagnostics and support. |
473469C7-AA6F-4DC5-B3DB-xxxxxxx |
Examples
Success response
JSON format
{
"JobId": "dlc7*******",
"RequestId": "473469C7-AA6F-4DC5-B3DB-xxxxxxx"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.