Skip to content

sfujiwara/terraform-google-ai-platform-notification

Repository files navigation

AI Platform Notification

GitHub Actions License: MIT Code style: black

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.

Architecture

The architecture is as below:

This Terraform module creates resources below:

Resources 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.

Message

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.

Usage

module "ai_platform_notification" {
  source  = "git::https://github.com/sfujiwara/terraform-google-ai-platform-notification.git?ref=vX.X.X"
  project = "your-project-id"
}

Terraform Docs

This section is automatically generated with terraform-docs.

Inputs

Name Description Type Default Required
project Google Cloud Platform project ID. string n/a yes
region Region of Cloud Functions and Cloud Storage bucket. 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

Outputs

Name Description
log_topic Pub/Sub topic name for log sink.
notification_topic Pub/Sub topic name for notification message.

About

Terraform module to notify status changes in Google AI Platform jobs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published