GetJob - 获取任务详情

获取一个任务的详细配置和运行时信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称类型必填描述示例值
JobIdstring

任务ID。如何获取任务ID,请参见ListJobs

dlc*******

返回参数

名称类型描述示例值
object

JSON格式的字符串。

JobIdstring

任务ID。

dlc*******
JobTypestring

任务类型。由CreateJob API中的JobType指定。

TFJob
DisplayNamestring

任务名称。

tf-mnist-test
UserIdstring

任务提交人的阿里云UID。

12*********
Statusstring

任务运行状态,可能值:

  • Created
  • Creating
  • Queuing
  • Dequeued
  • Running
  • Stopping
  • Succeeded
  • Failed
  • Stopped
Stopped
WorkspaceIdstring

任务所属工作空间ID。

268
WorkspaceNamestring

任务所属工作空间名称。

dlc-workspace
ResourceIdstring

任务运行所在的资源组ID。

r******
ResourceLevelstring

任务运行时使用的资源级别。

L0
ReasonCodestring

状态详情码,对当前状态(Status)下的子状态的一个分类。

JobStoppedByUser
ReasonMessagestring

状态详情的详细描述。

Job is stopped by user.
JobSpecsarray

任务中的节点配置,参考CreateJob API中的JobSpecs

JobSpec

描述一种节点类型的详细配置。

UserCommandstring

每个节点的启动命令。

python /root/code/mnist.py
DataSourcesarray

数据源列表。

object

数据源。

DataSourceIdstring

数据源ID。

d*******
MountPathstring

本地挂载路径,可选参数,默认为空(表示使用数据源中挂载路径)。

/mnt/data/
CodeSourceobject

代码源。

CodeSourceIdstring

代码源ID。

code******
Branchstring

代码分支。

master
Commitstring

代码CommitID。

44da109b59f8596152987eaa8f3b2487xxxxxx
MountPathstring

本地挂载路径。

/mnt/data
ThirdpartyLibsarray

需要安装的Python三方库列表。

string

第三方Python库。

numpy==1.16.1
ThirdpartyLibDirstring

三方库(requirements.txt)文件所在文件夹。

/root/code/
Envsobject

环境变量配置。

string

环境变量Key和Value。

ENABLE_DEBUG_MODE
GmtCreateTimestring

任务创建时间(UTC)。

2021-01-12T14:35:01Z
GmtSubmittedTimestring

任务提交到集群的时间(UTC)。

2021-01-12T14:36:01Z
GmtRunningTimestring

任务开始运行的时间(UTC)。

2021-01-12T14:36:21Z
GmtSuccessedTimestring

任务正常结束的时间(UTC)。

2021-01-12T15:36:08Z
GmtStoppedTimestring

任务停止的时间(UTC)。

2021-01-12T15:36:08Z
GmtFailedTimestring

任务运行失败的时间(UTC)。

2021-01-12T15:36:08Z
GmtFinishTimestring

任务结束时间(UTC)。

2021-01-12T15:36:08Z
Durationlong

任务运行时长,单位:秒。

3602
Podsarray

任务运行中的所有节点。

object

节点数组。

Typestring

节点类型,与CreateJob中的JobSpecs中的某个JobSpec对应。

Worker
PodIdstring

节点ID,可用于GetPodLogs和GetPodEvents API获取节点的详细日志和事件。

Worker
PodUidstring

Pod UID。

fe846462-af2c-4521-bd6f-96787a57591d
Statusstring

节点状态。可能值:

  • Pending
  • Running
  • Succeeded
  • Failed
  • Unknown
Running
Ipstring

节点的网络IP地址。

10.0.1.2
GmtCreateTimestring

Pod创建时间(UTC)。

2021-01-12T14:36:01Z
GmtStartTimestring

节点启动时间(UTC)。

2021-01-12T14:36:01Z
GmtFinishTimestring

节点结束时间(UTC)。

