App Engine Launcher and Django - google-app-engine

I have running an APP on Google App Engine that I developed in Python and used Django template data display. I used Launcher to test and deploy. I did not use such Django verbs as {% url etc etc %}. It was all good and well.
I now need to do some work on an existing APP on Google App Engine that is Django based and uses the many more Django verbs.
It fails to run on Launcher.
I read that you use something like manage.py runserver and I think Launcher is not capable of supporting my development testing on this one. Is there a way so Launcher can?
I am not quite sure what environment for test I am going to use ??

I have found the answer you ad the line # coding: utf-8 to all the Python programs including helper.py. You must used latest or above 1.6 for Google Launcher.

Related

Why did Google remove Image API for App Engine running Python 3.7?

I am using Google Cloud Storage and I want to serve scaled images from it, Python 2 version of Google App Engine supported it via Images API but with Python3, they removed that API.
https://cloud.google.com/appengine/docs/standard/python3/python-differences
Cannot understand the intension behind removing such an import feature, upgrading to Python3 in Google Cloud environment sounds like a downgrade to me.
As you said, the proprietary App Engine APIs are not available in Python3.7. The main reason is because GCP is unbundling App Engine and now, you are no longer dependent on these APIs.
Currently, there are some third parties alternative solutions. In your specific case, and based on GCP documentation, I think that you can try to use Imgix or Rethumb.
Seems like Google is planning on adding it back to Python 3:
https://cloud.google.com/appengine/docs/standard/python3/services/access
To reduce runtime migration complexity, Google Cloud now supports a set of App Engine bundled services and their associated APIs on second-generation runtimes, which include Python 3, Java 11, and Go 1.12 or higher. Your app can call bundled services APIs for second-generation runtimes through language-idiomatic libraries.

How to deploy a SpringBoot REST Application to Google App Engine?

Tried
Subscribed trial for GoogleAppEngine.
1. INSTALLED GOOGLE APP ENGINE SDK
2. Downloaded the sample Java started code and deployed it. Working fine.
3. Used $appcfg.sh -A <appname> update target/appengine-try-java-1.0 to deploy
4. In this case, its a folder with all the webapp related stuffs
Question
In my case, I have a spring boot application which generates a jar file. It runs with a embedded container and I believe Google may have an alternate to deploy using Docker or some other way. But how?
There is no pointer or any details on how to run this in Google managed platform as far as I searched.
Any help or reference to documentation!! Alternates??
You can now use Google App Engine Java Flexible Environment - Java 8 Runtime:
https://cloud.google.com/appengine/docs/flexible/java/dev-java-only
It is Docker based
UPDATE:
You can now use Java 8 in App Engine Standard Environment:
Tutorial:
https://codelabs.developers.google.com/codelabs/cloud-app-engine-springboot/index.html
Example:
https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/appengine-standard-java8/springboot-appengine-standard
Blog post:
https://cloudplatform.googleblog.com/2017/09/Java-8-on-App-Engine-Standard-environment-is-now-generally-available.html
Google App Engine still uses Servlet 2.5 that is below the requirements of Spring Boot (i.e. Servlet 3.0).
There is a way to workaround that, check the documentation for more details
Spring Boot requires Servlet 3.0 which GAE does not have. WorkAround is to have a "spring-boot-legacy" dependency. You can check further how to implement: https://github.com/scratches/spring-boot-sample-gae

Mixing existing website with Google App Engine

If I want to use Jinja templating with GAE, is there a way to do that from my hosted website? I don't want to run the entire website on appspot.com.
If my host has python installed, I should be able to install Jinja there as well? In that case, I'm guessing my templating code will still work but anything in the app.yaml and main.py will not since I'll basically not be using GAE.
You can definitely use Jinja on any python web framework -- here's just one example I found of a tutorial using Jinja without app engine. Jinja is just an HTML templating library that's host/web platform independent.

Phantomjs integration with Google App Engine

Hi I like to know if it is possible to run phantomjs on Google App Engine.
My use case is to use Phantomjs to take snapshots of html pages served on GAE using a cron job.
Has this been done before ?
Google App Engine supports a number of language runtimes (Java, Python, PHP and Go), but you can use the Managed VMs feature of Google App Engine to run anything in a Docker container (such as PhantomJS), and you can also use Google Compute Engine to get a VM where you can also install anything you would like, in any language.
For reference, here's a tutorial for running Node.js on Managed VMs to help guide you in the right direction.
Alternatively, Google Cloud Run lets you run arbitrary stateless containers pn a serverless platform, so you can run your PhantomJS app there if you wish.
You cannot run phantomjs on Google App Engine.
Currently, Google App Engine supports Java, Python, PHP, and Go. (https://cloud.google.com/appengine/kb/?hl=en)
As #artjom-b mentioned you can use some services that aren't written in the supported languages (like memcache), but phantomjs is not one of them.
If you are asking about testing an application that you are building on Google App Engine, it is possible to run phantomjs tests against a google app engine application. You would just need to run phantomjs on a different service, such as an EC2 instance.

Deploy Dropwizard on Google AppEngine

I have been trying to find a way to deploy a Dropwizard app on Google AppEngine, but I haven't found anything so far.
Judging by this question (and answer) I think it might not be possible.
I would like to be sure about that, and If it does work, I'd like to learn how.
There is a dropwizard fork called warwizard which apparently lets you create war files from your dropwizard code, but it has not been touched for over 6 months, which would likely make it difficult to work with using the dropwizard docs.
Dropwizard is just Jersey+Jackson+Jetty bundled together nicely. Jetty and App Engine won't get along (that is, App Engine is already running Jetty, so it doesn't want the application to provide its own).
You're probably best off using Jersey and Jackson without Dropwizard tying them together: http://blog.iparissa.com/googles-app-engine-java/google-app-engine-jax-rs-jersey/ & http://www.cowtowncoder.com/blog/archives/2009/11/entry_338.html
You can however, run Dropwizard on Google Compute Engine. Which is basically just linux VMs provided by Google, with access to their APIs if needed.
I manged to get my Dropwizard instance working by doing the following on GCE:
Install Java
sudo apt-get install java7-runtime-headless
Open firewall ports:
gcutil addfirewall rest --description="http" --allowed="tcp:8080
gcutil addfirewall admin --description="admin" --allowed="tcp:8081"
Copy file to GCE
gcutil --project={project-id} push {instance-name} {local-file} {remote-target-path}
Run your app
java -jar your-app.jar server your-config.yml
EDIT: there is also another alternative called wiztowar https://github.com/twilio/wiztowar which supports DW 0.6.2 only.
I've been trying to solve this issue for the past two month. Here are my findings:
1- Yes, you can deploy Dropwizard as a WAR file. You need to use some hacks like Wizard in a box or WizToWar
2- No! You can't deploy that WAR file on AppEngine standard environment.
Why?
The main issue is that AppEngine is using servlet-api v2.5 (which is more than 10 years old!) and has no plan to upgrade to servlet-api v3 or higher. Dropwizard on the other hand require servlet-api v3 or higher.
BUT wait! there is another option
You can deploy Dropwizard on App Engine Flexible Environment
App Engine Flex is still in beta, but I've heard it will be available for public usage in Q1 2017. If you want to use it now, you have to ask for that to be enabled for you.
How do you deploy on App Engine Flex?
-> I've put all the steps on doing that in a blog post here:
Deploying Dropwizard on App Engine Flex

Resources