Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

[TO_STAGE] Fix pip cache directory permission denied #6430

Merged
merged 3 commits into from
Dec 12, 2016

Conversation

tiwillia
Copy link
Member

@tiwillia tiwillia commented Nov 7, 2016

This should resolve issue #6390

For Python 2.7, a new version of PIP (7.1.0) attemps to write into .cache
directory in gear's home directory which will cause permission denied error.
Users do not have permission to create files or folders in gear's home directory.
The .cache directory needs to be created during the installation process. As
a result, a piece of code is added to "install" script to create .cache dir
before pip install step happens to address the issue.

Bug 1361755
Link https://bugzilla.redhat.com/show_bug.cgi?id=1361755

Signed-off-by: Vu Dinh <vdinh@redhat.com>
@raditv
Copy link

raditv commented Nov 8, 2016

👍 I hope it will be merged soon

@thrasher-redhat
Copy link
Contributor

[test]

@tiwillia
Copy link
Member Author

Added a python version bump from master.

Also added the previous version to the compatible-version list ONLY for stage to avoid a gear migration. We'll need to come up with a script to run against PROD that creates the $GEAR_HOME/.cache directory for each existing python-2.7 cartridge with the correct selinux contexts and unix permission bits.

@tiwillia
Copy link
Member Author

Lets [test] again with the most recent change please.

@openshift-bot
Copy link

Evaluated for online test up to 0a76c19

@openshift-bot
Copy link

Online Test Results: SUCCESS (https://ci.dev.openshift.redhat.com/jenkins/job/test_pull_requests_generic/764/) (Base Commit: 3218c23)

@sferich888
Copy link
Contributor

@raditv
Copy link

raditv commented Nov 14, 2016

@sferich888 it should work, thank you bro! I'll try it

@tiwillia
Copy link
Member Author

@sferich888 @raditv I don't understand what that blogpost is suggesting that differs from how we are already loading the virtual env. In a python 2.7 cartridge we use the below by default:

virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/'
virtualenv = os.path.join(virtenv, 'bin/activate_this.py')
try:
    execfile(virtualenv, dict(__file__=virtualenv))
except IOError:
    pass

Its hard to read in the blogpost so maybe I'm reading incorrectly, but the blogpost suggests the exact same thing for python-2.7. The way it is loading the virtenv differently is suggested for python-3.3.

@tiwillia
Copy link
Member Author

tiwillia commented Dec 5, 2016

I've confirmed with @sferich888 that no known workaround exists, we'll definitely need to get this change in.

@wshearn
Copy link
Contributor

wshearn commented Dec 12, 2016

[merge]

@openshift-bot
Copy link

Evaluated for online merge up to 0a76c19

@openshift-bot
Copy link

openshift-bot commented Dec 12, 2016

Online Merge Results: SUCCESS (https://ci.dev.openshift.redhat.com/jenkins/job/test_pull_requests_generic/778/) (Base Commit: f6a9e18) (Image: devenv-stage_1228)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants