Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-14408 pmdk: build with NDCTL 63.1 to enable full RAS support in PMDK. #32

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ SRC_EXT := gz
TEST_PACKAGES := libpmem libpmem-devel libpmemobj libpmemobj-devel libpmempool \
libpmempool-devel pmempool pmreorder

EXTERNAL_RPM_BUILD_OPTIONS := --without=ndctl

include packaging/Makefile_packaging.mk
2 changes: 1 addition & 1 deletion debian/README.Debian
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ pmempool is a management tool for persistent memory pool files created by the
NVM libraries. It may be useful for system administrators as well as for
software developers for troubleshooting and debugging.

Further details are at http://pmem.io/.
Further details are at https://github.com/pmem/pmdk/.

-- Nishanth Aravamudan <[email protected]> Thu, 08 Sep 2016 15:19:46 -0700
8 changes: 8 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
pmdk (2.0.1-1) stable; urgency=medium

* Update to 2.0.1
* Build with NDCTL enabled
* Update ndctl to version 63 as expected by PMDK 2.0.1

-- Tomasz Gromadzki <[email protected]> Wed, 06 Dec 2023 13:00:00 +0000

pmdk (2.0.0-1) stable; urgency=medium

* Upgrade to 2.0.0 which:
Expand Down
11 changes: 6 additions & 5 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Priority: optional
Maintainer: Adam Borowski <[email protected]>
Build-Depends: bash-completion,
bc,
cmake,
debhelper-compat (= 12),
dh-exec,
libdaxctl-dev (>= 64),
Expand All @@ -18,7 +17,7 @@ Build-Depends: bash-completion,
ed
Standards-Version: 4.5.0
Rules-Requires-Root: no
Homepage: https://pmem.io/pmdk/
Homepage: https://github.com/pmem/pmdk/
Vcs-Git: https://github.com/kilobyte/pmdk -b debian
Vcs-Browser: https://github.com/kilobyte/pmdk/tree/debian

Expand Down Expand Up @@ -125,9 +124,11 @@ Depends: libpmem1-debug (= ${binary:Version}),
${shlibs:Depends}
Description: Persistent Memory pool management support library — debug build
libpmempool provides a set of utilities for management, diagnostics and repair
of pmemobj persistent memory pools. The libpmempool is for applications that
need high reliability or built-in troubleshooting. It may be useful for
testing and debugging purposes also.
of persistent memory pools. A pool in this context means a pmemobj pool,
independent of the underlying storage.
The libpmempool is for applications that need high reliability or
built-in troubleshooting. It may be useful for testing and debugging purposes
also.
.
This package contains a special build of this library meant for debugging
purposes. It contains extra logging, assertions and expensive checks that
Expand Down
5 changes: 2 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_UPSTREAM_VERSION = $(shell dpkg-parsechangelog -S version | cut -d - -f 1 | cut -d : -f 2)

BUILD_ARGS = prefix=/usr libdir=/usr/lib/$(DEB_HOST_MULTIARCH) sysconfdir=/etc bashcompdir=/usr/share/bash-completion/completions NORPATH=1 NDCTL_ENABLE=n BUILD_EXAMPLES=n BUILD_BENCHMARKS=n
BUILD_ARGS = prefix=/usr libdir=/usr/lib/$(DEB_HOST_MULTIARCH) sysconfdir=/etc bashcompdir=/usr/share/bash-completion/completions NORPATH=1 BUILD_EXAMPLES=n BUILD_BENCHMARKS=n

%:
#dh $@ --with bash-completion
Expand All @@ -14,7 +14,6 @@ BUILD_ARGS = prefix=/usr libdir=/usr/lib/$(DEB_HOST_MULTIARCH) sysconfdir=/etc b
override_dh_auto_clean:
dh_auto_clean -- $(BUILD_ARGS)
rm -rf src/test/unittest/__pycache__
rm -rf src/deps/miniasync/build

override_dh_auto_build:
+$(MAKE) doc
Expand All @@ -29,7 +28,7 @@ override_dh_install:
dh_install

override_dh_installexamples:
dh_installexamples --exclude=.gitignore --exclude=.vcxproj
dh_installexamples --exclude=.gitignore

override_dh_installman:
dh_installman
Expand Down
30 changes: 26 additions & 4 deletions packaging/Dockerfile.centos.7
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,41 @@
#

# Pull base image
FROM centos:7
FROM centos:centos7
LABEL maintainer="[email protected]"

