Can I deploy and App Engine App inside App Engine without needing another VM

91 views
Skip to first unread message

z.be...@googlemail.com

unread,
Jun 6, 2019, 4:53:35 AM6/6/19
to Google App Engine
Hi guys,

Xzibit jokes aside, I have a very nice idea of a blogging platform using App Engine and it would be very nice if I can edit some source code inside my application then redeploy another instance (new version for testing) all on the web, without the need to provision a middleware VM that would do the gcloud deploy commands.

Yours,
Zdravko

Sam (Google Cloud Support)

unread,
Jun 6, 2019, 9:36:54 AM6/6/19
to Google App Engine
Hi, I'm not quite sure what you mean by deploying an App Engine app without needing another VM, but what I understand about your idea for testing new versions of your app's source code is that you would benefit from A/B testing. App Engine allows you to split traffic or migrate traffic between versions of your application [1][2]. One way would be to indicate the version name/number for the new version of the app with the '--version' flag and also indicate that you wouldn't like it to start serving traffic yet with the '--no-promote' flag. This way you can incrementally migrate traffic from the old version to the new version to test its behavior before finally migrating or rolling back depending on the results. Here's an article in our official docs to help get you started with testing your app [3]. Note that there won't be an additional instance being used as long as the new version is not serving traffic, but you can set minTotalInstances for the new version to the number needed to handle expected traffic. More options on configuring your app.yaml file here [4]. 

z.be...@googlemail.com

unread,
Jun 6, 2019, 10:11:19 AM6/6/19
to Google App Engine
Hello,

I'm sorry I didn't explain myself too well. I don't want A/B testing, the new version will be visible only for myself.

What I want is to the following: Suppose I have all the files I need for deploying an App Engine App (on datastore or google cloud storage). Is there a way to deploy those from App Engine?

Best,
Zdravko

Sam (Google Cloud Support)

unread,
Jun 7, 2019, 9:43:23 AM6/7/19
to Google App Engine
Oh, I think I understand your request now. First of all, you cannot run commands from within App Engine VMs as these are Google-managed instances. You simply don't have access to download the Cloud SDK inside the VMs for running glcoud or gsutil commands from within them, not even from App Engine Flex which offers some level of access to the VM instance.

But if you looking for a way to script/automate App Engine app deployments? I can recommend two options for that:

1) Google Cloud Functions:
This is an event-driven serverless-compute platform that will allow you to deploy lightweight scripts to abstract out your app deployments for your prepackaged deployment files [1]. You won't be spinning up a VM instance for this so you can save a lot of cost this way, also as GCF has a free-tier for compute resource usage [2]. 

I'm not sure if you misspoke about using Datastore (which is a NoSQL database - not a viable option) but you can definitely use Google Cloud Storage (object storage) as a repository for your app files for which you can deploy a function that runs gsutil cp to upload packaged files to your GCS repo, and a function that listens to changes to this GCS repo and then runs gcloud app deploy to deploy the new app version with the --no-promote and --version flags configured the way that suits. Take a look at this tutorial for more on GCS and GCF integration [3].

2) Google Cloud Repository integrating with Google Cloud Build and App Engine. This uses the Google's cloud-native source code repo [4] (which can connect with other hosted repos) to supply new commits to Cloud Build which automates new builds of your app in a customizable (scripted) fashion [5] and then deploys new builds to App Engine.

Below is a walkthrough on how to automatically deploy an application stored in Cloud Source Repositories to App Engine when there is a new commit [6].

Consider these two options for a method to abstract away the computing resources. There are other Continuous Delivery options you could consider if you want to get even fancier (or not) [7].

[1] Google Cloud Functions: https://cloud.google.com/functions/
[4] Cloud Source Repositories: https://cloud.google.com/source-repositories/

4E丘曉栩

unread,
Mar 18, 2020, 6:16:36 AM3/18/20
to Google App Engine


z.b...@googlemail.com於 2019年6月6日星期四 UTC+8下午4時53分35秒寫道:

4E丘曉栩

unread,
Mar 18, 2020, 6:16:38 AM3/18/20
to Google App Engine


Sam (Google Cloud Support)於 2019年6月6日星期四 UTC+8下午9時36分54秒寫道:
Reply all
Reply to author
Forward
0 new messages