BIGTOP-3568: Fix Ambari-2.7.5 RPM installation issues#796
Conversation
Find correct python version path to create soft links for resource_management and jinja. Change-Id: I15d95839a0be9afffc3f4306457b17f38acdbbdb Signed-off-by: Yuqi Gu <yuqi.gu@arm.com>
|
|
||
|
|
||
| RESOURCE_MANAGEMENT_DIR="/usr/lib/python2.6/site-packages/resource_management" | ||
| PYPATH=`find /usr/lib -maxdepth 1 -name 'python*'` |
There was a problem hiding this comment.
This looks unstable if multiple python packages are installed. I think it is not so rare on CentOS 7/Cent OS 8.
# find /usr/lib -maxdepth 1 -name 'python*'
/usr/lib/python2.7
/usr/lib/python3.6
There was a problem hiding this comment.
Yes,there may be multiple python-lib existed in /usr/lib.
The result of find /usr/lib -maxdepth 1 -name 'python*' is always sorted as python2.x, python3.x, etc.
And PYLIB_DIR=echo ${PYPATH} | awk '{print $1}'`` will always select first installed one (python2.7, ) for creating synbolic links.
Python binary (/usr/bin/python) is always link to the first installed python version:
/usr/bin/python -> python2
And in some envrionment ( like our puppet docker image:bigtop/puppet:trunk-centos-8), there is no python binary installed, but python lib directory is available:
whereis python
python: /usr/lib/python3.6 /usr/lib64/python3.6 /usr/include/python3.6m /usr/share/man/man1/python.1.gz
We could not get python version by the bash command python -V.
So I directly find the first installed python-lib directory to create synbolic links for resource_management and jinja.
IMO, it's the balanced approach among various environments, or do you have other good suggestions? Thanks.
There was a problem hiding this comment.
The result of find /usr/lib -maxdepth 1 -name 'python*' is always sorted as python2.x, python3.x, etc.
Hmm. This did not stand on one of my CentOS environment.
$ find /usr/lib -maxdepth 1 -name 'python*'
/usr/lib/python3.6
/usr/lib/python2.7
/usr/lib/python2.6
Should we have explicit sort?
$ find /usr/lib -maxdepth 1 -name 'python*' | sort
/usr/lib/python2.6
/usr/lib/python2.7
/usr/lib/python3.6
|
I got 2 issues on (re)installing ambari-server on CentOS 7.
|
In rpm spec: These links will be removed when install rpm installation. And no issues occurred by directly using |
Change-Id: I3bef1bee9fa42abbae875c53400356eb3df4fd9d Signed-off-by: Yuqi Gu <yuqi.gu@arm.com>
The RESOURCE_MANAGEMENT_DIR is symbolic link (created by the RPM) and left after uninstall. It causes error on reinstall. You can reproduce the issue by docker provisioner. |
|
Installing ambari-server created /resource_management linked to RESOURCE_MANAGEMENT_DIR. This looks unintentional. |
iwasakims
left a comment
There was a problem hiding this comment.
anyway the original issue reported on BIGTOP-3568 was addressed. You can address issues on uninstall/reinstall in follow-up JIRA.
|
Thanks, @iwasakims |
Find correct python version path to create soft links for
resource_management and jinja.