Make iRODS commands RPM package relocatable
carrgilson opened this issue · 7 comments
Could the iRODS icommands package be configured to support the relocatable option in the RPM package?
This describes the option:
http://www.rpm.org/max-rpm/ch-rpm-reloc.html
Looks like CPACK_RPM_PACKAGE_RELOCATABLE
should do it.
Would there also be a way to do this with the irods-externals and irods-runtime dependencies of the package too?
FYI, for the purposes of dynamic (run-time) linking, the icommands currently locate the shared libraries contained in the irods-externals package by hardcoding the shared libraries' locations into the icommands' rpath.
If the libraries were moved to another location that is also not included in the list of directories normally checked by the dynamic linker (e.g. moved to somewhere besides /lib
, /usr/lib
, or the other directories ldconfig
has recorded), then there would need to be additional changes made at the OS level to link the icommands against the libraries, e.g. setting LD_LIBRARY_PATH
or having ldconfig
add the new directories to its list of directories searched (e.g. by creating an entry in /etc/ld.so.conf.d/
).
Can you give a brief explanation of how the relocatable packages will be used / what need they are filling? We would like to make using these packages as easy as possible.
I want to have the ability to house the commands and all dependent libraries within a single directory structure which will likely be a common network location mounted across an array of machines in an HPC cluster.
If a user needs to use the icommands, they run a command which adds the appropriate path to the applicable environment variables.
The requirement exists so that work-flows can be designed to be independent of the operating system and any OS-bundled software libraries.
We have exactly the same use case at the cluster that I manage. Maybe you could statically link the libraries and provide that as a separate, relocatable RPM?
I have successfully run the icommands on a centos 7 machine with all irods packages installed to the new root directory of /new/root/dir/for/irods/packages
.
Install relocated irods-externals
dependencies:
sudo rpm --import https://packages.irods.org/irods-signing-key.asc
wget https://packages.irods.org/yum/pool/centos7/x86_64/irods-externals-libarchive3.1.2-0-1.0-1.x86_64.rpm
sudo rpm -i irods-externals-libarchive3.1.2-0-1.0-1.x86_64.rpm --relocate /=/new/root/dir/for/irods/packages
wget https://packages.irods.org/yum/pool/centos7/x86_64/irods-externals-avro1.7.7-0-1.0-1.x86_64.rpm
sudo rpm -i irods-externals-avro1.7.7-0-1.0-1.x86_64.rpm --relocate /=/new/root/dir/for/irods/packages
wget https://packages.irods.org/yum/pool/centos7/x86_64/irods-externals-boost1.60.0-0-1.0-1.x86_64.rpm
sudo rpm -i irods-externals-boost1.60.0-0-1.0-1.x86_64.rpm --relocate /=/new/root/dir/for/irods/packages
wget https://packages.irods.org/yum/pool/centos7/x86_64/irods-externals-clang-runtime3.8-0-1.0-1.x86_64.rpm
sudo rpm -i irods-externals-clang-runtime3.8-0-1.0-1.x86_64.rpm --relocate /=/new/root/dir/for/irods/packages
wget https://packages.irods.org/yum/pool/centos7/x86_64/irods-externals-jansson2.7-0-1.0-1.x86_64.rpm
sudo rpm -i irods-externals-jansson2.7-0-1.0-1.x86_64.rpm --relocate /=/new/root/dir/for/irods/packages
wget https://packages.irods.org/yum/pool/centos7/x86_64/irods-externals-zeromq4-14.1.3-0-1.0-1.x86_64.rpm
sudo rpm -i irods-externals-zeromq4-14.1.3-0-1.0-1.x86_64.rpm --relocate /=/new/root/dir/for/irods/packages
Install normal irods dependencies:
sudo yum install python-psutil python-requests python-jsonschema
Build, and then install irods and the icommands (post relocatable RPMs commit)
sudo rpm -i irods-devel-4.2.1-1.x86_64.rpm --relocate /=/new/root/dir/for/irods/packages
sudo rpm -i irods-runtime-4.2.1-1.x86_64.rpm --relocate /=/new/root/dir/for/irods/packages
sudo rpm -i irods-icommands-4.2.1-1.x86_64.rpm --relocate /=/new/root/dir/for/irods/packages
Add relocated icommands to the PATH
:
export PATH=$PATH:/new/root/dir/for/irods/packages/usr/bin
Running the icommands requires telling them where to find the shared objects, which I did by setting the LD_LIBRARY_PATH
and IRODS_PLUGIN_HOME
environment variables:
env LD_LIBRARY_PATH=/new/root/dir/for/irods/packages/opt/irods-externals/avro1.7.7-0/lib:/new/root/dir/for/irods/packages/opt/irods-externals/boost1.60.0-0/lib:/new/root/dir/for/irods/packages/opt/irods-externals/clang-runtime3.8-0/lib:/new/root/dir/for/irods/packages/opt/irods-externals/libarchive3.1.2-0/lib:/new/root/dir/for/irods/packages/opt/irods-externals/zeromq4-14.1.3-0/lib:/new/root/dir/for/irods/packages/usr/lib IRODS_PLUGIN_HOME=/new/root/dir/for/irods/packages/usr/lib/irods/plugins/network iinit
env LD_LIBRARY_PATH=/new/root/dir/for/irods/packages/opt/irods-externals/avro1.7.7-0/lib:/new/root/dir/for/irods/packages/opt/irods-externals/boost1.60.0-0/lib:/new/root/dir/for/irods/packages/opt/irods-externals/clang-runtime3.8-0/lib:/new/root/dir/for/irods/packages/opt/irods-externals/libarchive3.1.2-0/lib:/new/root/dir/for/irods/packages/opt/irods-externals/zeromq4-14.1.3-0/lib:/new/root/dir/for/irods/packages/usr/lib IRODS_PLUGIN_HOME=/new/root/dir/for/irods/packages/usr/lib/irods/plugins/network ils
Please let us know if this doesn't work, or if this is not a solution for your use case.
closing - please open a new issue if this is not behaving as expected.