Google Professional Machine Learning Engineer Question 165
Select 2Google Cloud PlatformYou are building a CI/CD pipeline for a machine learning project hosted on Google Cloud. The codebase for the project is stored in a Git repository hosted on GitHub. You want to integrate the repository with Google Cloud services to automate model training and deployment whenever new changes are pushed to the repository. Which steps should you take to achieve this integration?
- A
Set up a Cloud Build trigger that listens for changes in your GitHub repository.
- B
Use Google Cloud Source Repositories to mirror the GitHub repository and integrate with Cloud Build.
- C
Configure a GitHub Actions workflow to directly invoke Google Cloud Deployment Manager.
- D
Enable the Container Registry API to store built Docker images for your model.
- E
Grant the Cloud Build service account the necessary IAM roles to access resources like Artifact Registry and Cloud Storage.
Show answer and explanation
Correct answers: A, E
Explanation
To integrate GitHub with Google Cloud for automating CI/CD workflows, you should set up Cloud Build triggers to listen for repository changes and grant the Cloud Build service account appropriate IAM permissions to manage Google Cloud resources. These steps form the foundation for automating tasks like model training and deployment. Mirroring the repository or using other CI/CD tools like GitHub Actions is not necessary as Cloud Build natively supports GitHub integration.
- A. Correct.
Correct: Cloud Build triggers allow you to listen for changes in external repositories like GitHub. This is essential for automating workflows.
- B. Incorrect.
Incorrect: While Cloud Source Repositories can mirror GitHub repositories, this step is unnecessary as Cloud Build can directly integrate with GitHub without requiring mirroring.
- C. Incorrect.
Incorrect: Although GitHub Actions can be used to invoke Google Cloud services, this approach is not standard or recommended when using Cloud Build, which is designed for this purpose.
- D. Incorrect.
Incorrect: While enabling Container Registry API is useful for storing Docker images, it is not directly relevant to integrating source code repositories with Google Cloud.
- E. Correct.
Correct: Granting IAM roles to the Cloud Build service account ensures it has the necessary permissions to interact with Google Cloud resources like Artifact Registry or Cloud Storage during the CI/CD process.