Skip to content

Latest commit

 

History

History
130 lines (76 loc) · 3.32 KB

Module-06-Author-CloudFunction-For-Vertex-AI-Pipeline.md

File metadata and controls

130 lines (76 loc) · 3.32 KB

About Module 6

In this module we will create a Cloud Function that executes a Vertex AI pipeline on-demand based off of a pipeline JSON in GCS. This module takes 15 minutes to review, and almost an hour to run.

1. Where we are in the model training lifecycle

M6


2. The lab environment

M6


3. The exercise

M6


4. Dependencies

  1. Successful testing of pipeline template JSON
  2. Customized Vertex AI Spark ML model training template JSON in GCS

We completed #1 in the prior module. #2 is already available for you in GCS.

M6


5. Documentation for scheduling Vertex AI pipelines

Read the documentation for scheduling Vertex AI pipelines ahead of working on the next step to better understand on-demand execution through a simpler example than the one in the lab.
https://cloud.google.com/vertex-ai/docs/pipelines/schedule-cloud-scheduler


6. Cloud Function deployment pictorial overview

The Cloud Function is already deployed in your environment. The folowing is the author's deployment from the Terraform script. Yours should be identical.

M6


M6


M6


M6


M6


M6


M6


7. Review of the Cloud Function code for executing the Vertex AI Spark ML Model Training Pipeline

7.1. What is happening inside the function?

M6


7.2. Runtime variables

M6


M6


7.3. Source code - requirements.txt

The latest requirements.txt is avialable here-
https://github.com/anagha-google/s8s-spark-mlops-lab/blob/main/02-scripts/cloud-functions/requirements.txt

7.4. Source code - main.py

The latest source code is avialable here-
https://github.com/anagha-google/s8s-spark-mlops-lab/blob/main/02-scripts/cloud-functions/main.py


8. Execute the Cloud Function and monitor for pipeline execution through completion

The Cloud Function is generation 2 and does not have a "click to test" button feature yet. We need to grab the command line execution from the UI and run it in Cloud Shell.

8.1. Grab the command for executing the Cloud Function

M6


8.2. Run the command in Cloud Shell

M6


8.3. Monitor the Vertex AI pipeline for any errors

M6


8.4. Monitor the Dataproc Batches UI for new jobs

Follow at least a couple steps through completion.

M6


M6


8.5. Monitor the overall completion of the pipeline execution

M6



This concludes the module. In the next module, we will create a Cloud Scheduler job for time based execution of the model training pipeline.