Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

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

License

Notifications You must be signed in to change notification settings

swvl/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 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.

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_id = "your-project-id"
}

Terraform Docs

This section is automatically generated with terraform-docs.

Inputs

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

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

Languages

  • Python 66.1%
  • HCL 29.6%
  • Shell 2.6%
  • Handlebars 1.7%