Deploying a Flogo App to Google Cloud Run

Before you begin
  • A Google Cloud account.

    For more information, see Google Cloud.

  • Setup the Google Cloud command-line tool.

Create or import REST app

Design a new REST app using the UI or import an existing one into the UI.

Build and push a docker image to the container registry

  • From the UI:
    • Create a Docker image of the app.
    • Push the Docker image to Google Container Registry.

      For more information, see Push Docker Image.

  • From CLI:
    • Build a Linux/Amd64 binary using the CLI. For more information, see Building the App from the CLI.
    • Create a Docker file of the app and copy it along with the app binary.
    • From the directory where the binary and docker files are placed, run the following command:

      gcloud builds submit --tag gcr.io/[PROJECT-ID]/[IMAGE_NAME]:[IMAGE_TAG]

      For example:

      gcloud builds submit --tag gcr.io/227xxx/flogo-helloworld:1.0

Deploy app on Cloud Run

You can deploy the app to Cloud Run using the CLI or the Console. This section describes how to deploy the app using the CLI. For more information on deploying the app using the Console, refer Cloud Run.

    Procedure
  1. Deploy the Flogo app using the following command:

    gcloud beta run deploy --image gcr.io/[PROJECT-ID]/[IMAGE_NAME]:[IMAGE_TAG]

    For example:

    gcloud beta run deploy --image gcr.io/227xxx/flogo-helloworld:1.0
    Please specify a region:
     
     [1] us-central1
     
     [2] cancel
     
    Please enter your numeric choice:  1
     
    To make this the default region, run `gcloud config set run/region us-central1`.
     
    Service name (helloworld): 
     
    Allow unauthenticated invocations to [helloworld] (y/N)?  y
    ##NOTE:  At this prompt, only if you enter Y, you are allowed to hit an endpoint without authentication.
    
    Deploying container to Cloud Run service [helloworld] in project [227xxx] region [us-central1]
     
    ✓ Deploying new service... Done.                                                                                                              
     
      ✓ Creating Revision...                                                                                                                      
     
      ✓ Routing traffic...                                                                                                                        
     
      ✓ Setting IAM Policy...                                                                                                                     
     
    Done.                                                                                                                                         
     
    Service [helloworld] revision [helloworld-695fa56d-97d2-46b9-b037-2dfada50aca5] has been deployed and is serving traffic at https://helloworld-pae7vs5yaq-uc.a.run.app

  2. Make a call using the URL returned in the output. For example, you can make a call to the following URL returned in step 2:

    https://helloworld-pae7vs5yaq-uc.a.run.app/greetings/Flogo