CompilingXRootDCeph

  • Set up a dedicated RPM build host

    • Create an OpenStack VM host

    • Using aquilon:

    • On aquilon.gridpp.rl.ac.uk

      • Create a new aquilon sandbox: aq add_sandbox --sandbox build_xrootd_ceph

      • Pull the created VM to this sandbox: aq manage --hostname VM_FQDN --sandbox your_fedid/build_xrootd_ceph

      • Set CEPH_RELEASE, CEPH_VERSION and XROOTD_VERSION variables in ./ral-tier1/features/development/packaging/rpm/config.pan as required

      • Compile the VM with the rpm-build-environment personality: aq make --hostname <FQDN> --personality rpm-build-environment

    • Without aquilon:

      • install prerequisites manually (see prerequisites article)

 

  • All the following steps are to be carried out on the RPM build host

 

  • Set up the rpm developnent tree in the root directory: rpmdev-setuptree

 

  • Create dirs for the cloned xrootd-ceph git repo and the xrootd-ceph source rpm: mkdir xrootd-ceph-dev xrootd-ceph-srpm

 

 

  • Optional: If the xrootd-ceph changes are in a branch other than the master branch, check out to this branch

    • cd xrootd-ceph/packaging/

    • git checkout branch_name

 

  • In xrootd-ceph/packaging dir, create the source rpm: ./makesrpm.sh --output /root/xrootd-ceph-dev/xrootd-ceph-srpm --version 5.3.4-1 (replace verions as necessary) [--rename xrootd-buffered] (renames the rpm package to enable alternate versions)

 

  • Check for any missing dependencies: yum-builddep /root/xrootd-ceph-dev/xrootd-ceph-srpm/xrootd-ceph-5.3.4-1.el7.src.rpm

 

  • Extract the source tar.gz from the source rpm

    • cd /root/xrootd-ceph-dev/xrootd-ceph-srpm/

    • rpm2cpio xrootd-ceph-5.3.4-1.el7.src.rpm | cpio -imdv --no-absolute-filenames

 

  • Copy the extracted source tar.gz to the approporiate rpmbuild dirs and edit XRootDOSDefs.cmake

    • cp xrootd-ceph.tar.gz /root/rpmbuild/SOURCES/

    • Following steps only apply for changing c++ compiler version.

    • cd /root/rpmbuild/SOURCES/

    • gunzip xrootd-ceph.tar.gz; tar xvf xrootd-ceph.tar

    • Edit line 14 of xrootd-ceph/cmake/XRootDOSDefs.cmake by replacing -std=c++11 with -std=c++14 (TODO: push this change to https://github.com/stfc/xrootd-ceph.git and make it permanent)

    • tar cvf xrootd-ceph.tar xrootd-ceph/; gzip xrootd-ceph.tar

 

  • Copy the attached (bottom of page) xrootd-ceph-current.spec to /root/rpmbuild/SPECS/ and edit it as follows:

    • Define version number (e.g 5.3.4-1) of the generated xrootd-ceph rpm

    • Define the XRootD main version you are compiling against in the following section of xrootd-ceph-current.spec

      BuildRequires: xrootd-server-devel%{?_isa} >= 1:5.3.3 BuildRequires: xrootd-private-devel%{?_isa} >= 1:5.3.3 BuildRequires: xrootd-libs%{?_isa} >= 1:5.3.3 BuildRequires: xrootd-server-libs%{?_isa} >= 1:5.3.3 BuildRequires: xrootd-client-libs%{?_isa} >= 1:5.3.3 Requires: xrootd-server-libs%{?_isa} >= 1:5.3.3 Requires: xrootd-client-libs%{?_isa} >= 1:5.3.3 Requires: xrootd-libs%{?_isa} >= 1:5.3.3
    • Additional version updates might be needed for ceph or librados packages if needed.

 

  • Optionally, update the changelog

 

 

  • To use programs from the devtoolset: scl enable devtoolset-9 bash

 

  • Build the rpm: From the root dir, rpmbuild -ba /root/rpmbuild/SPECS/xrootd-ceph-current.spec

 

  • Upload the generated rpms to repos.gridpp.rl.ac.uk

    • scp rpmbuild/RPMS/x86_64/xrootd-ceph-5.3.3-1.el7.x86_64.rpm repos-1.gridpp.rl.ac.uk:/srv/yum/xrootd-ceph/nautilus/el7/x86_64

    • scp rpmbuild/RPMS/x86_64/xrootd-ceph-debuginfo-5.3.3-1.el7.x86_64.rpm repos-1.gridpp.rl.ac.uk:/srv/yum/xrootd-ceph/nautilus/el7/x86_64

    • Log in to repos.gridpp.rl.ac.uk and cd /srv/yum/xrootd-ceph/nautilus/el7/x86_64

      • createrepo --update .

 

 

  • Changes to be pushed to https://github.com/stfc/xrootd-ceph.git if made

    • C++ version changes (-std=c++11 to -std=c++14) in xrootd-ceph/cmake/XRootDOSDefs.cmake

    • Final version of xrootd-ceph/packaging/rhel/xrootd-ceph.spec.in

 

  • Note on the latest compiled versions of xrootd-ceph

    • 5.3.1 is the master branch as of 27/8 compiled against 5.3.1 xrootd libraries.

    • 5.3.2 contains James's fix: AIO read logic affecting end of file

    • 5.3.3 contains also this James's fix: Allow a delete to proceed if file is locked by removing the associated xattr metadata item

    • 5.3.4 contains the offline file bugfix (hash 6eebabbef10adb0172c8fcc349eed8c3b9c02bd6 on stfc/xrootd-ceph)

    • A guide for a better versioning of XRootD Ceph can be found here https://www.geeksforgeeks.org/introduction-semantic-versioning/