Phantomjs integration with Google App Engine - 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.

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 emulate Google cloud tasks service locally in app engine flex (Python 3.7)?

I have been using Google App Engine Standard Environment(Python 2.7) since some days now. It provides a good local development server, providing Task queues, datastore and other services locally.
Recently i have been exploring App Engine Flex Environment (Python 3.7) for some of the projects. Within that i am trying use various services like Cloud Tasks, GCS, Pubsub etc. Some of the services like pubsub has an emulator to run it locally. I couldn't find such emulator for cloud tasks.
Is there any way to emulate/simulate Cloud Tasks locally?
I just built an emulator, see if it meets your needs.
Unfortunately, local server emulator is not available for App Engine Flex Environment (Python 3.7) [1] However you can use Cloud Pub/Sub in some cases as workaround [2].
[1] https://cloud.google.com/tasks/docs/migrating#features_in_task_queues_not_yet_available_via
[2] https://cloud.google.com/tasks/docs/comp-pub-sub
I built an in-process emulator for Python development.
See also some emulators that run in a separate process in localhost: Potato London’s gcloud-tasks-emulator and Aert van de Hulsbeek’s cloud-tasks-emulator, mentioned in the answer above.

Google App Engine vs Tomcat

I was able to create the basic 'hello world' program.
When I tried to understand the difference between a cloud and a server I learned that Cloud is where you have an access to virtual instance created exclusively for you and you are free to choose and install software of your choice.Why Google App Engine(GAE) is used widely where as tomcat is not used. What are major differences between GAE and Tomcat?
Cloud is Google Cloud Platform at this case. App Engine is just one of their services.
App Engine is a platform to build your apps on top of it. A Platform As A Service or PaaS. It simplifies the process of building a scalable application, and you should use it when you understand what you really need and understand principles of scalable application.
Tomcat is a Java web container, and there're many alternatives. Google App Engine is using Jetty. You could actually use it with Tomcat by using Flexible VM, though it doesn't make much sense.
App Engine is not about web server, it's a set of services that helps you to build a scalable app. It includes Memcache, Datastore, Task Queue, Images API, deployments tools and versioning, CDN for static files, and most important automatic scale.
Actually you aren't limited to App Engine on Google Cloud Platform. There is more traditional service, like own server in the cloud, called Compute Engine. There you can run your Tomcat or anything else.

Why App Engine running Rails app spins up Compute Engine instances?

I am running Rails on the App Engine. My question is why Google is running the Compute Engine. I just want to run the App Engine. Google starts the App Engine and the Compute Engine when I deploy.
App Engine provides two environments - standard "sandboxed" environment and Managed VMs. Currently the standard environment supports only Java, Python, PHP and Go. If you want to use something else, you have to go with Managed VMs. In fact, Managed VMs are Google Compute Engine virtual machines.
You can find more details here.

App Engine Launcher and Django

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.

Resources