How can the Google Cloud Datastore Emulator verify our datastore-index.xml? - google-app-engine

We use the Google Cloud Datastore Emulator. It autogenerates indexes.yaml. But as we did with the old Google Plugin for Eclipse, we want to get missing-index messages in the local development environment, and not later in cloud deployment. So, we want the Emulator to use our manually-maintained datastore-indexes.xml
How do we configure the use of a specific datastore-indexes.xml in the Google Cloud Datastore Emulator? I don't see any relevant command-line switches in the help text.

EDIT:
My answer was based on the dev_appserver emulator, not the current one. After running some tests, it appears that the emulator only has endpoints for a subset of the Datastore API methods, and index building (nor export/import for that matter) are available.
Leaving my previous answer to avoid repeated answers with the same wrong info:
_________
According to the docs, if autoGenerate="false" is in your datastore-indexes.xml, the development server should ignore the contents of WEB-INF/appengine-generated/datastore-indexes-auto.xml.
I think this might be what you're looking for, although I have not yet tested it.

Related

How to quickly update the code on App Engine after its first deployment?

It takes so long to deploy an app to App Engine by this command
gcloud app deploy
After I updated my source code, even if it's just one line of change, I had to issue this command again to upload the changes to App Engine. Again it will take a long time to deploy for just one line of code change. Is there a way to quickly update the code on App Engine instead of doing this time consuming deploy again?
I am looking for options that can speed up the code update after it's first deployment to App Engine. Since I am using flex, would using standard make it faster to update the code? Is it true that there is no way around it on App Engine and the only way to do it is to use another service such as Compute Engine?
Yes, standard env app deployment in such context is much faster, because it only involves uploading the modified files and restarting the instances.
But using standard env is often not an option for other reasons. The potential duplicate post I referenced contains itself references to both explanations and suggestions for potential speed improvements. I don't see a point in duplicating them.
The most common reasons for choosing flex env:
language support
restrictions of the standard env sandbox
See also: Google App Engine Standard or Flexible environment?
(Sep 2021): First of all, the issue you describe for App Engine (flexible) does not apply to App Engine (standard), which is almost a completely different product. (For those who are new, here is a comparison b/w both products.) This question is a few years old, and there are a few more options available to you now:
App Engine standard: If your app can run in Python 3.7+, Java 11, Go 1.12+, PHP 7, Node.js 10+, or Ruby 2.5+, then this is the obvious place to go. A deploy should take less than 1 minute.
Cloud Functions: If you don't have an entire app or your app is made up of one function/route or is otherwise short & simple, consider turning it into a microservice for Cloud Functions. Its deployment time is also less than a minute.
Cloud Run: If you're using App Engine flexible because your app is containerized, consider Cloud Run, which runs containers in a serverless way. A big bonus is that a Dockerfile is optional (due to Cloud Buildpacks). It has taken many GAE flexible use cases. Deployment is also less than a minute. If interested, I produced a pair of videos on how to migrate from App Engine standard to Cloud Run, using Docker as well as no Docker. At some point, I'll do one on transitioning from GAE flexible.
App Engine flexible: If none of the options above work, requiring you to stay on GAE flexible, then yes, you'll have to deal with its longer deployment time (due to the complexities of the system and all the resources it needs to spin-up & manage on your behalf). If you have a container and Cloud Run isn't an option, also consider GKE Autopilot or GCE MIGs (managed [VM] instance groups).

Google App Engine for an application in a local network

I have this application that will be run in a local network where a number of devices should interact with a database. I could use xampp and go for CherryPy or any other Python framework (Python is usually my choice) but it is the sum of a lot of different things: Python, Apache, MySQL... With GAE, which I have previously used in a number of applications successfully, I feel everything is neatly packed in a single box. Thay may not be true, but using the Google App Engine Launcher to create a local working copy of an app couldn't be easier.
But is it reliable? Should it be used like that? I know it's intended for development, so I'm unsure about using it as a local server in production. A few versions ago there even was this nasty bug that flushed the local datastore from time to time. But it seems that they fixed it and now data persists.
Would you recommend GAE for an application running in a local network or should I stick to LAMP (P for Python)?
Other alternative is http://code.google.com/p/appscale/.
May be you can check the the project TyphoonAE. I think it is exactly what you need.
The TyphoonAE project aims at providing a full-featured and productive
serving environment to run Google App Engine (Python) applications. It
delivers the parts for building your own scalable App Engine while
staying compatible with Google's API.

