调用SubmitJob在指定集群提交作业。
接口说明
接口说明
在集群提交作业前,请确认上传作业文件(如 job.sh)到集群。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ehpc:SubmitJob |
create |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| ClusterId |
string |
是 |
集群 ID。 您可以通过调用 ListClusters 获取集群 ID。 |
ehpc-hz-FYUr32**** |
| CommandLine |
string |
是 |
执行作业命令。 |
./LammpsTest/lammps.pbs |
| RunasUser |
string |
是 |
执行作业的用户名。 您可以通过调用 ListUsers 获取该集群中的用户名。 |
testuser |
| RunasUserPassword |
string |
否 |
用户密码。 |
12**** |
| Name |
string |
否 |
作业名称。长度为 6~30 个字符,必须以英文字母开头,可以包含数字、半角句号(.)。 |
jobtest |
| Priority |
integer |
否 |
作业优先级,取值范围:0~9,取值越大,优先级越高。 默认值:0 |
0 |
| PackagePath |
string |
否 |
执行作业路径。 |
./Tem |
| StdoutRedirectPath |
string |
否 |
标准输出路径。 |
./LammpsTest |
| StderrRedirectPath |
string |
否 |
错误输出路径。 |
./LammpsTest |
| ReRunable |
boolean |
否 |
是否支持重新执行作业。取值范围:
|
false |
| ArrayRequest |
string |
否 |
队列作业。 格式 X-Y:Z, 最小值 X 是第一个索引,最大值 Y 是最后一个索引,Z 表示步长,例如 2-7:2,表示作业队列包含编号为 2、4、6 的 3 个子作业。 |
1-10:2 |
| Variables |
string |
否 |
执行作业的环境变量,可以在作业执行文件中访问环境变量。 |
[{Name:test1,Value:value1},{Name:test2,Value:value2}] |
| InputFileUrl |
string |
否 |
上传到 OSS 的作业文件的 URL 地址。 |
https://ehpc-hangzhou.oss-cn-hangzhou.aliyuncs.com/test-u4****/testlist_ehpc.sh |
| UnzipCmd |
string |
否 |
解压命令。解压 OSS 下载的文件。取值范围:
|
tar xzf |
| PostCmdLine |
string |
否 |
提交作业后执行的命令。 |
example.sh |
| JobQueue |
string |
否 |
执行作业的队列名称。 您可以通过调用 ListQueues 获取队列名称。 |
workq |
| Node |
integer |
否 |
执行作业所需的计算节点数。 说明
若该参数为空,则参数 Cpu、Task、Thread、Mem、Gpu 不生效。 |
2 |
| Cpu |
integer |
否 |
单个计算节点所需的 CPU 核数。 |
2 |
| Task |
integer |
否 |
单个计算节点创建的进程数。 适用于 MPI 作业。 |
2 |
| Thread |
integer |
否 |
单个计算节点创建的线程数。 适用于 OpenMP 作业。 |
1 |
| Mem |
string |
否 |
单个计算节点最大使用内存数,支持 GB、MB、KB,单位不区分大小写。 |
1GB |
| Gpu |
integer |
否 |
单个计算节点使用 GPU 的数量。 仅支持使用 PBS 调度器的集群,且集群内计算节点含 GPU 时该参数生效。 |
1 |
| ClockTime |
string |
否 |
作业最大运行时间,支持三种格式:
推荐使用第一种格式。若最大运行时间为 12 小时,示例:12:00:00。 |
12:00:00 |
| JobRetry.Count |
integer |
否 |
任务重试次数,取值范围 1~10。当前任务重试功能仅适用于 PBS 集群。 说明
若该参数为空,则参数 JobRetry.Priority、JobRetry.OnExitCode 不生效。 |
5 |
| JobRetry.Priority |
integer |
否 |
重试作业优先级,取值范围:0~9,取值越大,优先级越高。 说明
若该参数为空,则重试作业优先级=min{原作业优先级+1, 9} |
1 |
| JobRetry.OnExitCode |
integer |
否 |
作业重试条件。退出码为参数值时,触发作业重试。 说明
若该参数为空,退出码非 0 时触发作业重试。 |
1 |
| Async |
boolean |
否 |
采用异步消息链路提交作业。 默认值:false。 |
false |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| JobId |
string |
作业 ID。 |
1.manager |
| RequestId |
string |
请求 ID。 |
04F0F334-1335-436C-A1D7-6C044FE7**** |
示例
正常返回示例
JSON格式
{
"JobId": "1.manager",
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE7****"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidParams | The specified parameter %s is invalid. | 指定的参数 %s 无效。 |
| 400 | NotEnabled | You have not enabled this service | 您的账户还未开通此服务 |
| 400 | InDebt | Your account has overdue payments. | 您的账户已欠费 |
| 500 | UnknownError | An unknown error occurred. | 未知错误 |
| 403 | InvalidClusterStatus | The operation failed due to invalid cluster status. | 集群状态不允许执行本次操作。 |
| 403 | ConflictOpt | A conflicting operation is running. | 有冲突的操作在执行中,请您稍后再试。 |
| 403 | UsernameExist | The username already exists. | 用户名已存在 |
| 403 | IncorrectCredential | The username or password is incorrect. | 用户名或密码错误 |
| 403 | AgentError.Account.ValidateCredentialFailure | Username or password verification failed. | 用户名或密码验证失败 |
| 404 | ClusterNotFound | The specified cluster does not exist. | 指定的集群不存在,请您检查该参数是否正确。 |
| 404 | ContainerNotFound | The specified container does not exist. | 指定的容器应用不存在 |
| 404 | ManagerNotFound | The manager nodes do not exist or their status is abnormal. | 管理节点不存在或状态异常。 |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server | 请求失败,服务暂时不可用 |
| 406 | AgentError.Job.SubmitFailure | Failed to submit jobs: %s | 提交作业失败: {%s} |
| 406 | AgentError.Job.InvalidContainerType | Unsupported container type: %s. | 无效容器类型:%s |
| 406 | AliyunError | An Alibaba Cloud product error occurred. | 阿里云产品错误。%s |
| 406 | AgentError.Account.AccountValidateCredentialFailure | Cannot get user info | 无法获取用户信息 |
| 406 | AgentResponseTimeout | Agent response timeout: %s | 代理响应超时 |
| 406 | AgentError | The agent service request failed: %s | 操作未成功:%s |
| 407 | NotAuthorized | You are not authorized by RAM for this request. | 此请求未获得RAM授权 |
| 409 | PartFailure | Part of the batch operation failed. | 批量操作部分失败 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。