def _RunCloudBuild(args, builder, build_args, build_tags=None, output_filter=None, log_location=None, backoff=(lambda elapsed: 1)):
    "Run a build with a specific builder on Google Cloud Builder.\n\n  Args:\n    args: an argparse namespace. All the arguments that were provided to this\n      command invocation.\n    builder: path to builder image\n    build_args: args to be sent to builder\n    build_tags: tags to be attached to the build\n    output_filter: A list of strings indicating what lines from the log should\n      be output. Only lines that start with one of the strings in output_filter\n      will be displayed.\n    log_location: GCS path to directory where logs will be stored.\n    backoff: A function that takes the current elapsed time and returns\n      the next sleep length. Both are in seconds.\n\n  Returns:\n    A build object that either streams the output or is displayed as a\n    link to the build.\n\n  Raises:\n    FailedBuildException: If the build is completed and not 'SUCCESS'.\n  "
    client = cloudbuild_util.GetClientInstance()
    messages = cloudbuild_util.GetMessagesModule()
    build_config = messages.Build(steps=[messages.BuildStep(name=builder, args=build_args)], tags=build_tags, timeout='{0}s'.format(args.timeout))
    if log_location:
        gcs_log_dir = resources.REGISTRY.Parse(args.log_location, collection='storage.objects')
        build_config.logsBucket = 'gs://{0}/{1}'.format(gcs_log_dir.bucket, gcs_log_dir.object)
    (build, build_ref) = _CreateCloudBuild(build_config, client, messages)
    if args.async_:
        return build
    mash_handler = execution.MashHandler(execution.GetCancelBuildHandler(client, messages, build_ref))
    with execution_utils.CtrlCSection(mash_handler):
        build = CloudBuildClientWithFiltering(client, messages).StreamWithFilter(build_ref, backoff, output_filter=output_filter)
    if (build.status == messages.Build.StatusValueValuesEnum.TIMEOUT):
        log.status.Print('Your build timed out. Use the [--timeout=DURATION] flag to change the timeout threshold.')
    if (build.status != messages.Build.StatusValueValuesEnum.SUCCESS):
        raise FailedBuildException(build)
    return build
Run a build with a specific builder on Google Cloud Builder.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.
  builder: path to builder image
  build_args: args to be sent to builder
  build_tags: tags to be attached to the build
  output_filter: A list of strings indicating what lines from the log should
    be output. Only lines that start with one of the strings in output_filter
    will be displayed.
  log_location: GCS path to directory where logs will be stored.
  backoff: A function that takes the current elapsed time and returns
    the next sleep length. Both are in seconds.

Returns:
  A build object that either streams the output or is displayed as a
  link to the build.

Raises:
  FailedBuildException: If the build is completed and not 'SUCCESS'.
def _RunCloudBuild(args, builder, build_args, build_tags=None, output_filter=None, log_location=None, backoff=(lambda elapsed: 1)):
    "Run a build with a specific builder on Google Cloud Builder.\n\n  Args:\n    args: an argparse namespace. All the arguments that were provided to this\n      command invocation.\n    builder: path to builder image\n    build_args: args to be sent to builder\n    build_tags: tags to be attached to the build\n    output_filter: A list of strings indicating what lines from the log should\n      be output. Only lines that start with one of the strings in output_filter\n      will be displayed.\n    log_location: GCS path to directory where logs will be stored.\n    backoff: A function that takes the current elapsed time and returns\n      the next sleep length. Both are in seconds.\n\n  Returns:\n    A build object that either streams the output or is displayed as a\n    link to the build.\n\n  Raises:\n    FailedBuildException: If the build is completed and not 'SUCCESS'.\n  "
    client = cloudbuild_util.GetClientInstance()
    messages = cloudbuild_util.GetMessagesModule()
    build_config = messages.Build(steps=[messages.BuildStep(name=builder, args=build_args)], tags=build_tags, timeout='{0}s'.format(args.timeout))
    if log_location:
        gcs_log_dir = resources.REGISTRY.Parse(args.log_location, collection='storage.objects')
        build_config.logsBucket = 'gs://{0}/{1}'.format(gcs_log_dir.bucket, gcs_log_dir.object)
    (build, build_ref) = _CreateCloudBuild(build_config, client, messages)
    if args.async_:
        return build
    mash_handler = execution.MashHandler(execution.GetCancelBuildHandler(client, messages, build_ref))
    with execution_utils.CtrlCSection(mash_handler):
        build = CloudBuildClientWithFiltering(client, messages).StreamWithFilter(build_ref, backoff, output_filter=output_filter)
    if (build.status == messages.Build.StatusValueValuesEnum.TIMEOUT):
        log.status.Print('Your build timed out. Use the [--timeout=DURATION] flag to change the timeout threshold.')
    if (build.status != messages.Build.StatusValueValuesEnum.SUCCESS):
        raise FailedBuildException(build)
    return build