ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 159 - Professional Cloud Developer discussion

Report
Export

You are configuring a continuous integration pipeline using Cloud Build to automate the deployment of new container images to Google Kubernetes Engine (GKE). The pipeline builds the application from its source code, runs unit and integration tests in separate steps, and pushes the container to Container Registry. The application runs on a Python web server.

The Dockerfile is as follows:

FROM python:3.7-alpine -

COPY . /app -

WORKDIR /app -

RUN pip install -r requirements.txt

CMD [ 'gunicorn', '-w 4', 'main:app' ]

You notice that Cloud Build runs are taking longer than expected to complete. You want to decrease the build time. What should you do? (Choose two.)

A.
Select a virtual machine (VM) size with higher CPU for Cloud Build runs.
Answers
A.
Select a virtual machine (VM) size with higher CPU for Cloud Build runs.
B.
Deploy a Container Registry on a Compute Engine VM in a VPC, and use it to store the final images.
Answers
B.
Deploy a Container Registry on a Compute Engine VM in a VPC, and use it to store the final images.
C.
Cache the Docker image for subsequent builds using the -- cache-from argument in your build config file.
Answers
C.
Cache the Docker image for subsequent builds using the -- cache-from argument in your build config file.
D.
Change the base image in the Dockerfile to ubuntu:latest, and install Python 3.7 using a package manager utility.
Answers
D.
Change the base image in the Dockerfile to ubuntu:latest, and install Python 3.7 using a package manager utility.
E.
Store application source code on Cloud Storage, and configure the pipeline to use gsutil to download the source code.
Answers
E.
Store application source code on Cloud Storage, and configure the pipeline to use gsutil to download the source code.
Suggested answer: A, C

Explanation:

https://cloud.google.com/build/docs/optimize-builds/increase-vcpu-for-builds

By default, Cloud Build runs your builds on a standard virtual machine (VM). In addition to the standard VM, Cloud Build provides several high-CPU VM types to run builds. To increase the speed of your build, select a machine with a higher vCPU to run builds. Keep in mind that although selecting a high vCPU machine increases your build speed, it may also increase the startup time of your build as Cloud Build only starts non-standard machines on demand.

https://cloud.google.com/build/docs/optimize-builds/speeding-up-builds#using_a_cached_docker_image

The easiest way to increase the speed of your Docker image build is by specifying a cached image that can be used for subsequent builds. You can specify the cached image by adding the --cache-from argument in your build config file, which will instruct Docker to build using that image as a cache source.

asked 18/09/2024
German Dario Jara
32 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first