appengine cloudbuild.yaml是否需要自定义运行时?

时间:2018-09-28 12:36:14

标签: google-app-engine google-cloud-build

使用以下输出构建错误(使用Rails应用)

ERROR: (gcloud.app.deploy) There is a cloudbuild.yaml in the current directory, and the runtime field in /workspace/app.yaml is currently set to [runtime: ruby]. To use your cloudbuild.yaml to build a custom runtime, set the runtime field to [runtime: custom]. To continue using the [ruby] runtime, please remove the cloudbuild.yaml from this directory.

2 个答案:

答案 0 :(得分:2)

Cloudbuild.yaml应该可以与App Engine Flexible一起使用,而无需使用自定义运行时。如错误消息中所述,如果要在非定制运行时中进行部署,则不能将app.yaml和cloudbuild.yaml放在同一目录中,以解决这种情况,请执行以下步骤:

  1. 将app.yaml和其他ruby文件移动到子目录中(使用原始的app.yaml,无需使用自定义运行时)

  2. 在您的cloudbuild.yaml步骤下,通过添加指定app.yaml路径的第三个参数来修改用于app deploy的参数。

下面是一个示例:

===================从:

fun Image.toLinearRgb(): Mat {
    val bayer16Bit = Mat(height, width, CvType.CV_16UC1, planes[0].buffer)
    val bayer8Bit = Mat().apply {
        bayer16Bit.convertTo(this, CvType.CV_8UC1, 0.0625)
    }
    val rgb8Bit = Mat().apply {
        Imgproc.cvtColor(bayer8Bit, this, Imgproc.COLOR_BayerGR2RGB)
    }
    bayer16Bit.release()
    bayer8Bit.release()
    return rgb8Bit
}

=================== TO:

steps: 
- name: 'gcr.io/cloud-builders/gcloud' 
args: ['app', 'deploy'] 
timeout: '1600s' 

答案 1 :(得分:0)

一种解决方法是将cloudbuild.yaml文件的名称更改为cloud_build.yaml(您也可以移动文件),然后转到Cloud Build中的触发器:

enter image description here

并将其从Autodetected更改为手动选择Cloud Build configuration file

enter image description here

有关更多信息,请参见此Github issue