实验设置说明和要求
保护您的账号和进度。请务必在无痕浏览器窗口中,使用实验凭证运行此实验。

CI/CD for a TFX pipeline

实验 2 个小时 universal_currency_alt 5 个点数 show_chart 入门级
info 此实验可能会提供 AI 工具来支持您学习。
此内容尚未针对移动设备进行优化。
为获得最佳体验,请在桌面设备上访问通过电子邮件发送的链接。

Overview

In this lab, you will walk through authoring a Cloud Build CI/CD workflow that automatically builds and deploys the same TFX pipeline from lab-02.ipynb. You will also integrate your workflow with GitHub by setting up a trigger that starts the workflow when a new tag is applied to the GitHub repo hosting the pipeline's code.

Objectives

  • Develop a CI/CD workflow with Cloud Build to build and deploy a machine learning pipeline.
  • Integrate with Github to trigger workflows with pipeline source repository changes.

Setup

For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.

  1. Sign in to Google Skills using an incognito window.

  2. Note the lab's access time (for example, 1:15:00), and make sure you can finish within that time.
    There is no pause feature. You can restart if needed, but you have to start at the beginning.

  3. When ready, click Start lab.

  4. Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.

  5. Click Open Google Console.

  6. Click Use another account and copy/paste credentials for this lab into the prompts.
    If you use other credentials, you'll receive errors or incur charges.

  7. Accept the terms and skip the recovery resource page.

Task 1. Create an instance of AI Platform Pipelines

In this task, you deploy Kubeflow Pipelines as a Kuberenetes App, which are solutions with simple click to deploy to Google Kubernetes Engine and that have the flexibility to deploy to Kubernetes clusters on-premises or in third-party clouds. You will see Kubeflow Pipelines integrated into your Google Cloud environment as AI Platform Pipelines. If interested, learn more about Kubeflow Pipelines in the Introduction documentation during installation steps.

  1. In the Google Cloud Console, enter AI Platform in the top search bar. Click on the result for AI Platform under Marketplace.

  2. Click on the Go To AI Platform.

  3. Navigate to AI Platform > Pipelines.

  4. Then click New Instance.

The New Instance button highlighted on the AI Platform Pipelines page

  1. Click Configure.

The Configure button highlighted in the Kubeflow Pipelines diaog box

  1. To create cluster select Zone as then check Allow access to the following Cloud APIs, leave the name as is, and then click Create New Cluster.
Note: The cluster creation will take 3 - 5 minutes. You need to wait until this step completes before you proceed to the next step.
  1. Scroll to the bottom of the page, accept the marketplace terms, and click Deploy. You will see the individual services of KFP deployed to your GKE cluster. Wait for the deployment to finish before proceeding to the next task.

  2. In Cloud Shell, run the following to configure kubectl command line access

gcloud container clusters get-credentials cluster-1 --zone {{{project_0.default_zone|place_holder_text}}} --project {{{project_0.project_id|place_holder_text}}}
  1. In Cloud Shell, run the following to get the ENDPOINT of your KFP deployment
kubectl describe configmap inverse-proxy-config | grep googleusercontent.com Important: In a later task, you will need to set the endpoint for your KFP in one of the cells in your notebook. Remember to use the above output as your ENDPOINT.

Click Check my progress to verify the objective. Create an instance of AI Platform Pipelines

Task 2. Access AI Platform Notebooks

To launch AI Platform Notebooks:

  1. Click on the Navigation Menu and navigate to AI Platform, then to Workbench.

  2. You should see tfx-on-googlecloud notebook preprovisioned for you. If not, wait a few minutes and refresh the page.

  3. Click Open JupyterLab. A JupyterLab window will open in a new tab.

Task 3. Clone the example repo within your AI Platform Notebooks instance

To clone the mlops-on-gcp notebook in your JupyterLab instance:

  1. In JupyterLab, click the Terminal icon to open a new terminal.

  2. At the command-line prompt, type in the following command and press Enter:

    git clone https://github.com/GoogleCloudPlatform/mlops-on-gcp Note: If the cloned repo does not appear in the JupyterLab UI, you can use the top line menu and under Git > Clone a repository, clone the repo (https://github.com/GoogleCloudPlatform/mlops-on-gcp) using the UI.

    Clone Repo dialog

  3. Confirm that you have cloned the repository by double clicking on the mlops-on-gcp directory and ensuring that you can see its contents. The files for all the Jupyter notebook-based labs throughout this course are available in this directory.

Navigate to the example notebook

  1. In the JupyterLab, open a terminal and execute the following commands:
cd mlops-on-gcp/workshops/tfx-caip-tf23 ./install.sh
  1. Now, in AI Platform Notebooks, navigate to mlops-on-gcp/workshops/tfx-caip-tf23/lab-03-tfx-cicd/labs and open lab-03.ipynb.

  2. Clear all the cells in the notebook (look for the Clear button on the notebook toolbar) and then Run the cells one by one.

  3. When prompted, come back to these instructions to check your progress.

If you need more help, you may take a look at the complete solution by navigating to mlops-on-gcp/workshops/tfx-caip-tf23/lab-03-tfx-cicd/solutions open lab-03.ipynb.

Task 4. Run your training job in the cloud

Test completed tasks

Click Check my progress to verify the objective. Build the image and push it to your project's Container Registry

Test completed task

Click Check my progress to verify the objective. Manually trigger CI/CD runs

Test completed tasks

Click Check my progress to verify the objective. Create a cloud build trigger

Test completed tasks

Click Check my progress to verify the objective. Trigger the build

Congratulations!

In this lab, you walked through authoring a Cloud Build CI/CD workflow that automatically builds and deploys a TFX pipeline. You also integrated your TFX workflow with GitHub by setting up a Cloud Build trigger. In the next lab, you will walk through inspection of TFX metadata and pipeline artifacts created during TFX pipeline runs.

End your lab

When you have completed your lab, click End Lab. Google Skills removes the resources you’ve used and cleans the account for you.

You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.

The number of stars indicates the following:

  • 1 star = Very dissatisfied
  • 2 stars = Dissatisfied
  • 3 stars = Neutral
  • 4 stars = Satisfied
  • 5 stars = Very satisfied

You can close the dialog box if you don't want to provide feedback.

For feedback, suggestions, or corrections, please use the Support tab.

Copyright 2026 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.

准备工作

  1. 实验会创建一个 Google Cloud 项目和一些资源,供您使用限定的一段时间
  2. 实验有时间限制,并且没有暂停功能。如果您中途结束实验,则必须重新开始。
  3. 在屏幕左上角,点击开始实验即可开始

使用无痕浏览模式

  1. 复制系统为实验提供的用户名密码
  2. 在无痕浏览模式下,点击打开控制台

登录控制台

  1. 使用您的实验凭证登录。使用其他凭证可能会导致错误或产生费用。
  2. 接受条款,并跳过恢复资源页面
  3. 除非您已完成此实验或想要重新开始,否则请勿点击结束实验,因为点击后系统会清除您的工作并移除该项目

此内容目前不可用

一旦可用,我们会通过电子邮件告知您

太好了!

一旦可用,我们会通过电子邮件告知您

一次一个实验

确认结束所有现有实验并开始此实验

使用无痕浏览模式运行实验

使用无痕模式或无痕浏览器窗口是运行此实验的最佳方式。这可以避免您的个人账号与学生账号之间发生冲突,这种冲突可能导致您的个人账号产生额外费用。