Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

does appengine cloudbuild.yaml requires a custom runtime?

Build errors out with below output (Using a Rails app)

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.
like image 372
pra Avatar asked Sep 28 '18 12:09

pra


People also ask

What is the difference between App Engine and Cloud run?

Like Cloud Functions, Cloud Run is billed by total execution time measured to the nearest 0.1 second. App Engine is a PaaS offering for web applications written in Node. js, Java, Ruby, C#, Go, Python, PHP, or any custom runtime packaged as a container.

What is the difference between APP engine standard and flexible?

The standard environment can scale from zero instances up to thousands very quickly. In contrast, the flexible environment must have at least one instance running for each active version and can take longer to scale up in response to traffic. Standard environment uses a custom-designed autoscaling algorithm.

How do I know what version of Appengine I have?

To check out the current versions of your application, you should log in to http://appengine.google.com and visit the Versions option in the Main section as shown below: Now, let me deploy another version of the application.


2 Answers

One way to deal with this is to change the name of the cloudbuild.yaml file to say cloud_build.yaml (you can also just move the file) and then go to your triggers in Cloud Build:

enter image description here

And change it from Autodetected to choosing your Cloud Build configuration file manually:

enter image description here

See this Github issue for some more information

like image 77
Ringil Avatar answered Sep 19 '22 01:09

Ringil


Cloudbuild.yaml should work with App Engine Flexible without the need to use a custom runtime. As detailed in the error message, you cannot have the app.yaml and the cloudbuild.yaml in the same directory if you are deploying in a non-custom runtime, to remedy the situation, follow these steps:

  1. Move the app.yaml and other ruby files into a subdirectory (use your original app.yaml, no need to use custom runtime)

  2. Under your cloudbuild.yaml steps, modify the argument for app deploy by adding a third one specifying the app.yaml path.

Below is an example:

==================FROM:

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

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

steps: 
- name: 'gcr.io/cloud-builders/gcloud' 
args: ['app', 'deploy', '[SUBDIRECTORY/app.yaml]'] 
timeout: '1600s' 
like image 22
David Avatar answered Sep 23 '22 01:09

David