2

After i recently updated the gcloud components with gcloud components update to version 108.0.0, i noticed the gcloud preview app deploy app.yaml command has started taking too long every time (about 15 minutes) for my project. Before this it only used to take about a minute to complete.

I figured out that using gcloud preview app deploy --verbosity info app.yaml displays progress of deployment process and I noticed every file in source code is being uploaded every time i deploy including the files in lib directory which has a number of packages installed, about 2000 files in it so this is where the delay is coming from. Since I am new to appengine, i dont know if this is normal.

The project exists inside a folder of git repo, and i noticed after every deploy, 2 files in default directory, source-context.json and source-contexts.json, are being created and have information about git repo inside. I feel that can somehow be relevant.

I went through a number of relevant questions here but couldnt figure out the issue. It would be great if this can be resolved if its an issue at all because its a big inconvenience having to wait 15 mins to deploy every time.

I only started using google appengine a month ago so please dont mind if the question is incorrect. Please let me know if additional info is needed to resolve this. Thanks

UPDATE: I am using gcloud sdk on ubuntu 14.04 LTS.

bossylobster
  • 9,993
  • 1
  • 42
  • 61
Shark
  • 257
  • 2
  • 13
  • Do you have a new version at each deploy? Or are you reusing the same version? If you reuse a version, I believe only changed files are uploaded but if you change the version, all files are uploaded. – new name May 06 '16 at 14:45
  • Although i like the idea, what if something in the new deploy crashes and i need to rollback to previous deploy? I wont have a version to rollback to right? If this is not the case and your suggestion works then this is the correct answer. I will give an update after i confirm this. Till now i have not been mentioning `--version` in deploy command in which case gcloud creates a version automatically. – Shark May 07 '16 at 04:58
  • @JeffO'Neill i pass a fixed `--version`, and `gcloud app deploy` sometimes only uploads changed files, but sometimes uploads all of them. not sure why yet. (gcloud sdk 182.0.0, app-engine-python 1.9.63, on mac os x.) – ryan Dec 12 '17 at 02:10

1 Answers1

1

Yes, this is the expected behaviour, each deployment is standalone, no assumption is made about anything being "already deployed", all app's artifacts are uploaded at every deployment.

Update: Kekito's comment suggests different tools may actually behave differently. My answer applies to the linux version of the Python SDK, regardless of deploying a new version or re-deploying the same version.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
  • oh. but it wasnt like this before i updated the gcloud version? – Shark May 05 '16 at 22:53
  • I has always been like that AFAIK. Something *else* might have changed, it coulod be some transient condition. Re-try a few times to make sure it's not a transient. If it's not then rollback to the previous version you had, to see if it's indeed related to the upgrade. – Dan Cornilescu May 05 '16 at 22:58
  • When i deployed new versions to the project before, it took only a minute, now its 15 to 20 mins. I have tried to rollback previous version but no luck. Also retried deploying several times. Thanks, i will keep looking to find out the reason. Will accept the answer once i solve why it was so fast before. – Shark May 05 '16 at 23:04
  • 1
    You might also want to take a look at this Q&A: http://stackoverflow.com/questions/33769879/what-is-the-relationship-between-googles-app-engine-sdk-and-cloud-sdk/33770297#33770297, it offers an alternative you *might* find acceptable. – Dan Cornilescu May 05 '16 at 23:04
  • 1
    I use the AppEngineLauncher GUI to deploy, and it only uploads files that have changed. You see log statements like this: `10:41 AM Uploaded 2 files and blobs.` – new name May 06 '16 at 14:42
  • I commonly deploy changes and see only 2 files uploaded. Occasionally hundreds, though, although only one or two have changed. It seems to be a function of either a `git commit` changing the file access times or the elapsed time since the last deployment. – Tom Russell Jul 03 '17 at 07:11