This is an implementation to notify status changes of AI Platform training.
Unfortunately, AI Platform training does not support notification of status changes. This module might be helpful until the notification is officially supported.
The architecture is as below:
This Terraform module creates components below:
Component | Description |
---|---|
Log sink | Log sink sends AI Platform logs to Pub/Sub log topic. |
Pub/Sub log topic | This topic receives AI Platform logs via log sink. |
Cloud Storage bucket | This bucket is used to save source code for Cloud Functions. |
Cloud Storage object | This object is archived source code for Cloud Functions. |
Cloud Functions | This function receives AI Platform logs from Pub/Sub log topic, check the job state, and publish a message to the notification topic. |
Pub/Sub notification topic | This topic receives resulting message of AI Platform job state from Cloud Functions. |
The message published to notification topic is as below:
{
"job_id": "<AI Platform training job ID>",
"project_id": "<Your GCP project ID>",
"timestamp": "2020-12-23T21:02:36.069049148Z",
"job_state": "SUCCEEDED"
}
job_state
is QUEUED, SUCCEEDED, CANCELLED, or FAILED.
module "ai_platform_notification" {
source = "git::https://github.com/sfujiwara/terraform-google-ai-platform-notification.git?ref=vX.X.X"
project_id = "your-project-id"
}
This section is automatically generated with terraform-docs.
Name | Description | Type | Default | Required |
---|---|---|---|---|
project_id | Google Cloud Platform project ID. | string |
n/a | yes |
log_topic | Pub/Sub topic name for log sink. | string |
"ai-platform-log" |
no |
notification_topic | Pub/Sub topic name for notification message. | string |
"ai-platform-notification" |
no |
Name | Description |
---|---|
log_topic | Pub/Sub topic name for log sink. |
notification_topic | Pub/Sub topic name for notification message. |