google-app-engine-python

How to use Python 3 with Google App Engine's Local Development Server

落爺英雄遲暮 提交于 2019-12-01 01:14:09
问题 I've got a local Python application configured with runtime: python in it's app.yaml file. When starting the local development server with dev_appserver.py app.yaml all is fine. Since GAE's Local Development Server uses Python2.7 by default, I now want to make use of Python3.x instead. According to Google's documentation, we have to use the flexible environment. Thus I'm changing app.yaml to: runtime: python env: flex runtime_config: python_version: 3 Now dev_appserver.py app.yaml spits out:

How does app engine (python) manage memory across requests (Exceeded soft private memory limit)

余生长醉 提交于 2019-11-30 20:29:48
I'm experiencing occasional Exceeded soft private memory limit error in a wide variety of request handlers in app engine. I understand that this error means that the RAM used by the instance has exceeded the amount allocated, and how that causes the instance to shut down. I'd like to understand what might be the possible causes of the error, and to start, I'd like to understand how app engine python instances are expected to manage memory. My rudimentary assumptions were: An F2 instance starts with 256 MB When it starts up, it loads my application code - lets say 30 MB When it handles a

Cannot run Google App Engine custom managed VM: --custom-entrypoint must be set error

China☆狼群 提交于 2019-11-30 04:06:00
PROBLEM DESCRIPTION I am trying to create a custom managed VM for Google App Engine that behaves identically to the standard python27 managed VM provided by Google. (I'm doing this as a first step to adding a C++ library to the runtime). From google documentation , the following Dockerfile specifies the standard python27 runtime: FROM gcr.io/google_appengine/python-compat ADD . /app I have verified that this is the right Dockerfile by examining the one generated by gcloud preview app run when using the standard python27 runtime. It is identical to this. But when I run my application with this

How does app engine (python) manage memory across requests (Exceeded soft private memory limit)

徘徊边缘 提交于 2019-11-30 04:05:43
问题 I'm experiencing occasional Exceeded soft private memory limit error in a wide variety of request handlers in app engine. I understand that this error means that the RAM used by the instance has exceeded the amount allocated, and how that causes the instance to shut down. I'd like to understand what might be the possible causes of the error, and to start, I'd like to understand how app engine python instances are expected to manage memory. My rudimentary assumptions were: An F2 instance

what's the difference between google.appengine.ext.ndb and gcloud.datastore?

感情迁移 提交于 2019-11-29 17:44:27
问题 ndb: (from google.appengine.ext import ndb) datastore: (from gcloud import datastore) What's the difference? I've seen both of them used, and hints they both save data to google datastore. Why are there two different implementations? 回答1: The Python NDB Client is specific to Python Applications running on Google App Engine. The datastore client removes that restriction and you can run your Python application anywhere, including Google App Engine, Google Compute Engine or anywhere else.

Up-to-date pip with AppEngine Python flex env?

牧云@^-^@ 提交于 2019-11-29 16:58:32
I want to move an app from the Python 3.7 standard environment to the Python 3.6 flex environment. Python 3.7 comes with pip 18, Python 3.6 comes with pip 9. Pip 10 introduced a very useful feature, build dependencies. Many analytics packages need this to work, otherwise you have to install build dependencies like Cython manually in a separate step. That is obviously a non-starter in GAE. Outside of GAE the solution is pip install --upgrade pip . Is it possible to have the Python 3.6 environment update its pip before it runs pip install -r requirements.txt ? Adding pip to requirements.txt has

Google App Engine DB Query Memory Usage

左心房为你撑大大i 提交于 2019-11-29 15:33:42
When I run a query on a large set of small objects (15k objects with only a few short string and boolean properties), without doing anything with these objects, I see my instance's memory usage continuously increasing (70Mb increase). The memory increase doesn't look proportional to the amount of data it ever needs to keep in memory for just the query. The loop I use is the following: cursor = None while True: query = MyModel.all() if cursor: query.with_cursor(cursor) fetched = 0 for result in query.run(batch_size = 500): fetched += 1 # Do something with 'result' here. Actually leaving it

Up-to-date pip with AppEngine Python flex env?

故事扮演 提交于 2019-11-28 10:13:38
问题 I want to move an app from the Python 3.7 standard environment to the Python 3.6 flex environment. Python 3.7 comes with pip 18, Python 3.6 comes with pip 9. Pip 10 introduced a very useful feature, build dependencies. Many analytics packages need this to work, otherwise you have to install build dependencies like Cython manually in a separate step. That is obviously a non-starter in GAE. Outside of GAE the solution is pip install --upgrade pip . Is it possible to have the Python 3.6

Google App Engine DB Query Memory Usage

偶尔善良 提交于 2019-11-28 09:45:35
问题 When I run a query on a large set of small objects (15k objects with only a few short string and boolean properties), without doing anything with these objects, I see my instance's memory usage continuously increasing (70Mb increase). The memory increase doesn't look proportional to the amount of data it ever needs to keep in memory for just the query. The loop I use is the following: cursor = None while True: query = MyModel.all() if cursor: query.with_cursor(cursor) fetched = 0 for result

ImportError: No module named moves

扶醉桌前 提交于 2019-11-28 08:06:03
问题 Versions Python : 2.7.14 six : 1.9.0 & 1.11.0( tried on both ) OS : mac(10.13.3) & ubuntu(16.04) [ tried on both ] Error from six.moves import http_client ImportError: No module named moves Description In flask application which is running on google app engine while running it on local system using dev_appserver.py getting above error while importing from six.moves import http_client What I have tried After importing six have tried dir(six) which shows that moves is there in list but it's not