# Use local repo server if present
ARG REPO_FILE_URL
RUN set -e; \
if [ -n "$REPO_FILE_URL" ]; then \
cd /etc/yum.repos.d/ && \
curl -k -f -o daos_ci-centos7-artifactory.repo.tmp \
"$REPO_FILE_URL"daos_ci-centos7-artifactory.repo && \
for file in *.repo; do \
true > $file; \
done; \
mv daos_ci-centos7-artifactory.repo{.tmp,}; \
fi; \
yum -y install dnf; \
yum clean all; \
dnf --disablerepo \*epel\* -y install epel-release \
dnf-plugins-core; \
if [ -n "$REPO_FILE_URL" ]; then \
dnf -y --quiet config-manager --disable epel; \
fi; \
dnf -y update epel-release; \
dnf -y clean all

# use same UID as host and default value of 1000 if not specified
ARG UID=1000

# Update distribution
#Nothing to do for CentOS

# Install basic tools
RUN yum install -y epel-release
RUN yum install -y mock make rpm-build curl createrepo rpmlint redhat-lsb-core \
git python-srpm-macros dnf
RUN dnf install -y epel-release
RUN dnf install -y mock make rpm-build curl createrepo rpmlint redhat-lsb-core \
git python-srpm-macros dnf && dnf -y clean all

# Add build user (to keep rpmbuild happy)
ENV USER build
Expand Down
14 changes: 9 additions & 5 deletions packaging/Dockerfile.mockbuild
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#

# Pull base image
ARG FVERSION=38
ARG FVERSION=latest
FROM fedora:$FVERSION
# Needed for later use of FVERSION
ARG FVERSION
Expand All @@ -15,16 +15,19 @@ LABEL maintainer="[email protected]"
ARG REPO_FILE_URL
RUN if [ -n "$REPO_FILE_URL" ]; then \
cd /etc/yum.repos.d/ && \
curl -f -o daos_ci-fedora-artifactory.repo.tmp \
curl -k -f -o daos_ci-fedora-artifactory.repo.tmp \
"$REPO_FILE_URL"daos_ci-fedora-artifactory.repo && \
rm -f *.repo && \
for file in *.repo; do \
true > $file; \
done; \
mv daos_ci-fedora-artifactory.repo{.tmp,}; \
fi

# Install basic tools
RUN dnf -y install mock make \
rpm-build createrepo rpmlint redhat-lsb-core git \
python-srpm-macros rpmdevtools
python-srpm-macros rpmdevtools && \
dnf -y clean all

