IMO this question / options could be reported incorrectly.
For A, according to the doc, we can only store the resulting image in cloud storage, not intermediate layer of the image. To do so, we should use Kaniko cache instead. So A isn't correct.
For D, it works but it increases the cost which violates the requirement from the question.
A is the answer.
https://cloud.google.com/build/docs/optimize-builds/speeding-up-builds#caching_directories_with_google_cloud_storage
To increase the speed of a build, reuse the results from a previous build. You can copy the results of a previous build to a Google Cloud Storage bucket, use the results for faster calculation, and then copy the new results back to the bucket.
lets correct something fellows ok. A is not ok, why, we can ok only use intermediate artifacts in Kaniko cache, not in Cloud storage, in cloud storage we use results not intermediate artifacts "You can copy the results of a previous build to a Google Cloud Storage bucket, use the results for faster calculation, and then copy the new results back to the bucket." go re-read the best practices and you will see what im talking about, then this leaves D as the correct answer.
https://cloud.google.com/build/docs/speeding-up-builds
A is correct choice.
Why D is not correct, because even if you break steps into small chunks, you are just increasing the number of steps, and not solving the actual problem of reducing execution time. If step 1 takes 5min it will take 5min, if you break it down into three steps, combined Step 1+2+3 = 5min again, and they don't run in parallel. What did you solve? Nothing.
If you cache ie. store intermediate artefacts in cloud storage, you do not need to recompile it in next steps, saves time and cost.
Correct Answer is (D):
Using custom virtual machine sizes
In addition to the standard machine type, Cloud Build provides four high-CPU virtual machine types to run your builds. To increase the speed of your build, select a virtual machine with a higher CPU. Requesting a high-CPU machine may increase the startup time of your build as Cloud Build only starts these machines on demand.
https://cloud.google.com/build/docs/speeding-up-builds
Caching directories with Google Cloud Storage
To increase the speed of a build, reuse the results from a previous build. You can copy the results of a previous build to a Google Cloud Storage bucket, use the results for faster calculation, and then copy the new results back to the bucket. Use this method when your build takes a long time and produces a small number of files that does not take time to copy to and from Google Cloud Storage.
Both A and D are valid options, but if we look in the question they are asking to Minimize Cost - Larger Compute Instances comes at price.
So I will go with A (Caching from GCS bucket)
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
TNT87
Highly Voted 3 years agobob_builder
Highly Voted 2 years, 10 months agojomonkp
Most Recent 11 months agocalex1
1 year, 2 months agojeffersonkozak
1 year, 4 months agoGreg123123
1 year, 9 months agoFeliphus
10 months, 1 week agozellck
2 years agoAzureDP900
2 years agossmb
2 years agoAnanda
2 years, 5 months agoTNT87
2 years, 10 months agoTNT87
2 years, 10 months agoTNT87
2 years, 11 months agoKyubiBlaze
2 years, 9 months agoleandrojpg
1 year, 11 months agoleandrojpg
1 year, 11 months agoleandrojpg
1 year, 11 months agoESP_SAP
2 years, 11 months agoTNT87
2 years, 11 months agoTNT87
2 years, 11 months agoTire
2 years, 11 months agoTNT87
2 years, 11 months agomuk5658
2 years, 11 months agoManh
2 years, 11 months agoShasha1
2 years, 12 months ago