2021-01-12T15:36:05Z
HistoryPodsarray

历史Pods。

object

历史Pod数组。

Typestring

Pod类型。

Worker
PodIdstring

Pod ID。

Worker
PodUidstring

Pod UID。

fe846462-af2c-4521-bd6f-96787a57591d
Statusstring

Pod状态。

Failed
Ipstring

Pod IP。

10.0.1.3
GmtCreateTimestring

Pod创建时间(UTC)。

2021-01-12T14:36:01Z
GmtStartTimestring

Pod启动时间(UTC)。

2021-01-12T14:36:01Z
GmtFinishTimestring

Pod结束时间(UTC)。

2021-01-12T14:36:01Z
SubStatusstring

Pod子状态,例如抢占状态。取值如下:

  • Normal
  • Evicted
Normal
ResourceTypestring

Pod资源使用类型。

Normal
SubStatusstring

Pod子状态,例如抢占状态。取值如下:

  • Normal
  • Evicted
Normal
ResourceTypestring

Pod资源使用类型。

Normal
RequestIdstring

请求ID,用于诊断和答疑。

473469C7-AA6F-4DC5-B3DB-xxxxxxxx
SettingsJobSettings

作业额外参数配置。

ClusterIdstring

集群ID。

a*****
ElasticSpecJobElasticSpec

弹性任务参数。

EnabledDebuggerboolean

是否开启debugger任务。

false
Priorityinteger

任务的优先级。可能值为1~9。

1
SubStatusstring

作业子状态,例如抢占重试状态。

Restarting
RestartTimesstring

作业已使用的重试次数和最大重试次数。

0/10

示例

正常返回示例

JSON格式

