PAI workspace event notification configuration

更新时间:
复制 MD 格式

Use event notifications to track and monitor the status of DLC jobs, Flow tasks, and DSW instances, or to automatically trigger downstream operations when the status of a model version changes.

1. Activate EventBridge and grant permissions (one-time setup)

Before you create your first notification rule, you must activate EventBridge and configure the required permissions.

To access the configuration page, go to Workspace Details, select the target PAI workspace, and then click Workspace Configurations > Configure Event Notification in the upper-right corner.

1.1 Activate EventBridge

On the Event Notification Configuration tab, click Activate for Free to go to the EventBridge activation page. For more information, see Activate EventBridge.

After activation, PAI automatically creates a custom event bus for each PAI workspace. The event bus is named pai-system-${workspace_name}. You can go to the EventBridge console, switch to the target region, and view and manage your custom event buses.

1.2 Grant PAI access to cloud resources

Click Authorize Now. The system automatically creates the AliyunServiceRoleForPAIWorkspace service-linked role. This role authorizes PAI to access your cloud resources. For more information about this role, see Appendix: PAI workspace service-linked role.

In the One-Click Authorization dialog box, click Authorize.

1.3 (Optional) RAM user permissions for event configuration

If you use a RAM user for configuration, you must grant that user permissions to manage EventBridge.

Create a custom policy and attach it to the RAM user. The policy content is as follows:

{
  "Statement": [{
    "Effect": "Allow",
    "Action": [
      "eventbridge:CreateEventBus",
      "eventbridge:GetEventBus",
      "eventbridge:DeleteEventBus",
      "eventbridge:ListEventBuses",
      "eventbridge:CreateRule",
      "eventbridge:GetRule",
      "eventbridge:UpdateRule",
      "eventbridge:EnableRule",
      "eventbridge:DisableRule",
      "eventbridge:DeleteRule",
      "eventbridge:ListRules",
      "eventbridge:PutEvents",
      "eventbridge:UpdateTargets",
      "eventbridge:DeleteTargets",
      "eventbridge:ListTargets"
    ],
    "Resource": "acs:eventbridge:*:*:eventbus/*"
  }],
  "Version": "1"
}

2. Create an event rule

After the initial setup, go to Workspace Details. Select your target PAI workspace, then go to Workspace Configurations > Configure Event Notification and click Create Event Rule.

In the Create Event Rule panel, enter a Rule Name and Rule Description (up to 256 characters), and then configure the event type, event scope, and event target.

2.1 Configure event type

Select the event source and the specific event types that you want to monitor.

  • Flow task: Monitor the status of Designer Flow tasks. Event types include:

    • Task failure.

    • Task completion (successful or failed).

  • DLC job: Monitor the lifecycle events of a DLC job. You can select multiple event types. Event types include:

    • Job progress (for example, Queued, Bidding Started, Running, or Failed).

    • Automatic fault tolerance.

    • Job timeout (a timeout rule must be configured in scheduling configuration).

    • Other events (for example, job preempted or job manually stopped).

  • Model: Monitor the status changes of a model version in AI Asset Management. Event types include:

    • Model version approved for deployment (status changes from Pending to Approved).

    • Model version status change (approved or rejected for deployment).

  • DSW instance: Monitor the status changes of a DSW instance and its saved images. You can select multiple event types. Event types include:

    • Instance status change (for example, Creating or Instance Failed).

    • Image saving (for example, Saving Image, Image Saved Successfully, or Image Save Failed).

    • Instance shutdown (for example, Instance Stopped or Stopping).

2.2 Configure event targets

Configure how and where to deliver notifications when an event occurs.

  • DingTalk notification: Configure the webhook and the signing key. For more information, see Appendix: Obtain the webhook and signing key. After configuration, you can click Test Connectivity to verify the setup.

  • WeCom notification: Configure the webhook URL for WeCom messages.

  • Lark notification: Configure the webhook URL for a custom Lark bot.

  • HTTP/HTTPS: Automatically calls a specified URL when the status of a model version changes. This target applies only to Model event types, and your receiving API must parse the request according to the specified template.

  • Voice call, text message, and email: Notifies specified contacts. This method is not applicable to Model event types. If no contacts are available for selection, you must first complete the message receiving settings.

Important

The default quota is 5 event targets per rule. If you require a higher quota, you can request a quota increase (a maximum of 100 is recommended). When you configure voice calls, text messages, or emails, each added contact consumes one quota unit. Contacts are counted cumulatively and are not deduplicated. For example, if you add Alice and Tony as text message contacts and Alice and Alan as email contacts, this consumes four quota units.

FAQ

Q: I see a ServiceNotEnable error when I open the event notification configuration page. What does this mean?

This error indicates that the EventBridge service has not been activated. You must first activate EventBridge.

Appendix: Webhook and signing key

  1. In the DingTalk group where you want to receive notifications, open the group bot settings.

    Click the settings icon in the upper-right corner of the group chat window, click Bots on the Group Settings panel, and then click Add Robot on the bot management panel.

  2. In the bot list, add a custom bot.

    Select Custom (Connect to custom services by using a webhook) and then click Add.

  3. In the Add Robot dialog box, configure the security settings and copy the signing key.

    Important

    Save the signing key for later use.

    Enter a Bot Name. In the Security Settings section, select the Sign checkbox, click Copy, select the I have read and agree... checkbox, and then click Finished.

  4. Copy the webhook URL and complete the configuration.

    Important

    Save the webhook URL for later use.

    To prevent security risks, do not expose this webhook URL on external websites.

When you create an event rule in the event notification configuration, use the signing key from Step 3 for the signing key parameter and the webhook URL from Step 4 for the webhook parameter.