Building the RPMs on a Test Server
DAOS is delivered as an RPM for multiple Linux distributions. This page contains details on building the DAOS rpm (for RPM-based Linux systems such as RedHat and CentOS).
To begin with, ensure you have the Nexus Yum repos configured, so that yum can find all needed software dependencies:
$ cat /etc/yum.repos.d/choose-any-repo-name-you-like.repo [repo.dc.hpdd.intel.com_repository_daos-stack-el-7-x86_64-stable-local] name=created by dnf config-manager from https://repo.dc.hpdd.intel.com/repository/daos-stack-el-7-x86_64-stable-local baseurl=https://repo.dc.hpdd.intel.com/repository/daos-stack-el-7-x86_64-stable-local enabled=1 gpgcheck=False
Build the dependencies specified in the daos.spec file:
# yum-builddep daos.spec
Build your own DAOS RPM using the rpms scons target:
$ scons rpms
Using the RPMs from the Build Server
The DAOS Jenkins pipeline saves the RPMs to the Artifacts section of the build report. They can be downloaded and installed using yum localinstall. Note that the DAOS RPM set must be installed using a single one-line yum command.
# yum localinstall -y \ daos-1.1.0-30.4879.ge155e7fc.el7.x86_64.rpm \ daos-client-1.1.0-30.4879.ge155e7fc.el7.x86_64.rpm \ daos-debuginfo-1.1.0-30.4879.ge155e7fc.el7.x86_64.rpm \ daos-devel-1.1.0-30.4879.ge155e7fc.el7.x86_64.rpm \ daos-server-1.1.0-30.4879.ge155e7fc.el7.x86_64.rpm \ daos-tests-1.1.0-30.4879.ge155e7fc.el7.x86_64.rpm
More info
See also the /wiki/spaces/DAOS/pages/2164625288 page.
Building DAOS and Dependency RPMs
This procedure does not require the NEXUS repo configured. It has been testing on verify minimal rocky 8 and 9 instances and only uses common repos.
#!/bin/bash set -uex # Run from: docker run -it --name rocky-rpm-builder -v ~/workspace/devops/packaging:/root/rpmbuild rockylinux:8 /bin/bash # sudo docker rm rocky-rpm-builder setup_rpm_build_env() { el_version=${1:-8} # default to '8' # Update and install required packages dnf install -y \ git \ rpm-build \ rpmdevtools \ dnf-plugins-core \ gcc \ gcc-c++ \ make \ cmake \ python3 \ python3-pip \ openssl-devel \ libuuid-devel \ epel-release # Install build tools and dependencies dnf groupinstall -y "Development Tools" dnf install -y mock epel-release # enable Power Tools or CodeReady Builder depending on el version if [[ "$el_version" == "8" ]]; then dnf config-manager --set-enabled powertools elif [[ "$el_version" == "9" ]]; then dnf config-manager --set-enabled crb # CodeReady Builder else echo "Unsupported EL Version: $el_version" exit 1 fi # ignore dpdk because want to use rpms build from daos-stack/dpdk dnf update -y --exclude=dpdk --exclude=dpdk-devel } # Function to clone, build, and install RPMs with packaging repos inside daos-stack build_and_install_rpm() { local repo_name=$1 local rpm_build_options=${2:-""} # Check if the directory exists - helps if running script many times while troubleshooting if [ ! -d "$repo_name" ]; then git clone https://github.com/daos-stack/$repo_name.git cd $repo_name dnf builddep -y $repo_name.spec make rpms RPM_BUILD_OPTIONS="$rpm_build_options" dnf install -y _topdir/RPMS/*/*.rpm cp -r _topdir/RPMS/* $rpms_dst/ cd - else echo "The '$repo_name' folder already exists. Skipping clone and build steps." fi } get_el_version() { VERSION_ID=$(grep "^VERSION_ID" /etc/os-release | cut -d'=' -f2 | tr -d '"' | cut -d'.' -f1) echo $VERSION_ID } # ---- # # MAIN # # ---- # rpms_dst=${1:-"~/rpmbuild/"} build_dst="/tmp/rpmbuild/" # temp location to do the building echo "Building RPMs for EL $(get_el_version)." echo "RPMS will be located in $rpms_dst (built in $build_dst)" # make sure rpm and build folders are created mkdir -p $rpms_dst mkdir -p $build_dst # ------------------------------ # Build Dependency and DAOS RPMS # ------------------------------ setup_rpm_build_env $(get_el_version) cd $build_dst # Call the function with the repository name as an argument build_and_install_rpm "isa-l_crypto" build_and_install_rpm "argobots" build_and_install_rpm "mercury" build_and_install_rpm "mercury" build_and_install_rpm "dpdk" # dependency of spdk. build_and_install_rpm "spdk" build_and_install_rpm "pmdk" "--define '_skip_check 1'" # DAOS and Raft (Submodule) if [ ! -d "daos" ]; then git clone --recursive https://github.com/daos-stack/daos.git # RAFT cd daos/src/rdb/raft dnf builddep -y raft.spec make -f Makefile-rpm.mk dnf install -y _topdir/RPMS/*/*.rpm cp -r _topdir/RPMS/* $rpms_dst/ cd - # DAOS cd daos dnf builddep -y ./utils/rpms/daos.spec make -C utils/rpms rpms cp -r utils/rpms/_topdir/RPMS/* $rpms_dst/ cd - fi # -------- # Clean up # -------- rm -rf $build_dst