Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::PAIDLC::Job

Última atualização: Jun 27, 2026

Cria um job do Platform for AI (PAI) para execução em um cluster.

Sintaxe

{
  "Type": "ALIYUN::PAIDLC::Job",
  "Properties": {
    "ThirdpartyLibs": List,
    "Options": String,
    "Priority": Integer,
    "Envs": String,
    "JobMaxRunningTimeMinutes": Integer,
    "WorkspaceId": String,
    "CodeSource": Map,
    "UserVpc": Map,
    "JobSpecs": List,
    "UserCommand": String,
    "DataSources": List,
    "JobType": String,
    "ResourceId": String,
    "ThirdpartyLibDir": String,
    "DisplayName": String,
    "SuccessPolicy": String,
    "Settings": Map
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

ThirdpartyLibs

List

Não

Não

Biblioteca Python de terceiros e sua versão.

Exemplo: numpy==1.16.1.

Options

String

Não

Não

Configurações adicionais do job.

Ajusta o comportamento da fonte de dados anexada. Por exemplo, se a fonte de dados for do tipo Object Storage Service (OSS), adicione as seguintes configurações para substituir os parâmetros padrão do JindoFS: fs.oss.download.thread.concurrency=4,fs.oss.download.queue.size=16.

Priority

Integer

Não

Sim

Prioridade do job.

Valor padrão: 1.

Valores válidos: 1 a 9. Cada valor indica uma prioridade diferente:

  • 1 é a menor prioridade.

  • 9 é a maior prioridade.

Envs

String

Não

Não

Configurações de variáveis de ambiente.

Nenhuma.

JobMaxRunningTimeMinutes

Integer

Não

Não

Duração máxima de execução do job.

Unidade: minutos.

WorkspaceId

String

Sim

Não

ID do workspace.

Nenhuma.

CodeSource

Map

Não

Não

Fonte de código do job.

Antes que o nó do job inicie, o Deep Learning Containers (DLC) baixa automaticamente o código da source especificada e o monta no caminho local do contêiner. Para obter mais informações, consulte Propriedades de CodeSource.

UserVpc

Map

Não

Não

Configurações da Virtual Private Cloud (vpc) do usuário.

Para obter mais informações, consulte Sintaxe de UserVpc.

JobSpecs

List

Sim

Não

Configurações de execução do job.

Para obter mais informações, consulte Propriedades de JobSpecs.

UserCommand

String

Sim

Não

Comando de inicialização para todos os nós do job.

Nenhuma.

DataSources

List

Não

Não

Todas as fontes de dados do job.

Cada fonte de dados é montada no caminho local do contêiner em cada nó, conforme a configuração. A propriedade MountPath em DataSources define o caminho local.

O comando de inicialização acessa o sistema de arquivos distribuído no caminho especificado por MountPath. Cada fonte de dados representa um sistema de arquivos distribuído.

Para obter mais informações, consulte Propriedades de DataSources.

JobType

String

Sim

Não

Tipo do job.

O valor diferencia maiúsculas de minúsculas. Tipos de job suportados:

  • TFJob

  • PyTorchJob

  • XGBoostJob

  • OneFlowJob

  • ElasticBatch

ResourceId

String

Não

Não

ID do grupo de recursos ao qual o job pertence.

Esta propriedade é opcional.

  • Se esta propriedade estiver vazia, o job será adicionado a um grupo de recursos público.

  • Se o workspace do job estiver associado a um grupo de recursos dedicado, defina o valor como o ID desse grupo. Para obter mais informações sobre como criar e consultar o ID de um grupo de recursos dedicado, consulte Criar um grupo de recursos e adquirir recursos de computação geral.

ThirdpartyLibDir

String

Não

Não

Nome da pasta onde reside o arquivo requirements.txt da biblioteca Python de terceiros.

Antes que cada nó execute o comando de inicialização especificado por UserCommand, o DLC obtém o arquivo requirements.txt da pasta e executa pip install -r para instalar os pacotes e bibliotecas necessários.

DisplayName

String

Sim

Não

Nome do job.

O nome deve atender aos seguintes requisitos:

  • Pode ter até 256 caracteres.

  • Pode conter dígitos, letras, sublinhados (_), pontos (.) e hífens (-).

SuccessPolicy

String

Não

Não

Política para determinar se um job distribuído multinó foi bem-sucedido.

Suportado apenas para jobs distribuídos multinó do TensorFlow.

Valores válidos:

  • ChiefWorker: com esta política, o job é considerado bem-sucedido quando o pod no nó chief conclui as operações.

  • AllWorkers (padrão): com esta política, o job é considerado bem-sucedido quando todos os nós worker concluem as operações.

Settings

Map

Não

Não

Configurações de parâmetros adicionais do job.

Nenhuma.

Sintaxe de CodeSource

"CodeSource": {
  "MountPath": String,
  "Commit": String,
  "Branch": String,
  "CodeSourceId": String
}

Propriedades de CodeSource

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

MountPath

String

Não

Não

Caminho onde o job será montado.

Por padrão, utiliza-se o caminho de montagem configurado na fonte de dados.

Commit

String

Não

Não

ID do commit do código a ser baixado para o job.

Por padrão, utiliza-se o ID do commit configurado na source de código.

Branch

String

Não

Não

Branch do repositório de código usada durante a execução do job.

Por padrão, utiliza-se a branch configurada na source de código.

CodeSourceId

String

Sim

Não

ID da source de código.

Nenhuma.

Sintaxe de UserVpc

"UserVpc": {
  "VpcId": String,
  "SecurityGroupId": String,
  "SwitchId": String,
  "ExtendedCIDRs": List
}

Propriedades de UserVpc

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

VpcId

String

Sim

Não

ID da vpc.

Nenhuma.

SecurityGroupId

String

Não

Não

ID do grupo de segurança.

Nenhuma.

SwitchId

String

Não

Não

ID do vSwitch.

Esta propriedade é opcional.

  • Se deixada vazia, o sistema seleciona automaticamente um vSwitch com base na disponibilidade de estoque.

  • Também é possível especificar um ID de vSwitch.

ExtendedCIDRs

List

Não

Não

Blocos CIDR estendidos.

Valores válidos:

  • Se SwitchId e ExtendedCIDRs estiverem vazios, o sistema obtém automaticamente todos os blocos CIDR na vpc especificada.

  • Ao especificar SwitchId, é obrigatório definir ExtendedCIDRs. Recomendamos especificar todos os blocos CIDR da vpc.

Sintaxe de JobSpecs

"JobSpecs": [
  {
    "PodCount": Integer,
    "ImageConfig": Map,
    "UseSpotInstance": Boolean,
    "Type": String,
    "EcsSpec": String,
    "ResourceConfig": Map,
    "Image": String,
    "ExtraPodSpec": Map
  }
]

Propriedades de JobSpecs

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

PodCount

Integer

Sim

Não

Número de réplicas.

Nenhuma.

ImageConfig

Map

Não

Não

Configurações de imagem privada.

Nenhuma.

UseSpotInstance

Boolean

Sim

Não

Define se instâncias preemptíveis serão utilizadas.

Valores válidos:

  • true

  • false

Type

String

Sim

Não

Tipo de nó.

Type está diretamente relacionado a JobType. Os valores válidos de Type variam conforme o valor de JobType:

  • Valores válidos quando JobType é TFJob: Chief, PS, Worker, Evaluator e GraphLearn.

  • Valores válidos quando JobType é PyTorchJob: Worker e Master.

  • Valores válidos quando JobType é XGBoostJob: Worker e Master.

O nó master para jobs PyTorch ou XGBoost é opcional. Caso não seja especificado, o sistema utiliza automaticamente o primeiro nó worker como master.

EcsSpec

String

Sim

Não

Especificações da instância do Elastic Compute Service (ECS) para o nó worker.

O preço varia conforme as especificações da instância. Para obter mais informações, consulte Faturamento do DLC.

ResourceConfig

Map

Não

Não

Configurações de recursos.

Nenhuma.

Image

String

Sim

Não

Endereço da imagem para o nó worker.

Chame a operação ListImages para consultar imagens da comunidade e imagens otimizadas pelo PAI. Imagens públicas de terceiros também são suportadas.

ExtraPodSpec

Map

Não

Não

Configurações adicionais do pod.

Nenhuma.

Sintaxe de DataSources

"DataSources": [
  {
    "MountPath": String,
    "DataSourceId": String
  }
]

Propriedades de DataSources

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

MountPath

String

Não

Não

Caminho onde o job será montado.

Por padrão, utiliza-se o caminho de montagem configurado na fonte de dados.

DataSourceId

String

Sim

Não

ID da fonte de dados.

Nenhuma.

Valores de retorno

Fn::GetAtt

JobId: o ID do job.

Exemplos

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      CodeSource:
        Description: The code source used in this task. Before the mission node starts,
          the DLC will automatically download the code configured in the code source,
          and mount to the local directory of the container.
        Type: Json
      DataSources:
        Description: List of data source used for task operation.
        Type: Json
      DisplayName:
        Description: 'The name of the task is as follows:
    
          The name length does not exceed 256 characters.
    
          Allow numbers, letters, lower strokes (_), English period (.) And short horizontal
          lines (-).'
        Type: String
      Envs:
        Description: Environment variable configuration.
        Type: String
      JobMaxRunningTimeMinutes:
        Description: The longest running time is running, and the unit is minutes.
        Type: Number
      JobSpecs:
        Description: 'Jobspecs describes various configurations of tasks during the mission,
          such as mirror address, start command, node resource statement, number of copies,
          etc.
    
          The DLC task consists of different types of nodes. The same type of nodes have
          exactly the same configuration. This configuration is called a Jobspec. Jobspecs
          describes the configuration of all types of nodes and is the array of Jobspec.'
        Type: Json
      JobType:
        AllowedValues:
        - TFJob
        - PyTorchJob
        - XGBoostJob
        - OneFlowJob
        - ElasticBatch
        Description: 'The type of job. Values: TFJob, PyTorchJob, XGBoostJob, OneFlowJob,
          ElasticBatch'
        Type: String
      Options:
        Description: The additional configuration of this task can adjust some of the
          behavior of the mounting data source through this parameter. If the task has
          a data source that mounted the OSS type, you can cover the default parameters
          of the jinofs by configure the configuration of this parameter to fs.OSS.DOWNLOAD.CONCURRENCY
          = 4, fs.oss.download.queue.size = 16.
        Type: String
      Priority:
        Description: 'The priority of the task, optional parameter, default value 1, the
          range of parameter values is 1 ~ 9.in:
    
          1 is the minimum priority.
    
          9 is the highest priority.'
        Type: Number
      ResourceId:
        Description: 'Resource group ID, optional parameter.
    
          The parameter value is empty indicating that submitted to the public resource
          group.
    
          If the current working space has been bound to a proprietary resource group,
          you can specify the corresponding resource group ID here; how to create a proprietary
          resource group and inquire about the proprietary resource group ID, please refer
          to the preparation and management of the DLC resource group cluster.'
        Type: String
      Settings:
        Description: Job settings.
        Type: Json
      SuccessPolicy:
        Description: 'The successful strategy of distributed multi -machine tasks is currently
          only supported by TensorFlow''s multi -machine task.
    
          ChiefWorker: When it is specified as this value, as long as the Chief''s POD
          is successful, it is considered that the entire task is successful.
    
          All workers: All workers must be successful to think that the entire task is
          successful.'
        Type: String
      ThirdpartyLibDir:
        Description: The name folder of the Requirements.txt file is located; before each
          node runs the specified usercommand, PAI -DLC will take the requirements.txt
          file from the specified folder and call the PIP Install -R installation.
        Type: String
      ThirdpartyLibs:
        Description: Python third-party library list to be installed.
        Type: Json
      UserCommand:
        Description: Start commands of all nodes in the task.
        Type: String
      UserVpc:
        Description: User VPC configuration.
        Type: Json
      WorkspaceId:
        Description: Work space ID, how to get working space ID, see listworkSpaces.
        Type: String
    Resources:
      Job:
        Properties:
          CodeSource:
            Ref: CodeSource
          DataSources:
            Ref: DataSources
          DisplayName:
            Ref: DisplayName
          Envs:
            Ref: Envs
          JobMaxRunningTimeMinutes:
            Ref: JobMaxRunningTimeMinutes
          JobSpecs:
            Ref: JobSpecs
          JobType:
            Ref: JobType
          Options:
            Ref: Options
          Priority:
            Ref: Priority
          ResourceId:
            Ref: ResourceId
          Settings:
            Ref: Settings
          SuccessPolicy:
            Ref: SuccessPolicy
          ThirdpartyLibDir:
            Ref: ThirdpartyLibDir
          ThirdpartyLibs:
            Ref: ThirdpartyLibs
          UserCommand:
            Ref: UserCommand
          UserVpc:
            Ref: UserVpc
          WorkspaceId:
            Ref: WorkspaceId
        Type: ALIYUN::PAIDLC::Job
    Outputs:
      JobId:
        Description: The task ID created this time.
        Value:
          Fn::GetAtt:
          - Job
          - JobId
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ThirdpartyLibs": {
          "Type": "Json",
          "Description": "Python third-party library list to be installed."
        },
        "Options": {
          "Type": "String",
          "Description": "The additional configuration of this task can adjust some of the behavior of the mounting data source through this parameter. If the task has a data source that mounted the OSS type, you can cover the default parameters of the jinofs by configure the configuration of this parameter to fs.OSS.DOWNLOAD.CONCURRENCY = 4, fs.oss.download.queue.size = 16."
        },
        "Priority": {
          "Type": "Number",
          "Description": "The priority of the task, optional parameter, default value 1, the range of parameter values is 1 ~ 9.in:\n1 is the minimum priority.\n9 is the highest priority."
        },
        "Envs": {
          "Type": "String",
          "Description": "Environment variable configuration."
        },
        "JobMaxRunningTimeMinutes": {
          "Type": "Number",
          "Description": "The longest running time is running, and the unit is minutes."
        },
        "WorkspaceId": {
          "Type": "String",
          "Description": "Work space ID, how to get working space ID, see listworkSpaces."
        },
        "CodeSource": {
          "Type": "Json",
          "Description": "The code source used in this task. Before the mission node starts, the DLC will automatically download the code configured in the code source, and mount to the local directory of the container."
        },
        "UserVpc": {
          "Type": "Json",
          "Description": "User VPC configuration."
        },
        "JobSpecs": {
          "Type": "Json",
          "Description": "Jobspecs describes various configurations of tasks during the mission, such as mirror address, start command, node resource statement, number of copies, etc.\nThe DLC task consists of different types of nodes. The same type of nodes have exactly the same configuration. This configuration is called a Jobspec. Jobspecs describes the configuration of all types of nodes and is the array of Jobspec."
        },
        "UserCommand": {
          "Type": "String",
          "Description": "Start commands of all nodes in the task."
        },
        "DataSources": {
          "Type": "Json",
          "Description": "List of data source used for task operation."
        },
        "JobType": {
          "Type": "String",
          "Description": "The type of job. Values: TFJob, PyTorchJob, XGBoostJob, OneFlowJob, ElasticBatch",
          "AllowedValues": [
            "TFJob",
            "PyTorchJob",
            "XGBoostJob",
            "OneFlowJob",
            "ElasticBatch"
          ]
        },
        "ResourceId": {
          "Type": "String",
          "Description": "Resource group ID, optional parameter.\nThe parameter value is empty indicating that submitted to the public resource group.\nIf the current working space has been bound to a proprietary resource group, you can specify the corresponding resource group ID here; how to create a proprietary resource group and inquire about the proprietary resource group ID, please refer to the preparation and management of the DLC resource group cluster."
        },
        "ThirdpartyLibDir": {
          "Type": "String",
          "Description": "The name folder of the Requirements.txt file is located; before each node runs the specified usercommand, PAI -DLC will take the requirements.txt file from the specified folder and call the PIP Install -R installation."
        },
        "DisplayName": {
          "Type": "String",
          "Description": "The name of the task is as follows:\nThe name length does not exceed 256 characters.\nAllow numbers, letters, lower strokes (_), English period (.) And short horizontal lines (-)."
        },
        "SuccessPolicy": {
          "Type": "String",
          "Description": "The successful strategy of distributed multi -machine tasks is currently only supported by TensorFlow's multi -machine task.\nChiefWorker: When it is specified as this value, as long as the Chief's POD is successful, it is considered that the entire task is successful.\nAll workers: All workers must be successful to think that the entire task is successful."
        },
        "Settings": {
          "Type": "Json",
          "Description": "Job settings."
        }
      },
      "Resources": {
        "Job": {
          "Type": "ALIYUN::PAIDLC::Job",
          "Properties": {
            "ThirdpartyLibs": {
              "Ref": "ThirdpartyLibs"
            },
            "Options": {
              "Ref": "Options"
            },
            "Priority": {
              "Ref": "Priority"
            },
            "Envs": {
              "Ref": "Envs"
            },
            "JobMaxRunningTimeMinutes": {
              "Ref": "JobMaxRunningTimeMinutes"
            },
            "WorkspaceId": {
              "Ref": "WorkspaceId"
            },
            "CodeSource": {
              "Ref": "CodeSource"
            },
            "UserVpc": {
              "Ref": "UserVpc"
            },
            "JobSpecs": {
              "Ref": "JobSpecs"
            },
            "UserCommand": {
              "Ref": "UserCommand"
            },
            "DataSources": {
              "Ref": "DataSources"
            },
            "JobType": {
              "Ref": "JobType"
            },
            "ResourceId": {
              "Ref": "ResourceId"
            },
            "ThirdpartyLibDir": {
              "Ref": "ThirdpartyLibDir"
            },
            "DisplayName": {
              "Ref": "DisplayName"
            },
            "SuccessPolicy": {
              "Ref": "SuccessPolicy"
            },
            "Settings": {
              "Ref": "Settings"
            }
          }
        }
      },
      "Outputs": {
        "JobId": {
          "Description": "The task ID created this time.",
          "Value": {
            "Fn::GetAtt": [
              "Job",
              "JobId"
            ]
          }
        }
      }
    }