Bug 1012590

Summary: Installing python dependency for django app fails to install relevant C library dependencies
Product: OpenShift Online Reporter: moxious
Component: ContainersAssignee: Rob Millner <rmillner>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: high    
Version: 2.xCC: bmeng, mfisher
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-17 13:32:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description moxious 2013-09-26 17:01:41 UTC
Description of problem:

When a django app requests the dependency named 'extractor', openshift installs the correct python modules but fails to install the C libraries (libextractor) necessary to support this library.  The result is that the python library is present at runtime, but completely non-functional.

Version-Release number of selected component (if applicable):


How reproducible:

Via adding the 'extractor' dependency, and attempting to use it.

Steps to Reproduce:
1. add 'extractor' to django app dependencies
2. deploy django app
3. Run sample script found here, which uses the extractor library https://www.openshift.com/forums/openshift/missing-shared-object-file-from-python-module#comment-34365

Actual results:
OSError raised by the python interpreter when it fails to load the shared object file corresponding to the missing C libraries.

Expected results:

OpenShift should install relevant C libraries, as 'extractor' is a set of python bindings for libextractor.  When running the sample script, it should not fail with an error, but rather print out a list of metadata associated with input files.

Additional info:

For more details, see this forum posting which includes a discussion of this problem.  In this discussion, one of the support techs (Nam Duong) solicited this bug report.

https://www.openshift.com/forums/openshift/missing-shared-object-file-from-python-module

Comment 1 Rob Millner 2013-09-26 18:45:00 UTC
Reviewed the Extractor python egg.  It expects libextractor to be installed in the OS and neither provides it or has a listed dependency on it.  

Fedora has an RPM for libextractor.  RHEL 6 does not, even via EPEL.

I'll see what we can do with it.

Comment 2 Rob Millner 2013-09-26 20:06:09 UTC
I've been able to backport libextractor-0.6.3 from Fedora 18 to RHEL 6 (required backporting zzuf).  It seems to produce a usable build with just the RHEL, Optional and EPEL repositories as dependencies.

The version of Extractor in PyPi (0.5) is very old and wants version 1 of the library.  There's a version of python's Extractor in the libextractor site that's compatible with 0.6.3 and is likely the source used for the Ubuntu package.  We should be able to package up the newer version of Extracter and ship it as an RPM as well that will supersede the PyPi version.

Comment 3 Rob Millner 2013-09-26 23:47:56 UTC
Packaging work is under way to include these in OpenShift Online.

Comment 4 Rob Millner 2013-09-27 20:55:46 UTC
Packages are complete.  Waiting on them to matriculate through the system.

Comment 5 Rob Millner 2013-09-30 19:48:00 UTC
Packages are available in our development environment.  The following pull request brings them in and there's a corresponding entry in the release plan for installing.
https://github.com/openshift/li/pull/1938

Comment 6 openshift-github-bot 2013-09-30 21:59:01 UTC
Commit pushed to master at https://github.com/openshift/li

https://github.com/openshift/li/commit/07015944e5ea419716984ec381fa07edbc84ff51
Bug 1012590 - Add python-extractor to the build.

Comment 7 Meng Bo 2013-10-04 11:01:28 UTC
Checked on devenv_3864, issue has been fixed.

1.Add django and extractor to the python app setup.py
2.Git push

remote: Searching for Extractor==0.6
remote: Best match: Extractor 0.6
remote: Adding Extractor 0.6 to easy-install.pth file

3.SSH login to the app,

Use the python script from this article https://www.openshift.com/forums/openshift/missing-shared-object-file-from-python-module

4. [py1-bmengdev.dev.rhcloud.com data]\> python test.py Z8TM.jpg 
Keywords from Z8TM.jpg:
mimetype - image/jpeg
image resolution - 1x1 dots per inch?
comment - CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90

image dimensions - 600x399
image dimensions - 600x399
mimetype - image/jpeg
image dimensions - 600x399


Extractor works well.