Question 38
Domain 5You've created a Vertex AI ML pipeline that involves preprocessing and training stages, and each of these stages operates within distinct custom Docker images. Within your organization, GitHub and GitHub Actions are employed for continuous integration and continuous deployment (CI/CD) to perform unit and integration tests. To automate the model retraining process, you seek a workflow that can be triggered manually and automatically whenever new code is merged into the main branch. Your goal is to streamline the workflow while maintaining flexibility. How should you set up and configure the CI/CD workflow to achieve this?
Correct answer: C
Explanation
GitHub Actions can be configured to run on both a manual trigger and a push to the main branch, which matches the need to "be triggered manually and automatically whenever new code is merged into the main branch." Building and pushing the stage-specific Docker images to Artifact Registry then lets Vertex AI Pipelines use those custom images for preprocessing and training.
Why each option is right or wrong
A. Trigger a Cloud Build workflow to run tests, build custom Docker images, push the images to Artifact Registry, and launch the pipeline in Vertex AI Pipelines.
B. Trigger GitHub Actions to run the tests, launch a job on Cloud Run to build custom Docker images, push the images to Artifact Registry, and launch the pipeline in Vertex AI Pipelines.
C. Trigger GitHub Actions to run the tests, build custom Docker images, push the images to Artifact Registry, and launch the pipeline in Vertex AI Pipelines.
GitHub Actions supports both `workflow_dispatch` for manual execution and `push` on the `main` branch, so the workflow can be started on demand and also automatically after merges to `main`. In the same workflow, running unit/integration tests first, then building the stage-specific Docker images and pushing them to Artifact Registry, is the required deployment path because Vertex AI Pipelines consumes container images from Artifact Registry when launching the pipeline run.
D. Trigger GitHub Actions to run the tests, launch a Cloud Build workflow to build custom Docker images, push the images to Artifact Registry, and launch the pipeline in Vertex AI Pipelines.