PROFESSIONAL-CLOUD-DEVOPS-ENGINEER · Question #18
You use Cloud Build to build your application. You want to reduce the build time while minimizing cost and development effort. What should you do?
The correct answer is A. Use Cloud Storage to cache intermediate artifacts. Using Cloud Storage to cache intermediate build artifacts (A) is the built-in, recommended approach for speeding up Cloud Build pipelines. By storing compiled dependencies, downloaded packages, and intermediate outputs in a Cloud Storage bucket between builds, subsequent builds…
Question
Options
- AUse Cloud Storage to cache intermediate artifacts.
- BRun multiple Jenkins agents to parallelize the build.
- CUse multiple smaller build steps to minimize execution time.
- DUse larger Cloud Build virtual machines (VMs) by using the machine-type option.
How the community answered
(32 responses)- A81% (26)
- B3% (1)
- C9% (3)
- D6% (2)
Explanation
Using Cloud Storage to cache intermediate build artifacts (A) is the built-in, recommended approach for speeding up Cloud Build pipelines. By storing compiled dependencies, downloaded packages, and intermediate outputs in a Cloud Storage bucket between builds, subsequent builds can skip redundant steps - significantly reducing build time. This requires minimal configuration (adding cache paths to the Cloud Build YAML) and adds no infrastructure overhead. Option B (Jenkins agents) requires setting up and maintaining a separate CI system, adding cost and complexity. Option C (smaller build steps) doesn't inherently reduce time - it only improves parallelism if steps are independent. Option D (larger VMs) increases cost directly and only helps CPU-bound steps, not dependency download or I/O-bound tasks.
Topics
Community Discussion
No community discussion yet for this question.