[Python] native code extension support?

42 views
Skip to first unread message

Corey

unread,
Sep 10, 2011, 10:21:08 PM9/10/11
to AppScale Community
What would be required to use AppScale with python libraries that wrap
native code (e.g. OpenCV)?

I understand that this limits the portability of said application to a
private cloud.

Navraj S. Chohan

unread,
Sep 11, 2011, 2:01:51 AM9/11/11
to appscale_...@googlegroups.com
Hello Corey,
Thanks for your interest in AppScale. You can enable python libraries by white listing them in the AppServer. This requires you to mount the image and edit the following file:
/root/appscale/AppServer/google/appengine/tools/dev_appserer.py
Search for WHITE_LIST_C_MODULES and add it in.

Additonally, because OpenCV is not installed on the image, you would have to install it on the image via apt-get or source.

Thanks,
Raj


--
You received this message because you are subscribed to the Google Groups "AppScale Community" group.
To post to this group, send email to appscale_...@googlegroups.com.
To unsubscribe from this group, send email to appscale_commun...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/appscale_community?hl=en.




--
Navraj Chohan (Raj)


Philip Teare

unread,
Jun 11, 2012, 11:03:58 AM6/11/12
to appscale_...@googlegroups.com
now in /root/appscale/AppServer/google/appengine/tools/dev_appserer_import_hook.py right?


On Sunday, September 11, 2011 7:01:51 AM UTC+1, Raj wrote:
Hello Corey,
Thanks for your interest in AppScale. You can enable python libraries by white listing them in the AppServer. This requires you to mount the image and edit the following file:
/root/appscale/AppServer/google/appengine/tools/dev_appserer.py
Search for WHITE_LIST_C_MODULES and add it in.

Additonally, because OpenCV is not installed on the image, you would have to install it on the image via apt-get or source.

Thanks,
Raj

On Sat, Sep 10, 2011 at 7:21 PM, Corey <> wrote:
What would be required to use AppScale with python libraries that wrap
native code (e.g. OpenCV)?

I understand that this limits the portability of said application to a
private cloud.

--
You received this message because you are subscribed to the Google Groups "AppScale Community" group.
To post to this group, send email to appscale_community@googlegroups.com.
To unsubscribe from this group, send email to appscale_community+unsub...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/appscale_community?hl=en.

Philip Teare

unread,
Jun 13, 2012, 8:00:42 AM6/13/12
to appscale_...@googlegroups.com
Bump!

So I know where to find the white list. And I've added zmq.  But my import fails.

I've tried a bunch of stuff. I'd like to use the lib from the site-packages folder (default install path for the lib), but that tends to come back with:
ImportError: No module named zmq
even if I add this to my code:

sys.path.append('/usr/lib/python2.5/site-packages/')


If I try to import via python commandline it imports just fine.

So I put the lib in /usr/lib/python2.5/zmq, which it could find and begin importing!, but the lib bugged out for some reason, as the lib itself can't be run from there.

I tried amending this:

  ALLOWED_SITE_PACKAGE_DIRS = set(

      os.path.normcase(os.path.abspath(os.path.join(SITE_PACKAGES, path)))

      for path in [ [os.path.join('zmq')],

          GeneratePythonPaths('zmq', '__init__'),

          ])

No joy.

If I have to keep the lib in site-packages, what else do I need to do. Must I add each module in the package to the whitelist? 

Any help much appreciated

Phil

Reply all
Reply to author
Forward
0 new messages