REST Resource: projects.locations.backends.builds

Resource: Build

A single build for a backend, at a specific point codebase reference tag and point in time. Encapsulates several resources, including an Artifact Registry container image, a Cloud Build invocation that built the image, and the Cloud Run revision that uses that image.

JSON representation
{
  "name": string,
  "displayName": string,
  "state": enum (State),
  "error": {
    object (Status)
  },
  "environment": string,
  "config": {
    object (Config)
  },
  "image": string,
  "source": {
    object (BuildSource)
  },
  "buildLogsUri": string,
  "reconciling": boolean,
  "createTime": string,
  "updateTime": string,
  "deleteTime": string,
  "labels": {
    string: string,
    ...
  },
  "annotations": {
    string: string,
    ...
  },
  "uid": string,
  "etag": string
}
Fields
name

string

Identifier. The resource name of the build.

Format:

projects/{project}/locations/{locationId}/backends/{backendId}/builds/{buildId}.

displayName

string

Optional. Human-readable name. 63 character limit.

state

enum (State)

Output only. The state of the build.

error

object (Status)

Output only. A status and (human readable) error message for the build, if in a FAILED state.

environment

string

Output only. The environment name of the backend when this build was created.

config

object (Config)

Optional. Additional configuration of the service.

image

string

Output only. The Artifact Registry container image URI, used by the Cloud Run revision for this build.

source

object (BuildSource)

Required. Immutable. The source for the build.

buildLogsUri

string

Output only. The location of the Cloud Build logs for the build process.

reconciling

boolean

Output only. A field that, if true, indicates that the build has an ongoing LRO.

createTime

string (Timestamp format)

Output only. Time at which the build was created.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. Time at which the build was last updated.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

deleteTime

string (Timestamp format)

Output only. Time at which the build was deleted.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

labels

map (key: string, value: string)

Optional. Unstructured key value map that can be used to organize and categorize objects.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

annotations

map (key: string, value: string)

Optional. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

uid

string

Output only. System-assigned, unique identifier.

etag

string

Output only. Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.

State

The state of the build.

Enums
STATE_UNSPECIFIED The build is in an unknown state.
BUILDING The build is building.
BUILT The build has completed and is awaiting the next step. This may move to DEPLOYING once App Hosting starts to set up infrastructure.
DEPLOYING The infrastructure for this build is being set up.
READY The infrastructure for this build is ready. The build may or may not be serving traffic - see Backend.traffic for the current state, or Backend.traffic_statuses for the desired state.
FAILED The build has failed.

Config

Additional configuration of the backend for this build.

JSON representation
{
  "runConfig": {
    object (RunConfig)
  }
}
Fields
runConfig

object (RunConfig)

Optional. Additional configuration of the Cloud Run service.

RunConfig

Additional configuration to apply to the Cloud Run service.

JSON representation
{
  "cpu": number,
  "memoryMib": integer,
  "concurrency": integer,
  "maxInstances": integer,
  "minInstances": integer
}
Fields
cpu

number

Optional. Number of CPUs used for each serving instance.

By default, cpu defaults to the Cloud Run's default of 1.0.

CPU can be set to value 1, 2, 4, 6, or 8 CPUs, and for less than 1 CPU, a value from 0.08 to less than 1.00, in increments of 0.01.

If you set a value of less than 1 CPU, you must set concurrency to 1, and CPU will only be allocated during request processing.

Increasing CPUs limit may require increase in memory limits:

  • 4 CPUs: at least 2 GiB
  • 6 CPUs: at least 4 GiB
  • 8 CPUs: at least 4 GiB
memoryMib

integer

Optional. Amount of memory allocated for each serving instance in MiB.

By default, memory defaults to the Cloud Run's default where each instance is allocated 512 MiB of memory.

Memory can be set to any integer value between 128 to 32768.

Increasing memory limit may require increase in CPUs limits:

  • Over 4 GiB: at least 2 CPUs
  • Over 8 GiB: at least 4 CPUs
  • Over 16 GiB: at least 6 CPUs
  • Over 24 GiB: at least 8 CPUs
concurrency

integer

Optional. Maximum number of requests that each Cloud Run instance can receive.

By default, each instance can receive Cloud Run's default of up to 80 requests at the same time.

Concurrency can be set to any integer value up to 1000.

maxInstances

integer

Optional. Number of Cloud Run instances to maintain at maximum for each revision.

By default, each Cloud Run service scales out to Cloud Run's default of a maximum of 100 instances. The maximum maxInstances limit is based on your quota. See https://cloud.google.com/run/docs/configuring/max-instances#limits.

minInstances

integer

Optional. Number of Cloud Run instances to maintain at minimum for each Cloud Run Service.

By default, there are no minimum.

Even if the service splits traffic across multiple revisions, the total number of instances for a service will be capped at this value.

BuildSource

The source for the build.

JSON representation
{

  // Union field source can be only one of the following:
  "codebase": {
    object (CodebaseSource)
  },
  "container": {
    object (ContainerSource)
  }
  // End of list of possible types for union field source.
}
Fields
Union field source. The input source for the build. Typically will reference a commit in a source repository. May also reference a container image. source can be only one of the following:
codebase

object (CodebaseSource)

A codebase source.

container

object (ContainerSource)

An Artifact Registry container image source.

CodebaseSource

A codebase source, representing the state of the codebase that the build will be created at.

JSON representation
{
  "displayName": string,
  "hash": string,
  "commitMessage": string,
  "uri": string,
  "author": {
    object (UserMetadata)
  },
  "commitTime": string,

  // Union field reference can be only one of the following:
  "branch": string,
  "commit": string
  // End of list of possible types for union field reference.
}
Fields
displayName

string

Output only. The human-friendly name to use for this Codebase when displaying a build. We use the first eight characters of the SHA-1 hash for GitHub.com.

hash

string

Output only. The full SHA-1 hash of a Git commit, if available.

commitMessage

string

Output only. The message of a codebase change.

uri

string

Output only. A URI linking to the codebase on an hosting provider's website. May not be valid if the commit has been rebased or force-pushed out of existence in the linked repository.

author

object (UserMetadata)

Output only. The author contained in the metadata of a version control change.

commitTime

string (Timestamp format)

Output only. The time the change was made.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

Union field reference.

reference can be only one of the following:

branch

string

The branch in the codebase to build from, using the latest commit.

commit

string

The commit in the codebase to build from.

UserMetadata

Version control metadata for a user associated with a resolved codebase. Currently assumes a Git user.

JSON representation
{
  "displayName": string,
  "email": string,
  "imageUri": string
}
Fields
displayName

string

Output only. The 'name' field in a Git user's git.config. Required by Git.

email

string

Output only. The 'email' field in a Git user's git.config, if available.

imageUri

string

Output only. The URI of an image file associated with the user's account in an external source control provider, if available.

ContainerSource

The URI of an Artifact Registry container image to use as the build source.

JSON representation
{
  "image": string
}
Fields
image

string

Required. A URI representing a container for the backend to use.

Methods

create

Creates a new build for a backend.

delete

Deletes a single build.

get

Gets information about a build.

list

Lists builds in a given project, location, and backend.