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, 1 month agobob_builder
Highly Voted 3 years agojomonkp
Most Recent 1 year agocalex1
1 year, 3 months agojeffersonkozak
1 year, 6 months agoGreg123123
1 year, 11 months agoFeliphus
11 months, 4 weeks agozellck
2 years, 1 month agoAzureDP900
2 years, 1 month agossmb
2 years, 1 month agoAnanda
2 years, 7 months agoTNT87
2 years, 11 months agoTNT87
2 years, 11 months agoTNT87
3 years agoKyubiBlaze
2 years, 11 months agoleandrojpg
2 years agoleandrojpg
2 years agoleandrojpg
2 years agoESP_SAP
3 years agoTNT87
3 years agoTNT87
3 years agoTire
3 years agoTNT87
3 years agomuk5658
3 years agoManh
3 years, 1 month agoShasha1
3 years, 1 month ago