0

I've deployed a Docker image intended to bootstrap a simple Node.js backend. I have tried pulling locally and running a container instance and the image stored in Cloud Registry works perfectly.

Now I am trying to use said image from an Azure DevOps pipeline, in order to deploy said container in an App Engine flex.

I tried to deploy it using the following scripts

- script: |
      gcloud auth activate-service-account --key-file=$(GOOGLE_APPLICATION_CREDENTIALS)
      gcloud config set project $(GOOGLE_PROJECT_ID)
  displayName: 'Activate Google Cloud Auth and Set Project'

- script : |
      gcloud app deploy --image-url [host]/[project]/[image]:[tag] --no-promote
  displayName: 'Deploy container in app engine flex environment'

From the pipeline running on a directory containing an app.yaml file, it seems to try to use the code from the directory instead of the image:

descriptor: [/home/vsts/work/1/s/app.yaml]

source: [/home/vsts/work/1/s]

And the error in cloud logging is: Permission denied to enable service [appengineflex.googleapis.com]

On the other hand, if I try to run the command locally I get the following error.

gcloud app deploy --image-url [host]/[project]/[image]:[tag] --no-promote

ERROR: An app.yaml (or appengine-web.xml) file is required to deploy this directory as an App Engine application. Create an app.yaml file using the directions at https://cloud.google.com/appengine/docs/flexible/reference/app-yaml (App Engine flexible environment)

ERROR: (gcloud.app.deploy) [/current-directory] could not be identified as a valid source directory or file.

UPDATE: The permissions were updated and now I receive another error running gcloud app deploy from local machine.

Error: An internal error occurred while processing task /app-engine-flex/insert_flex_deployment/flex_create_resources>2023-03-02T08:49:11.470Z2797.xd.0: Network 'default' does not exist

Any help would be greatly appreciated!

  • Side question: did you consider Cloud Run instead of App Engine flex to run containers? – guillaume blaquiere Mar 01 '23 at 13:55
  • Sure, I already consider that approach, Cloud run has exactly that mission. The decision comes from above, they want to try all the existing options and then make a decision about what GCP product is the best option. Btw, I updated the description with new error. – Luis David Amador Mar 02 '23 at 08:54
  • About your error, you have to create a VPC in your project, with the name default. If you created one with another name, you have to update your app.yaml to reference the correct network name. But again, App Engine flex is a legacy hack, I can't recommend to use it, and waste your time testing it, except if you have some edge cases with Cloud Run. – guillaume blaquiere Mar 02 '23 at 09:40

0 Answers0