How to use Google Cloud SDK in local environment - google-app-engine

I am currently using Google's 'legacy standalone SDK' for management of my google app engine python projects. This provides a nice GUI where I can select and run a project locally and then deploy it when I'm happy with testing.
I recently received the following message from Google '... App Engine app that has used the legacy standalone SDK in the past 30 days, and need to be migrated to Cloud SDK' so I installed the Cloud SDK.
The provided Google Cloud SDK Shell a) runs as a dos window, and b) appears to duplicate the on-line (live) Dashboard. Given that I can't change (local) code and deploy without testing, my questions are:-
1) how do I run a project locally?
2) how do I view local logs?
3) when happy, how do I deploy?
or... is there GUI for the Local Environment?
or... is the above documented somewhere that I have not found?
Many thanks and apologies if this is a dumb question.
David

On July 30, 2019, the standalone App Engine SDK is deprecated. Here you can check documentation how to migrate from AppCft to gcloud command line
How to test your application locally?
For Python you can use Local Development Server that includes Cloud Datastore Emulator. (There is also solution for Java Java 8 Local Development Server).
How to view logs locally?
In python to debug your code from the command line use interactive console. You have to import to your code PDB debbuger
How to deploy application?
You deploy your app with gcloud command gcloud app deploy. Cloud SDK does not include GUI for deployment.

Related

Download sources of existing AppEngine based site using Google Cloud

I have a site hosted in Google AppEngine. For years I was able to download/upload its sources using appcfg.py. However today Google went to Google Cloud, all appcfg related documents are marked as deprecated. I've installed the GCloud environment but cannot find a way how to download my project from google, all I can see is to create a new app and deploy an app but no download possibility.
What is a correct command(s) to download AppEngine app to local computer and then, after changes, upload it back to AppEngine?
There’s currently no way to download the source code using Cloud SDK. You can create a feature request on the issue tracker website.
The appcfg tool is now deprecated, it is recommended to use the Cloud SDK tooling such as gcloud command tool

Can I install "Cloud Tools for Eclipse" without installing "Google Cloud SDK"?

I have used GAE 2 years ago. Now I am setting it up on new machine.
My web application is multi author blog, it will use Datastore for storing data. I want to setup standard environment(and not flexible environment).
I have already installed Java 8(Using Java 8 only because it is latest, I can use Java 7 if required).
I have also downloaded and setup Eclipse Oxygen(again I can change that if it is useful).
I have downloaded and setup 'appengine-java-sdk-1.9.59'.
I wanted to setup App Engine Plugin for Eclipse. Apparently it is deprecated and Cloud Tools for Eclipse is recommended (https://developers.google.com/eclipse/docs/download).
Should I install "Google Cloud SDK"(https://cloud.google.com/eclipse/docs/quickstart) considering the fact that I am developing low volume website and it wont need all that features which SDK might provide?
Can I install "Cloud Tools for Eclipse" without installing "Google Cloud SDK"?
All Google cloud SDKs, including the App Engine SDK, are converging on using the Google Cloud SDK as the delivery mechanism. Yes, you must install the Cloud SDK for use with the Cloud Tools for Eclipse. You will be asked to point to the Cloud SDK directory in Eclipse.

Running Go App Engine apps locally.

I'm trying to run an App Engine app locally using the development server, as specified in Google's docs. I'm running into a ton of compilation errors due to the go library packaged in the SDK missing system libraries.
Looking at the SDK download page, it says:
Note: The Google App Engine Launcher does not work with Go apps.
So is there no way to launch Go apps running on App Engine locally?
The GAE Go SDK contains and uses a modified version of Go 1.6.2., and the context package was added to the standard lib in Go 1.7. The old API that comes bundled in the SDK uses the appengine.Context context.
See related question: AppEngine/Go: Using a new version of Go with the SDK

Application Default Credentials not working locally with App Engine

Having a tough time getting the Default Application Credentials to load in the dataflow SDK when running locally in a java app engine project developing on OS X. Runs fine when deployed.
According to this the dev app server doesn't support them, and you're meant to use the gcloud command line tool's command: gcloud preview app run - but according to the official Google Group for the SDK here that command was deprecated in Jan 2016.
So I seem to be stuck between a rock and a hard place... Does anyone know how to get the Application Default Credentials to work locally with an App Engine app?
I'm trying to use the Dataflow API and it just throws up when it starts making use of the cloud storage api which is the first thing the Pipeline does because it can't seem to load the correct credentials from the environment variables ( that are definitely set on the ENV and in the appengine-web.xml <env-variables> element ) or from the ~/.config/cloud/default_application_credentials.json file.
Cheers!
Can you try running the following command and see if it solves it?
gcloud auth application-default login
This is fully supported (but poorly documented) within the dev appserver. There is a very well answered question that gives you step by step instructions here: Unable to access BigQuery from local App Engine development server

Google App Engine Launcher delete datastore

I am developing a web application using Google AppEngine (GAE).
I have make some examples using dataStore (free, non-relational) using Google AppEngine Launcher (GAEL). All is correct. However I'd like delete the datastore before to deploy an application.
I have read that I have to use the command
--clear_datastore
I don't know like running the server to delete the data store when I deploy or re-deploy the application.
I have chech some ways, for example I have write in the Application Settings(Edit==>Application Settings) in the GAEL some commands:
--clear_datastore
--clear_datastore /<ApplicationName>
--clear_datastore <ApplicationName>/
--clear_datastore <ApplicationName>
any idea?
Thank you.
Jose
The clear_datastore flag is only used to clear the development datastore which is running on your local machine with the dev_appserver. If you want to clear this development datastore, then when you run the dev appserver you can use the flags:
dev_appserver.sh --clear_datastore=yes <ApplicationName>
An important thing to note is that this only clears the development datastore. The development datastore does not get uploaded when you deploy the application. So you shouldn't be worried about clearing the local datastore before deploying the application.
If you want to delete entities that are already in your production server (running on App Engine), then you cannot do this from the command line using dev_appserver.sh. You can do this using the Datastore Admin tool in the AppEngine console. You can follow the instructions here to bulk delete data. An important note is that you have to enable the Datastore Admin tool first by following these instructions.

Resources