How to download all datastore entities on Google App Engine?

I've read the GAE docs, and I can't seem to figure out how to download all my entity data.
What I'd love to do is download the whole thing as a big TSV file (or something I can easily munge into one), so I can import my various entities into a spreadsheet and fiddle with them.
But I'm stuck at the starting gate. I don't understand the first few bits of the docs: "This document applies to apps that use the master/slave datastore. If your app uses the High Replication datastore..." -- I'm not even sure which I have, or how I would tell.
Assuming I have the simpler master/slave, the docs continue: "...you can use the Python appcfg.py tool by installing the Java version of the remote_api handler..." but, again, I'm not quite sure what they mean or where I find this appcfg.py tool.
Sorry for such a n00b question, but is there some sort of walk-through? I just want to download my datastore!
Thanks!
Master/Slave is the default (for now), so that's almost certainly what you're using. You can confirm at https://appengine.google.com/ -> app-id -> Administration -> Application Settings -> Datastore Replication Options.
To download your data, first install Remote API for Java, then use appcfg.py to download data:
appcfg.py download_data --application=<app-id> --url=http://<appname>.appspot.com/[remote_api_path] --filename=<data-filename>
There is nothing you need to do other than just follwiong the google's own documentaion. There is no workaround or walkthrough. I am not sure about java. In python , only thing you need to do is enable remote_api in your app.yaml.
appcfg.py can be found inside the root directory of appengine SDK.

appengine sdk clears datastore

I am having a slight problem with the appengine SDK.
When I close it, it clears the datastore.
It is a little annoying to create the test data/users every day, so any help would be great.
I am running OSX, just so you know. And I have read this question.
But I have no file anywhere on my machine with that name. Not even when the SDK is running and the datastore contains data.
The project is not set to clear datastore on startup and I can't see anything else relating to it in the settings.
Does anyone know why this is happening?
By default, the Python SDK puts the datastore files in your system's temporary directory, thus the persistence of the datastore is not guaranteed. Provide a different path using the --datastore_path argument of dev_appserver.py.

Is it possible to deploy ColdFusion code on Google App Engine for Java?

Since ColdFusion is itself Java-based, I would imagine it's not too much of a stretch to suggest that CFML code could be deployed on Google App Engine.
BlueDragon is a commercial solution for deploying CFML code on Java servers.
It's described in this thread how someone got OpenBD (Blue Dragon) running on App Engine:
OpenBD on Google App Engine for Java
Are there any open source alternatives
that could be used for App Engine?
Railo is another obvious candidate here, and some people appear to be trying to tweak it for use on Google App Engine.
I am putting together some demos that run on Open BlueDragon, which in turn is running on Google App Engine. The list is small at the moment, but eventually it should give you a good idea of what is opssible with OpenBD and GAE.
http://www.brighthub.com/hubfolio/matthew-casperson/blog/archive/2010/05/12/cold-fusion-demos.aspx
Check out
http://www.stax.net/ - Stax networks made by a former Allaire(r)?
Works great, supports coldfusion out of the ..cloud. You download a precompiled source file, put your stuff in, upload it and it all works, no fighting with it.
I know google app engine is quite restrictive, it will involve opening up the source and removing everything that attempts to write to the file system, and changing your database interaction.
You can checkout this thread and group as a resource for Open BlueDragon as well as the wiki. Looks like they have a branch already which is working towards GAE compatibility.
On the Railo side of the CFML open source pond you can reference this article from help compiling Railo on your own from the source.
Joining both of their respective google groups and asking questions should yield fruitful as well.
Good Luck!

Resources