Bug 1012721
Summary: | no way to use an internal python mirror with python-2.6 cartridges in OSE | ||||||
---|---|---|---|---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | August Simonelli <asimonel> | ||||
Component: | Containers | Assignee: | Brenton Leanhardt <bleanhar> | ||||
Status: | CLOSED ERRATA | QA Contact: | libra bugs <libra-bugs> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 1.2.1 | CC: | asimonel, baulakh, cryan, jialiu, libra-onpremise-devel, mpatel, xiama, yanpzhan | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | openshift-origin-cartridge-python-0.4.8.2-1.el6op | Doc Type: | Enhancement | ||||
Doc Text: |
Previously in OpenShift Enterprise there was no way of using an internal Python mirror with Python-2.6 cartridges where internet access was not available. The Python cartridge can now have an internal mirror enabled by using the $OPENSHIFT_PYPI_MIRROR_URL setting. Changing this setting in /etc/openshift/env/OPENSHIFT_PYPI_MIRROR_URL on a node host is recommended as this will make it available for all gears. However, it can be set in a gear's action hook if desired.
|
Story Points: | --- | ||||
Clone Of: | |||||||
: | 1014339 (view as bug list) | Environment: | |||||
Last Closed: | 2013-10-16 15:39:41 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: | |||||
Embargoed: | |||||||
Bug Depends On: | 1014339 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
August Simonelli
2013-09-27 02:32:29 UTC
Can the internal server be a proxy? Setting the HTTP_PROXY and HTTPS_PROXY environment variables worked as expected with setup.py. You could set them for all gears by creating /etc/openshift/env/HTTP{,S}_PROXY files with the content being the company's internal proxy. Otherwise it could likely be set in a pre_build action hook for only that gear. We set the python mirror in the build for python cartridge. We should allow deployments to customize the mirror by setting an enviroment variable under /etc/openshift/env and then make the python cartridge use that variable. We could name it as OPENSHIFT_PYPI_MIRROR_URL or something similar. Thanks, Mrunal Created attachment 805214 [details] support for setting OPENSHIFT_PYPI_MIRROR_URL Here's how to apply this: cd /var/lib/openshift/.cartridge_repository/redhat-python/0.0.1/ patch -p3 < /path/to/BZ1012721.patch The expected output is: patching file versions/2.6/bin/control patching file versions/shared/bin/build To undo this change you can apply the patch in reverse: cd /var/lib/openshift/.cartridge_repository/redhat-python/0.0.1/ patch -R -p3 < /path/to/BZ1012721.patch Once that is complete you can set /etc/openshift/env/OPENSHIFT_PYPI_MIRROR_URL. The content of that file should be a url to a PyPi index. Mrunal let me know what you think of the patch. I see no reason why we couldn't set OPENSHIFT_PYPI_MIRROR_URL for all Nodes in Online and avoid using the hardcoded rhcloud approach. Hi, Brenton, Yes, the patch looks good and makes sense to use for Online as well. Thanks, Mrunal August, let us know if this will solve the customer's problem and we'll upstream the patch and get it into OSE. This works well in my tests and would be of GREAT benefit! OK, I'll work to get this upstream and then backport to OSE. We should be able to release it with 1.2.4 in just a few weeks. See the test cases for the upstream bug on how to test this. I have verified it on puddle [1.2/2013-10-03.1]: 1.create a python app #rhc app create pythonapp python-2.6 2.set OPENSHIFT_PYPI_MIRROR_URL on Node #echo http://mirror1.ops.rhcloud.com/mirror/python/web/simple >>/etc/openshift/env/OPENSHIFT_PYPI_MIRROR_URL 3.configure setup.py file #setup.py from setuptools import setup setup(name='YourAppName', version='1.0', description='OpenShift App', author='Your Name', author_email='example', url='http://mirror1.ops.rhcloud.com/mirror/python/web/simple', install_requires=['Django==1.4.2'], ) 4.git push Output: remote: Reading http://mirror1.ops.rhcloud.com/mirror/python/web/simple/Django/ remote: Best match: Django 1.4.2 remote: Downloading http://mirror1.ops.rhcloud.com/mirror/python/web/packages/source/D/Django/Django-1.4.2.tar.gz#md5=6ffecdc01ad360e1abdca1015ae0893a remote: Processing Django-1.4.2.tar.gz remote: Running Django-1.4.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-UPFOML/Django-1.4.2/egg-dist-tmp-1ITGbx Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-1435.html |