# use same UID as host and default value of 1000 if not specified
ARG UID=1000
Expand All @@ -45,7 +48,8 @@ RUN dnf -y upgrade && \
# https://github.com/rpm-software-management/rpmlint/pull/795 in it
# But make sure to patch after dnf upgrade so that an upgraded rpmlint
# RPM doesn't wipe out our patch
COPY packaging/rpmlint--ignore-unused-rpmlintrc.patch .
ARG PACKAGINGDIR=packaging
COPY ${PACKAGINGDIR}/rpmlint--ignore-unused-rpmlintrc.patch .
RUN (cd $(python3 -c 'import site; print(site.getsitepackages()[-1])') && \
if ! grep -e --ignore-unused-rpmlintrc rpmlint/cli.py; then \
if ! patch -p1; then \
Expand Down
8 changes: 8 additions & 0 deletions packaging/Makefile_distro_vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ DISTRO_VERSION ?= $(VERSION_ID)
ORIG_TARGET_VER := 15.4
SED_EXPR := 1p
endif
ifeq ($(CHROOT_NAME),opensuse-leap-15.5-x86_64)
VERSION_ID := 15.5
DISTRO_ID := sl15.5
DISTRO_BASE := LEAP_15
DISTRO_VERSION ?= $(VERSION_ID)
ORIG_TARGET_VER := 15.5
SED_EXPR := 1p
endif
endif
ifeq ($(ID),centos)
ID = el
Expand Down
8 changes: 6 additions & 2 deletions packaging/Makefile_packaging.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ RPM_BUILD_OPTIONS := $(BUILD_DEFINES)
GIT_DIFF_EXCLUDES := $(PATCH_EXCLUDE_FILES:%=':!%')
endif

FVERSION ?= latest
COMMON_RPM_ARGS := --define "_topdir $$PWD/_topdir" $(BUILD_DEFINES)
SPEC := $(shell if [ -f $(NAME)-$(DISTRO_BASE).spec ]; then echo $(NAME)-$(DISTRO_BASE).spec; else echo $(NAME).spec; fi)
VERSION = $(eval VERSION := $(shell rpm $(COMMON_RPM_ARGS) --specfile --qf '%{version}\n' $(SPEC) | sed -n '1p'))$(VERSION)
Expand Down Expand Up @@ -163,7 +164,7 @@ endif

$(notdir $(SOURCE) $(OTHER_SOURCES) $(REAL_SOURCE)): $(SPEC) $(CALLING_MAKEFILE)
# TODO: need to clean up old ones
$(SPECTOOL) -g $(SPEC)
$(SPECTOOL) $(COMMON_RPM_ARGS) -g $(SPEC)

$(DEB_TOP)/%: % | $(DEB_TOP)/

Expand Down Expand Up @@ -369,6 +370,7 @@ endif

podman_chrootbuild:
if ! podman build --build-arg REPO_FILE_URL=$(REPO_FILE_URL) \
--build-arg FVERSION=$(FVERSION) \
-t $(subst +,-,$(CHROOT_NAME))-chrootbuild \
-f packaging/Dockerfile.mockbuild .; then \
echo "Container build failed"; \
Expand All @@ -386,7 +388,9 @@ podman_chrootbuild:
exit 1; \
fi; \
rpmlint $$(ls /var/lib/mock/$(CHROOT_NAME)/result/*.rpm | \
grep -v -e debuginfo -e debugsource -e src.rpm)'
grep -v -e debuginfo -e debugsource -e src.rpm)'; then \
exit 1; \
fi

docker_chrootbuild:
if ! $(DOCKER) build --build-arg UID=$$(id -u) -t chrootbuild \
Expand Down
32 changes: 17 additions & 15 deletions packaging/rpm_chrootbuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

set -uex

original_cfg_file="/etc/mock/$CHROOT_NAME.cfg"
cfg_file=mock.cfg

cp "$original_cfg_file" "$cfg_file"
cp /etc/mock/"$CHROOT_NAME".cfg mock.cfg

if [[ $CHROOT_NAME == *epel-8-x86_64 ]]; then
cat <<EOF >> mock.cfg
Expand All @@ -22,7 +19,7 @@ if [[ $CHROOT_NAME == *epel-7-x86_64 ]]; then
fi

# Allow BR: foo-devel < 1.2 to work when foo-devel-1.3 is actually available
cat <<EOF >> "$cfg_file"
cat <<EOF >> mock.cfg
config_opts['dnf.conf'] += """
[main]
best=0
Expand All @@ -33,7 +30,7 @@ EOF
repo_adds=()
repo_dels=()

echo -e "config_opts['yum.conf'] += \"\"\"\n" >> "$cfg_file"
echo -e "config_opts['yum.conf'] += \"\"\"\n" >> mock.cfg

if [ -n "${ARTIFACTORY_URL:-}" ] && "$LOCAL_REPOS"; then
repo_dels+=("--disablerepo=\*")
Expand All @@ -56,7 +53,7 @@ if [ -n "${ARTIFACTORY_URL:-}" ] && "$LOCAL_REPOS"; then
REPO_FILE_URL="file://$(readlink -e "$REPO_FILES_PR")/"
fi
fi
curl -sSf "${REPO_FILE_URL}daos_ci-$DISTRO"-mock-artifactory.repo >> "$cfg_file"
curl -sSf "$REPO_FILE_URL"daos_ci-"${CHROOT_NAME%-*}".repo >> mock.cfg
repo_adds+=("--enablerepo *-artifactory")
fi
fi
Expand All @@ -81,9 +78,9 @@ for repo in $DISTRO_BASE_PR_REPOS $PR_REPOS; do
repo_adds+=("--enablerepo $repo:${branch//[@\/]/_}:$build_number")
echo -e "[$repo:${branch//[@\/]/_}:$build_number]\n\
name=$repo:${branch//[@\/]/_}:$build_number\n\
baseurl=${JENKINS_URL:-https://build.hpdd.intel.com/}job/daos-stack/job/$repo/job/${branch//\//%2F}/$build_number/artifact/artifacts/$DISTRO/\n\
baseurl=${ARTIFACTS_URL:-${JENKINS_URL:-https://build.hpdd.intel.com/}job/}daos-stack/job/$repo/job/${branch//\//%2F}/$build_number/artifact/artifacts/$DISTRO/\n\
enabled=1\n\
gpgcheck=False\n" >> "$cfg_file"
gpgcheck=False\n" >> mock.cfg
done
for repo in $JOB_REPOS; do
repo_name=${repo##*://}
Expand All @@ -97,9 +94,9 @@ for repo in $JOB_REPOS; do
echo -e "[${repo_name//[@\/]/_}]\n\
name=${repo_name}\n\
baseurl=${repo//\//%2F}\n\
enabled=1\n" >> "$cfg_file"
enabled=1\n" >> mock.cfg
done
echo "\"\"\"" >> "$cfg_file"
echo "\"\"\"" >> mock.cfg

if [ -n "$DISTRO_VERSION" ]; then
releasever_opt=("--config-opts=releasever=$DISTRO_VERSION")
Expand All @@ -111,15 +108,20 @@ if ls -l /scratch/mock/cache/"${CHROOT_NAME}"-bootstrap/root_cache/cache.tar.gz;
flock "$bs_dir" -c "cp -a $bs_dir/root_cache /var/cache/mock/${CHROOT_NAME}-bootstrap"
fi

# shellcheck disable=SC2086
eval mock -r "$cfg_file" ${repo_dels[*]} ${repo_adds[*]} --disablerepo=\*-debug* \
"${releasever_opt[@]}" $MOCK_OPTIONS $RPM_BUILD_OPTIONS "$TARGET"
rc=0
# shellcheck disable=SC2086,SC2048
if ! eval mock -r mock.cfg ${repo_dels[*]} ${repo_adds[*]} --no-clean \
--disablerepo=\*-debug* ${releasever_opt[*]} $MOCK_OPTIONS \
$RPM_BUILD_OPTIONS "$TARGET"; then
rc=${PIPESTATUS[0]}
fi

date
if ls -l /var/cache/mock/"${CHROOT_NAME}"-bootstrap/root_cache/cache.tar.gz &&
[ -d /scratch/ ]; then
mkdir -p /scratch/mock/cache/"${CHROOT_NAME}"-bootstrap/
if ! cmp /var/cache/mock/"${CHROOT_NAME}"-bootstrap/root_cache/cache.tar.gz "$bs_dir"/root_cache/cache.tar.gz; then
flock "$bs_dir" -c "cp -a /var/cache/mock/${CHROOT_NAME}-bootstrap/root_cache $bs_dir/"
fi
fi

exit "$rc"
19 changes: 8 additions & 11 deletions pmdk.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

%global major 2
%global minor 0
%global bugrelease 0
%global bugrelease 1
#%%global prerelease rc1
%global buildrelease 1

Expand All @@ -26,7 +26,7 @@
# by default build with ndctl, unless explicitly disabled
%bcond_without ndctl

%define min_ndctl_ver 60.1
%define min_ndctl_ver 63
%define _make_common_args EXTRA_CFLAGS="-Wno-error" NORPATH=1 BUILD_EXAMPLES=n BUILD_BENCHMARKS=n
%if %{without ndctl}
%define make_common_args %{_make_common_args} NDCTL_ENABLE=n
Expand All @@ -40,7 +40,7 @@ Release: %{buildrelease}%{?dist}
Summary: Persistent Memory Development Kit
Group: System Environment/Libraries
License: BSD
URL: https://pmem.io/pmdk
URL: https://github.com/pmem/pmdk

# upstream version with ~ removed
%{lua:
Expand All @@ -58,12 +58,6 @@ BuildRequires: pandoc
BuildRequires: perl
BuildRequires: fdupes

%if %{defined suse_version}
BuildRequires: cmake
%else
BuildRequires: cmake3
%endif

%if %{with ndctl}
%if %{defined suse_version}
BuildRequires: libndctl-devel >= %{min_ndctl_ver}
Expand Down Expand Up @@ -231,7 +225,6 @@ debug version is to set the environment variable LD_LIBRARY_PATH to
%license LICENSE
%doc ChangeLog CONTRIBUTING.md README.md


%package -n libpmemobj%{?libmajor}
Summary: Persistent Memory Transactional Object Store library
Group: System Environment/Libraries
Expand Down Expand Up @@ -442,7 +435,6 @@ export LDFLAGS="%{?__global_ldflags}"
# optimizations.
make %{?_smp_mflags} %{make_common_args}


# Override LIB_AR with empty string to skip installation of static libraries
%install
make install DESTDIR=%{buildroot} %{make_common_args} \
Expand Down Expand Up @@ -499,6 +491,11 @@ cp utils/pmdk.magic %{buildroot}%{_datadir}/pmdk/


%changelog
* Wed Dec 06 2023 Tomasz.Gromadzki <[email protected]> - 2.0.1-1
- Update to release 2.0.1
- Build with NDCTL enabled
- Update ndctl to version 63 as expected by PMDK 2.0.1

* Fri Sep 22 2023 Jan Michalski <[email protected]> - 2.0.0-1
- Update to release 2.0.0 which
- removes libpmemlog and libpmemblk,
Expand Down