erichiggins / gaek Goto Github PK
View Code? Open in Web Editor NEWA collection of useful tools for Google App Engine.
License: MIT License
A collection of useful tools for Google App Engine.
License: MIT License
Cloud NDB is a client library designed to replace App Engine NDB in apps that migrate from the App Engine Python 2.7 standard runtime to the Python 3 standard runtime.
Updating gaek to be cross compatible with both App Engine NDB and Cloud NDB would be extremely helpful to anyone who makes use of gaek currently, and wishes to move to Cloud NDB, while continuing to use gaek.
Based on an examination of the migration notes, it appears that there is at least one change which would break gaek, specifically the removal of google.appengine.api.namespace_manager
which has no replacement.
The auto-generated https://erichiggins.github.io/gaek/ site has the below link to a readthedocs page, which doesn't exist:
I don't think I can submit a PR to update this text since it looks like it's auto-generated from an older version of the gaek readme.
The environment variables different when running Managed VMs, and the RPC stubs used by google.appengine.api.modules
are not available. It would be beneficial for gaek to still function in this runtime environment as much as possible without throwing exceptions. Here's a dump of os.environ
from a module running in Managed VMs with a custom image:
{
'MEMCACHE_PORT_11211_TCP': 'tcp://172.17.0.3:11211',
'SERVER_SOFTWARE': 'gunicorn/19.4.1',
'MEMCACHE_PORT_11211_TCP_ADDR': '172.17.0.3',
'GAE_PARTITION': 's',
'GAE_VM': 'true',
'MEMCACHE_NAME': '/gaeapp/memcache',
'HOME': '/root',
'GAE_MODULE_VERSION': 'vmv8',
'APPENGINE_LOADBALANCER_IP': '',
'MEMCACHE_PORT_11211_TCP_PORT': '11211',
'GAE_LONG_APP_ID': 'jt-calc',
'DEBIAN_FRONTEND': 'noninteractive',
'MEMCACHE_PORT': 'tcp://172.17.0.3:11211',
'MODULE_YAML_PATH': 'module.yaml',
'GAE_MINOR_VERSION': '389176423410002280',
'USE_MVM_AGENT': 'true',
'HTTP_X_APPENGINE_CURRENT_NAMESPACE': 'production',
'MEMCACHE_ENV_DEBIAN_FRONTEND': 'noninteractive',
'GAE_MODULE_NAME': 'mvm',
'GAE_APPENGINE_HOSTNAME': 'jt-calc.appspot.com',
'APPENGINE_LOADBALANCER': '',
'HOSTNAME': '90e692391545',
'GAE_AFFINITY': 'true',
'PWD': '/home/vmagent/app',
'GAE_MODULE_INSTANCE': '0',
'MEMCACHE_PORT_11211_TCP_PROTO': 'tcp',
# I injected this in the application init method based on GAE_MODULE_VERSION.
'CURRENT_VERSION_ID': 'vmv8',
# This was injected through my module.yaml file.
'CURRENT_MODULE_ID': 'mvm',
# These came from the Dockerfiles.
'PORT': '8080',
'LANG': 'C.UTF-8',
'VIRTUAL_ENV': '/env',
'PKG_PATH': '/env/local/lib/python2.7/site-packages/',
'PATH': '/env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
'SDK_VERSION': '1.9.30',
'SDK_URL': 'https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.30.zip',
}
Benchmark against stock json
module on Python 2.7:
Running json benchmarks...
Running ndb_json benchmarks...
Results
=======
loads (large obj)
-----------------
json 1.103s
ndb_json 2.200s
dumps (large obj)
-----------------
json 0.559s
ndb_json 0.553s
loads (small objs)
------------------
json 1.201s
ndb_json 2.760s
dumps (small objs)
------------------
json 0.913s
ndb_json 1.253s
Goal: Make gaek compatible with Python 3 (while maintaining 2.7 support)
As suggested by #20
Python versions supported by Google App Engine:
Docs for Porting Python 2 code to Python 3
As noted in #20 :
Based on an examination of the migration notes, it appears that there is at least one change which would break gaek, specifically the removal of
google.appengine.api.namespace_manager
which has no replacement.
The migration notes state:
There is no replacement for
google.appengine.api.namespace_manager
which is used to determine the default namespace when not passed in toKey()
This seems to primarily affect envrion.py
which imports namespace_manager
and makes its methods available.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.