기본적으로 Cloud Build는 표준 가상 머신(VM)에서 빌드를 실행합니다.
표준 VM 외에도 Cloud Build는 빌드 실행을 위해 여러 고성능 CPU VM 유형을 제공합니다. 빌드 속도를 늘리려면 빌드 실행을 위해 vCPU 성능이 더 높은 머신을 선택합니다. 고성능 vCPU 머신을 선택하면 빌드 속도가 향상되더라도 Cloud Build가 비표준 머신만 주문형으로 시작하므로 빌드 시작 시간도 늘어납니다.
기본 풀에서 제공되는 것 이외의 추가 vCPU 옵션이 필요하면 빌드에 많은 고성능 CPU 머신 유형을 제공하는 비공개 풀에서 빌드를 실행하도록 선택할 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-12-21(UTC)"],[[["\u003cp\u003eCloud Build allows you to increase the vCPU for your builds to enhance build speed by selecting a high-CPU virtual machine (VM).\u003c/p\u003e\n"],["\u003cp\u003eYou can increase vCPU for builds in default pools by using the \u003ccode\u003egcloud builds submit\u003c/code\u003e command with the \u003ccode\u003e--machine-type\u003c/code\u003e argument or by specifying the \u003ccode\u003emachineType\u003c/code\u003e field in the build config file.\u003c/p\u003e\n"],["\u003cp\u003eTo increase vCPU in private pools, you can use the \u003ccode\u003egcloud builds worker-pools update\u003c/code\u003e command or update the \u003ccode\u003emachineType\u003c/code\u003e field in the private pool config file.\u003c/p\u003e\n"],["\u003cp\u003eSelecting a high-vCPU machine can reduce build time, but may increase build startup time since non-standard machines are started on demand by Cloud Build.\u003c/p\u003e\n"],["\u003cp\u003eThe specific vCPU options available for both default and private pools can be found in the Cloud Build pricing page and the private pool configuration file schema, respectively.\u003c/p\u003e\n"]]],[],null,["# Increase vCPU for builds\n\nThis page describes how you can increase vCPU for your builds.\n\nBy default, Cloud Build runs your builds on a standard virtual machine (VM).\nIn addition to the standard VM, Cloud Build provides\n[several high-CPU VM types](/build/docs/api/reference/rest/v1/projects.builds#machinetype)\nto run builds. To increase the speed of your build, select a machine\nwith a higher vCPU to run builds. Keep in mind that although selecting a high vCPU machine\nincreases your build speed, it may also increase the startup time of your build as\nCloud Build only starts non-standard machines on demand.\n\nIf you require more vCPU options than the ones provided by default pools,\nyou can choose to run your builds on [private pools](/build/docs/private-pools/private-pools-overview),\nwhich provides a number of high-CPU machine types for builds.\n\nTo learn more about the all the available machine types, see the [Pricing page](/build/pricing).\n\nBefore you begin\n----------------\n\nTo use the command-line examples in this guide, install and configure the\n[Google Cloud CLI](/sdk/docs/install-sdk).\n\n- If you've installed gcloud CLI previously, make sure you have the latest available version by running `gcloud components update`.\n\nIncrease vCPU for default pools\n-------------------------------\n\nYou can increase the vCPU for running builds in a default pool either by passing\nthe value directly to the `gcloud builds submit` command or by specifying the\nvalue in the build config file.\n\n**Pass the value directly to the `gcloud builds submit` command:**\n\nTo specify a custom VM size directly in the `gcloud builds submit` command,\nadd the `--machine-type` argument to the command: \n\n gcloud builds submit --config=cloudbuild.yaml \\\n --machine-type=E2_HIGHCPU_8\n\n**Specify the value in the build config file:** \n\n### YAML\n\n1. Open your [build config file](/build/docs/build-config-file-schema).\n\n2. Update the [`machineType`](/build/docs/api/reference/rest/v1/projects.builds#machinetype)\n field to an enum value corresponding to one of the [supported machine types for default pools](/build/pricing).\n The following example shows how to add the `machineType` option to a\n build config file:\n\n steps:\n - name: 'gcr.io/cloud-builders/docker'\n args: ['build', '-t', 'gcr.io/my-project/image1', '.']\n options:\n machineType: 'E2_HIGHCPU_8'\n\n3. Start the build using the [gcloud CLI](/build/docs/running-builds/start-build-manually)\n or [build triggers](/build/docs/automating-builds/create-manage-triggers).\n\n### JSON\n\n1. Open your [build config file](/build/docs/build-config-file-schema).\n\n2. Update the [`machineType`](/build/docs/api/reference/rest/v1/projects.builds#machinetype)\n field to an enum value corresponding to one of the [supported machine types for default pools](/build/pricing).\n The following example shows how to add the `machineType` option to a\n build config file:\n\n {\n \"steps\": [\n {\n \"name\": \"gcr.io/cloud-builders/docker\",\n \"args\": [\"build\", \"-t\", \"gcr.io/my-project/image1\", \".\"]\n },\n \"options\": {\n \"machineType\": \"E2_HIGHCPU_8\"\n }\n }\n\n3. Start the build using the [gcloud CLI](/build/docs/running-builds/start-build-manually)\n or [build triggers](/build/docs/automating-builds/create-manage-triggers).\n\nIncrease vCPU for private pools\n-------------------------------\n\n### Console\n\n1. Open the **Worker pool** page in the Google Cloud console:\n\n [Open the Cloud Build worker pool page](https://console.cloud.google.com/cloud-build/settings/worker-pool)\n2. Select the project in which you created the private pool.\n\n3. Click on the private pool name.\n\n4. In the **Edit private pool** side panel, use the **Machine type** drop-down\n to select a larger machine type.\n\n5. Click **Save**.\n\n### gcloud\n\nYou can increase the vCPU for running builds in a private pool either by passing\nthe value directly to the `gcloud builds worker-pools update` command or by\nspecifying the value in the private pool config file.\n\n**Specify the value in the private pool config file:**\n\n1. Open your [private pool config\n file](/build/docs/private-pools/worker-pool-config-file-schema).\n\n2. Update the value of `machineType` field to one of the supported\n [machine types](/build/docs/private-pools/private-pool-config-file-schema#machinetype) .\n\n3. Run the following command, where \u003cvar translate=\"no\"\u003ePRIVATEPOOL_ID\u003c/var\u003e is\n the unique identifier for your private pool, \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e\n is the region where your private pool is located, and \u003cvar translate=\"no\"\u003ePRIVATEPOOL_CONFIG_FILE\u003c/var\u003e\n is the name of your private pool config file:\n\n gcloud builds worker-pools update \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePRIVATEPOOL_ID\u003c/span\u003e\u003c/var\u003e \\\n --region=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eREGION\u003c/span\u003e\u003c/var\u003e \\\n --config-from-file=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePRIVATEPOOL_CONFIG_FILE\u003c/span\u003e\u003c/var\u003e\n\n**Pass the value directly to the `gcloud builds worker-pools update` command:** \n\n gcloud builds worker-pools update \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003ePRIVATEPOOL_ID\u003c/span\u003e\u003c/var\u003e \\\n --region=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003eREGION\u003c/span\u003e\u003c/var\u003e \\\n --worker-machine-type=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nx\"\u003ePRIVATEPOOL_MACHINE_TYPE\u003c/span\u003e\u003c/var\u003e\n\nReplace the placeholder values in the above commands with the following:\n\n- \u003cvar translate=\"no\"\u003ePRIVATEPOOL_ID\u003c/var\u003e: the ID of your existing private pool. You cannot update this value; you must specify an existing private pool ID.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the [region](/build/docs/locations) where you created your private pool.\n- \u003cvar translate=\"no\"\u003ePRIVATEPOOL_DISK_SIZE\u003c/var\u003e: the updated disk size.\n- \u003cvar translate=\"no\"\u003ePRIVATEPOOL_MACHINE_TYPE\u003c/var\u003e is the updated machine type.\n\n Cloud Build uses the updated machine type anytime you run builds\n using corresponding private pool.\n\nWhat's next\n-----------\n\n- Learn about more best practices to [speed up builds](/build/docs/optimize-builds/speeding-up-builds)."]]