All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::PAIPlugin::InferenceJob

Last Updated:Aug 13, 2024

ALIYUN::PAIPlugin::InferenceJob is used to create a prediction job.

Syntax

{
  "Type": "ALIYUN::PAIPlugin::InferenceJob",
  "Properties": {
    "Algorithm": String,
    "CampaignId": String,
    "DataPath": String,
    "Name": String,
    "TrainingJobId": String,
    "TargetPath": String,
    "UserConfig": Map,
    "Remark": String,
    "WaitForInferenceFinish": Boolean
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Algorithm

String

Yes

No

The ID of the algorithm to be associated.

None.

CampaignId

String

Yes

No

The ID of the operational activity to be associated.

None.

DataPath

String

Yes

No

The path where the data that you want to predict is stored.

None.

Name

String

Yes

No

The name of the prediction job.

None.

TrainingJobId

String

Yes

No

The training job to be associated.

None.

TargetPath

String

Yes

No

The path to which the data is returned.

None.

UserConfig

Map

Yes

No

The user configurations.

None.

Remark

String

No

No

The remarks.

None.

WaitForInferenceFinish

Boolean

No

No

Specifies whether to wait until the prediction job is complete before creating resources.

The maximum waiting time is 40 minutes.

Return values

Fn::GetAtt

  • InferenceJobId: the ID of the prediction job.

  • GroupId: the ID of the associated user group.

Examples

Note

You must change the masked values of properties, such as the CampaignId property, based on your business requirements.

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DataPath:
    Type: String
    Description:
      en: The input data path of inference job.
    Required: true
  TrainingJobId:
    Type: String
    Description:
      en: The training job id of inference job.
    Required: true
  CampaignId:
    Type: String
    Description:
      en: The campaign id of inference job.
    Required: true
  TargetPath:
    Type: String
    Description:
      en: The output result path of inference job.
    Required: true
  UserConfig:
    Type: Json
    Description:
      en: The user config of inference job.
    Required: true
  Algorithm:
    Type: String
    Description:
      en: The algorithm of inference job.
    Required: true
  WaitForInferenceFinish:
    Type: Boolean
    Description:
      en: Whether resource creation waits for the inference task to complete.The longest waiting time is 40 minutes
    Required: false
    Default: true
  Remark:
    Type: String
    Description:
      en: The remark of inference job.
    Required: false
  Name:
    Type: String
    Description:
      en: The name of inference job.
    Required: true
Resources:
  InferenceJob:
    Type: ALIYUN::PAIPlugin::InferenceJob
    Properties:
      DataPath: https://bucket.region.aliyuncs.com/folder/
      TrainingJobId: '123'
      CampaignId: 0a54e195-03e2-40bd-869d-b71cb302****
      TargetPath: https://bucket.region.aliyuncs.com/folder/
      UserConfig: {}
      Algorithm: user_recall
      Name: VIP customers
Outputs:
  InferenceJobId:
    Description: The id of inference job.
    Value:
      Fn::GetAtt:
        - InferenceJob
        - InferenceJobId
  GroupId:
    Description: The related group id of infernce job result.
    Value:
      Fn::GetAtt:
        - InferenceJob
        - GroupId

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DataPath": {
      "Type": "String",
      "Description": {
        "en": "The input data path of inference job."
      },
      "Required": true
    },
    "TrainingJobId": {
      "Type": "String",
      "Description": {
        "en": "The training job id of inference job."
      },
      "Required": true
    },
    "CampaignId": {
      "Type": "String",
      "Description": {
        "en": "The campaign id of inference job."
      },
      "Required": true
    },
    "TargetPath": {
      "Type": "String",
      "Description": {
        "en": "The output result path of inference job."
      },
      "Required": true
    },
    "UserConfig": {
      "Type": "Json",
      "Description": {
        "en": "The user config of inference job."
      },
      "Required": true
    },
    "Algorithm": {
      "Type": "String",
      "Description": {
        "en": "The algorithm of inference job."
      },
      "Required": true
    },
    "WaitForInferenceFinish": {
      "Type": "Boolean",
      "Description": {
        "en": "Whether resource creation waits for the inference task to complete.The longest waiting time is 40 minutes"
      },
      "Required": false,
      "Default": true
    },
    "Remark": {
      "Type": "String",
      "Description": {
        "en": "The remark of inference job."
      },
      "Required": false
    },
    "Name": {
      "Type": "String",
      "Description": {
        "en": "The name of inference job."
      },
      "Required": true
    }
  },
  "Resources": {
    "InferenceJob": {
      "Type": "ALIYUN::PAIPlugin::InferenceJob",
      "Properties": {
        "DataPath": "https://bucket.region.aliyuncs.com/folder/",
        "TrainingJobId": "123",
        "CampaignId": "0a54e195-03e2-40bd-869d-b71cb302****",
        "TargetPath": "https://bucket.region.aliyuncs.com/folder/",
        "UserConfig": {},
        "Algorithm": "user_recall",
        "Name": "VIP customers"
      }
    }
  },
  "Outputs": {
    "InferenceJobId": {
      "Description": "The id of inference job.",
      "Value": {
        "Fn::GetAtt": [
          "InferenceJob",
          "InferenceJobId"
        ]
      }
    },
    "GroupId": {
      "Description": "The related group id of infernce job result.",
      "Value": {
        "Fn::GetAtt": [
          "InferenceJob",
          "GroupId"
        ]
      }
    }
  }
}