arrow_back

[DEPRECATED] CI/CD for a KFP pipeline

登录 加入
访问 700 多个实验和课程

[DEPRECATED] CI/CD for a KFP pipeline

实验 2 个小时 universal_currency_alt 5 个积分 show_chart 入门级
info 此实验可能会提供 AI 工具来支持您学习。
访问 700 多个实验和课程

Overview

In this lab, you will walk through the authoring of a Cloud Build CI/CD workflow that automatically builds and deploys a Kubeflow Pipeline (KFP). 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

  • Create a custom Cloud Build builder to pilote AI Platform Pipelines

  • Write a Cloud Build config file to build and push all the artifacts for a KFP

  • Setup a Cloud Build Github trigger to rebuild the KFP

Task 0: Setup

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

  1. Make sure you signed into Qwiklabs using an incognito window.

  2. Note the lab's access time (for example, img/time.png and make sure you can finish in that time block.

  1. When ready, click img/start_lab.png.

  2. Note your lab credentials. You will use them to sign in to the Google Cloud Console. img/open_google_console.png

  3. Click Open Google Console.

  4. Click Use another account and copy/paste credentials for this lab into the prompts.

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

Task 1: Create an instance of AI Platform Pipelines

  1. From the Navigation menu, scroll down to AI Platform and pin the section for easier access later in the lab.

ai_platform_pin.png

  1. Click Pipelines.

pipelines_button.png

  1. Then click New Instance.

new_pipelines_instance

  1. Click Configure.

kfp_configure_button.png

  1. Check Allow access to the following Cloud APIs, leave the name as is, and then click Create Cluster.

create_cluster.png

This should take 5-10 minutes to complete. Wait for the cluster to finish before proceeding to the next step. In the first tab opened, you can view the Cluster Creation taking place in the GKE section of the Cloud Console, or see the individual VMs spinning up in the GCE section of the Cloud Console.

  1. When the cluster creation is complete, check the Terms of Service box, leave other settings unchanged, and then click Deploy. You will see the individual services of KFP deployed to your GKE cluster. Proceed to the next step while installation occurs.

kfp_deploy.png

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

Task 2: Access AI Platform Notebook

An instance of AI Platform Notebooks is used as a primary experimentation/development workbench. The instance is configured using a TensorFlow 2.3 Enterprise image.

In this lab, the AI Notebook instance is created for you at lab start time. Note: It will take approximately 5-10 minutes after starting the lab for the notebook instance to appear in AI Platform Notebooks. Wait for the instance to become available before proceeding.

Click Check my progress to verify the objective. Wait for instance of AI Platform Notebooks

Task 3: Clone the mlops-on-gcp repo within your AI Platform Notebooks instance

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

Step 1

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

Open Terminal

Step 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

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

mlops-on-gcp1

Navigate to the mlops-on-gcp notebook

Step 1

In the notebook interface, navigate to mlops-on-gcp > workshops > kfp-caip-sklearn > lab-03-kfp-cicd > exercises and open lab-03.ipynb.

Step 2

In the notebook interface, click on Edit > Clear All Outputs (click on Edit, then in the drop-down menu, select Clear All Outputs).

Carefully read through the notebook instructions and fill in lines marked with #TO DO where you need to complete the code as needed

Tip: To run the current cell you can click the cell and hit shift+enter. Other cell commands are found in the notebook UI under Run.

  • Hints may also be provided for the tasks to guide you along. Highlight the text to read the hints (they are in white text).

  • If you need more help, you may take a look at the complete solution by navigating to mlops-on-gcp > workshops > kfp-caip-sklearn > lab-03-kfp-cicd and opening lab-03.ipynb.

Congratulations!

In this lab, you've learned how to work with Cloud Build CI/CD workflow that automatically builds and deploys a KFP.

End your lab

When you have completed your lab, click End Lab. Qwiklabs 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.

©2021 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. 除非您已完成此实验或想要重新开始,否则请勿点击结束实验,因为点击后系统会清除您的工作并移除该项目

此内容目前不可用

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

太好了!

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

一次一个实验

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

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

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