{
  "JobId": "dlc*******",
  "JobType": "TFJob",
  "DisplayName": "tf-mnist-test",
  "UserId": "12*********",
  "Status": "Stopped",
  "WorkspaceId": "268",
  "WorkspaceName": "dlc-workspace",
  "ResourceId": "r******",
  "ResourceLevel": "L0",
  "ReasonCode": "JobStoppedByUser",
  "ReasonMessage": "Job is stopped by user.",
  "JobSpecs": [
    {
      "Type": "Worker",
      "Image": "registry-vpc.cn-hangzhou.aliyuncs.com/cloud-dsw/tensorflow:1.12PAI-gpu-py36-cu101-ubuntu18.04",
      "ImageConfig": {
        "DockerRegistry": "docker****registry.com",
        "Username": " username",
        "Password": "password",
        "Auth": ""
      },
      "PodCount": 1,
      "EcsSpec": "ecs.c6.large",
      "ExtraPodSpec": {
        "SideCarContainers": [
          {
            "Name": "data-init",
            "Image": "registry.cn-hangzhou.aliyuncs.com/pai-dlc/curl:v1.0.0",
            "Command": [
              "curl www.aliyun.com"
            ],
            "Args": [
              ""
            ],
            "WorkingDir": "/root",
            "Env": [
              {
                "Name": "ENABLE_DEBUG",
                "Value": "true"
              }
            ],
            "Resources": {
              "Limits": {
                "key": "{'cpu': '1', 'memory': '1000Mi'}"
              },
              "Requests": {
                "key": "{'cpu': '1', 'memory': '1000Mi'}"
              }
            }
          }
        ],
        "InitContainers": [
          {
            "Name": "data-init",
            "Image": "registry.cn-hangzhou.aliyuncs.com/pai-dlc/curl:v1.0.0",
            "Command": [
              "curl www.aliyun.com"
            ],
            "Args": [
              ""
            ],
            "WorkingDir": "/root",
            "Env": [
              {
                "Name": "ENABLE_DEBUG",
                "Value": "true"
              }
            ],
            "Resources": {
              "Limits": {
                "key": "{'cpu': '1', 'memory': '1000Mi'}"
              },
              "Requests": {
                "key": "{'cpu': '1', 'memory': '1000Mi'}"
              }
            }
          }
        ],
        "PodLabels": {
          "key": ""
        },
        "PodAnnotations": {
          "key": ""
        },
        "SharedVolumeMountPaths": [
          "/root/share/"
        ]
      },
      "ResourceConfig": {
        "CPU": "10",
        "GPU": "3",
        "Memory": "10Gi",
        "SharedMemory": "5Gi",
        "GPUType": "Tesla-V100-16G"
      },
      "UseSpotInstance": false
    }
  ],
  "UserCommand": "python /root/code/mnist.py",
  "DataSources": [
    {
      "DataSourceId": "d*******",
      "MountPath": "/mnt/data/"
    }
  ],
  "CodeSource": {
    "CodeSourceId": "code******",
    "Branch": "master",
    "Commit": "44da109b59f8596152987eaa8f3b2487xxxxxx",
    "MountPath": "/mnt/data"
  },
  "ThirdpartyLibs": [
    "numpy==1.16.1"
  ],
  "ThirdpartyLibDir": "/root/code/",
  "Envs": {
    "key": "ENABLE_DEBUG_MODE"
  },
  "GmtCreateTime": "2021-01-12T14:35:01Z",
  "GmtSubmittedTime": "2021-01-12T14:36:01Z",
  "GmtRunningTime": "2021-01-12T14:36:21Z",
  "GmtSuccessedTime": "2021-01-12T15:36:08Z",
  "GmtStoppedTime": "2021-01-12T15:36:08Z",
  "GmtFailedTime": "2021-01-12T15:36:08Z",
  "GmtFinishTime": "2021-01-12T15:36:08Z",
  "Duration": 3602,
  "Pods": [
    {
      "Type": "Worker",
      "PodId": "Worker",
      "PodUid": "fe846462-af2c-4521-bd6f-96787a57591d",
      "Status": "Running",
      "Ip": "10.0.1.2",
      "GmtCreateTime": "2021-01-12T14:36:01Z",
      "GmtStartTime": "2021-01-12T14:36:01Z",
      "GmtFinishTime": "2021-01-12T15:36:05Z",
      "HistoryPods": [
        {
          "Type": "Worker",
          "PodId": "Worker",
          "PodUid": "fe846462-af2c-4521-bd6f-96787a57591d",
          "Status": "Failed",
          "Ip": "10.0.1.3",
          "GmtCreateTime": "2021-01-12T14:36:01Z",
          "GmtStartTime": "2021-01-12T14:36:01Z",
          "GmtFinishTime": "2021-01-12T14:36:01Z",
          "SubStatus": "Normal",
          "ResourceType": "Normal"
        }
      ],
      "SubStatus": "Normal",
      "ResourceType": "Normal"
    }
  ],
  "RequestId": "473469C7-AA6F-4DC5-B3DB-xxxxxxxx",
  "Settings": {
    "BusinessUserId": "16****",
    "Caller": "SilkFlow",
    "Tags": {
      "key": ""
    },
    "PipelineId": "pid-123456",
    "EnableTideResource": true,
    "EnableErrorMonitoringInAIMaster": false,
    "ErrorMonitoringArgs": "--enable-log-hang-detection true",
    "EnableRDMA": true,
    "EnableOssAppend": true,
    "OversoldType": "AcceptQuotaOverSold",
    "AdvancedSettings": {
      "test": "test",
      "test2": 1
    }
  },
  "ClusterId": "a*****",
  "ElasticSpec": {
    "EnableElasticTraining": true,
    "MinParallelism": 1,
    "MaxParallelism": 8,
    "AIMasterType": "",
    "AIMasterDockerImage": "",
    "EnablePsJobElasticWorker": true,
    "EnableAIMaster": true
  },
  "EnabledDebugger": false,
  "Priority": 1,
  "SubStatus": "Restarting",
  "RestartTimes": "0/10"
}

错误码

访问错误中心查看更多错误码。

阿里云首页 机器学习 相关技术圈