Google app engine to run executable files - file

Is it possible to run executable files in google app engine? Like by using Runtime.exec?
There is whitelist on google app engine documentation which list classes that can be used but functions/ inside the classes are not specified.

No, absolutely not.

The only thing that make AppEngine possible is that both the Python and Java environments are controlled by Google so that performance/scability and security issues are minimized. They don't even allow to use all the standard Java/Python classes, so imagine the problems that could arise if they let people run any executable file. One may even be a virus!

Related

cannot find package "appengine/cloudsql"

I develop some GO libraries using Google Cloud SQL and MySQL server. When I imported `appengine/cloudsql, an error below occured.
cloud.go:20:2: cannot find package "appengine/cloudsql" in any of:
/usr/local/Cellar/go/1.1.2/src/pkg/appengine/cloudsql (from $GOROOT)
/Users/lameduck/myGo/src/appengine/cloudsql (from $GOPATH)
I know this package, appengine/cloudsql, is only for Google App Engine and it doesn't exist on everywhere else.
I'm wondering how can I use it for GAE and standard sql library for other environments in a single library.
PS: I can setup Google App Engine SDK correctly. My question is not relevant to it. I hope my library runs on Google App Engine and standalone environment together. (I already made a code for GAE and a code for other dabatases.) It is Ok that users have to setup some configurations. But I don't want that users have to modify a library source code.
Thanks for any help.
I solved the problem. I used a build constraint to use the proper routine and avoid an error. There is a build constraint for App Engine, appengine.
The App Engine SDK introduces a new build constraint term:
"appengine". Files that specify
// +build appengine will be built by the App Engine SDK and ignored by
the go tool. Conversely, files that specify
// +build !appengine are ignored by the App Engine SDK, while the go
tool will happily build them.
PS:
Anway, I upvoted other answers. Thank you.
Package import is done during compile/link time. And Go doesn't support runtime conditional imports in distinction from Python.
Feature you are looking for is dynamic library loading (like in C/C++ you can load .so/.dll in runtime), but Go currently doesn't support it.

Making a Go Webapp independent of Google App Engine

This question comes from working on my webapp, a feed reader written in Go. The code is available at http://github.com/matthewbauer/rivulet although that should not be necessary to answer the question.
I have a webapp written in Go that is running on Google's App Engine. It uses the usual common App Engine libraries like datastore, memcache, and user.
Is there any way to let my users run this app on their own without breaking App Engine compatibility?
Go now provides build constraints that exclude/include files based on target build platform:
// +build !appengine
So, I know that this is possible. But, my biggest problem is with my libraries that depend on App Engine: datastore, memcache, and user. I know other libraries provide datastore and memcache, and I can implement user on my own, but how would I go about wrapping it up?
I know that I can have them set up a development server with the SDK, but that might be too involved for some users. I want a single executable that normal Go projects provide. IS that possible?
If any examples exist, I haven't found them yet; any examples of App Engine independent webapps would be appreciated. I can learn by example.
You will probably have refactor your code.
The basic rule of thumb will be anywhere you depend on an AppEngine package define your own interface for the way you use it. This will allow you decouple the app from the appengine libraries.
Once you've defined those interfaces then you can start providing alternatives that satisfy the interfaces. You'll be able to plugin any Datastore or Memcache that satisfies the interfaces and your app will be able to both run on appengine or as a standalone with the alternatives.

Importing C python module in Google App Engine

I am developing an application on Google app engine using Python. I want to use editdist feature of Python and for that reason I am importing editdist C python module in my program, but it is showing that module editdist does not exist.
When I import editdist for my local application it is working fine but not for Google app engine application.
Can anyone suggest me a method to import this module?
App Engine is a "pure python" environment, and you cannot use any C extensions or other code that must be compiled.
There is therefore no way to use this program on App Engine, and all of the competing "production quality" python libraries I found were implemented as C modules.
There do exist alternate implementations of the Levenshtein distance algorithm, though none are as nearly as fast as editdist. These more naïve implementations might still be acceptable depending upon your needs.
Here could be couple alternatives that are implemented with Python (I haven't tested them myself):
http://www.korokithakis.net/node/87
http://code.activestate.com/recipes/576874-levenshtein-distance/

Uploading a simple web2py app to GAE

I created a web2py app that is extremely light, with the goal of eventually making the app support JSON-RPC calls, and maybe a few other things.
I found some tutorial online that (on winxp) had me get the source code for web2py and extract it on top of the compiled program. At the top level, I edited app.yaml with my program name and used the GAE SDK to upload the program. It looks like that uploaded everything including example applications. I think it's including a whole gluon directory, and other dir's full of py files. Is there a way to setup web2py to only upload my application, and what's minimally required to run it?
The app.yaml that comes with web2py includes a section skip_files and it should contain, among others, this line:
(applications/(admin|examples)/.*)|
You can change it to
(applications/(admin|examples|welcome)/.*)|
So that welcome app is not deployed. You add more apps that you may have and do not want deployed.
At minimum you need:
web2py/gaehandler.py
web2py/gluon/* (and subfolders, this is web2py)
web2py/applications/theoneappyouwanttodeploy/* (and subfolders)

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