Skip to content

Commit 4cc4e9a

Browse files
committed
SRE-2832 Packaging update part 1
Packaging update part 1 which needs a test build of Libfabric. No functional code changes. In the future, there were be only Dockerfile.ubuntu which should handle all the releases of Ubuntu that will be supported. Signed-off-by: John E. Malmberg <[email protected]>
1 parent 5d7a274 commit 4cc4e9a

14 files changed

+318
-53
lines changed

.dockerignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# .dockerignore file for DAOS.
2+
3+
# Firstly deny everything and then allow only directories and files that we're
4+
# interested in. Other files will not be required for the build and they
5+
# just generate noise and extra work for docker.
6+
*
7+
!packaging/scripts

Jenkinsfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/usr/bin/groovy
22
// SPDX-License-Identifier: BSD-2-Clause-Patent
3-
// Copyright (c) 2019-2024 Intel Corporation
3+
// Copyright 2019-2024 Intel Corporation
4+
// Copyright 2025 Hewlett Packard Enterprise Development LP
45

56
// To use a test branch (i.e. PR) until it lands to master
67
// I.e. for testing library changes
78
//@Library(value="pipeline-lib@your_branch") _
9+
@Library(value='pipeline-lib@malmberg/sre-2832') _
810

911
/* groovylint-disable-next-line CompileStatic */
1012
packageBuildingPipelineDAOSTest(['distros': ['el8', 'el9', 'leap15', 'ubuntu20.04'],

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
# libfabric
2+
23
libfabric RPM packaging
4+
5+
This project just contains code to package a distribution from its
6+
official repository.

libfabric.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';'
234234

235235
* Wed May 4 2022 Brian J. Murrell <[email protected]> - 1.15.0~rc3-2
236236
- Add _hardened_build flag to build PIE binaries on CentOS 7
237-
- Add optoins to C*FLAGS to build PIE binaries on Leap 15
237+
- Add options to C*FLAGS to build PIE binaries on Leap 15
238238

239239
* Tue Apr 19 2022 Lei Huang <[email protected]> - 1.15.0~rc3-1
240240
- Update to v1.15.0rc3

packaging/Dockerfile.coverity

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#
22
# Copyright 2018-2020, Intel Corporation
3+
# Copyright 2025 Hewlett Packard Enterprise Development LP
34
#
45
# 'recipe' for Docker to build for a Coverity scan.
56
#
67

78
# Pull base image
89
FROM fedora:latest
9-
MAINTAINER daos-stack <[email protected]>
10+
LABEL maintainer="daos-stack <[email protected]>""
1011

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

packaging/Dockerfile.mockbuild

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
22
# Copyright 2018-2024 Intel Corporation
3+
# Copyright 2025 Hewlett Packard Enterprise Development LP
34
#
45
# 'recipe' for Docker to build an RPM
56
#
@@ -13,15 +14,16 @@ LABEL maintainer="[email protected]"
1314

1415
# Use local repo server if present
1516
ARG REPO_FILE_URL
16-
RUN if [ -n "$REPO_FILE_URL" ]; then \
17-
cd /etc/yum.repos.d/ && \
18-
curl -k -f -o daos_ci-fedora-artifactory.repo.tmp \
19-
"$REPO_FILE_URL"daos_ci-fedora-artifactory.repo && \
20-
for file in *.repo; do \
21-
true > $file; \
22-
done; \
23-
mv daos_ci-fedora-artifactory.repo{.tmp,}; \
24-
fi
17+
ARG DAOS_LAB_CA_FILE_URL
18+
ARG REPOSITORY_NAME
19+
# script to install OS updates basic tools and daos dependencies
20+
# COPY ./utils/scripts/install-fedora.sh /tmp/install.sh
21+
# script to setup local repo if available
22+
COPY ./packaging/scripts/repo-helper-fedora.sh /tmp/repo-helper.sh
23+
24+
RUN chmod +x /tmp/repo-helper.sh && \
25+
/tmp/repo-helper.sh && \
26+
rm -f /tmp/repo-helper.sh
2527

2628
# Install basic tools
2729
RUN dnf -y install mock make \
@@ -33,8 +35,8 @@ RUN dnf -y install mock make \
3335
ARG UID=1000
3436

3537
# Add build user (to keep rpmbuild happy)
36-
ENV USER build
37-
ENV PASSWD build
38+
ENV USER=build
39+
ENV PASSWD=build
3840
# add the user to the mock group so it can run mock
3941
RUN if [ $UID != 0 ]; then \
4042
useradd -u $UID -ms /bin/bash $USER; \

packaging/Dockerfile.ubuntu

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Keep Dockerfile.ubuntu the same as this file until all packaging
2+
# jobs are fixed to have a Dockerfile.ubuntu, and then the common
3+
# Jenkinsfile will be changed to use Dockerfile.ubuntu.
4+
#
5+
# Copyright 2019-2021, Intel Corporation
6+
# Copyright 2025 Hewlett Packard Enterprise Development LP
7+
#
8+
# 'recipe' for Docker to build an Debian package
9+
#
10+
# Pull base image
11+
ARG BASE_DISTRO=ubuntu:20.04
12+
FROM $BASE_DISTRO
13+
LABEL org.opencontainers.image.authors="[email protected]"
14+
# Needed for later use of BASE_DISTRO
15+
ARG BASE_DISTRO
16+
17+
ARG REPO_FILE_URL
18+
ARG DAOS_LAB_CA_FILE_URL
19+
ARG REPOSITORY_NAME
20+
# script to setup local repo if available
21+
COPY ./packaging/scripts/repo-helper-ubuntu.sh /tmp/repo-helper.sh
22+
23+
RUN chmod +x /tmp/repo-helper.sh && \
24+
/tmp/repo-helper.sh && \
25+
rm -f /tmp/repo-helper.sh
26+
27+
# Install basic tools
28+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
29+
autoconf bash ca-certificates curl debhelper dh-make \
30+
dpkg-dev dh-python doxygen gcc git git-buildpackage \
31+
javahelper locales make patch pbuilder pkg-config \
32+
python3-dev python3-distro python3-distutils rpm scons wget \
33+
cmake valgrind rpmdevtools
34+
35+
# use same UID as host and default value of 1000 if not specified
36+
ARG UID=1000
37+
38+
# Add build user (to keep chrootbuild happy)
39+
ENV USER=build
40+
RUN useradd -u $UID -ms /bin/bash $USER
41+
42+
# need to run the build command as root, as it needs to chroot
43+
RUN if ! grep "^#includedir /etc/sudoers.d" /etc/sudoers; then \
44+
echo "#includedir /etc/sudoers.d" >> /etc/sudoers; \
45+
fi; \
46+
echo "Defaults env_keep += \"DPKG_GENSYMBOLS_CHECK_LEVEL\"" > /etc/sudoers.d/build; \
47+
echo "build ALL=(ALL) NOPASSWD: /usr/bin/tee /root/.pbuilderrc" >> /etc/sudoers.d/build; \
48+
echo "build ALL=(ALL) NOPASSWD: /usr/sbin/pbuilder" >> /etc/sudoers.d/build; \
49+
chmod 0440 /etc/sudoers.d/build; \
50+
visudo -c; \
51+
sudo -l -U build

packaging/Dockerfile.ubuntu.20.04

+21-33
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,50 @@
1+
# Keep Dockerfile.ubuntu the same as this file until all packaging
2+
# jobs are fixed to have a Dockerfile.ubuntu, and then the common
3+
# Jenkinsfile will be changed to use Dockerfile.ubuntu.
14
#
25
# Copyright 2019-2021, Intel Corporation
6+
# Copyright 2025 Hewlett Packard Enterprise Development LP
37
#
48
# 'recipe' for Docker to build an Debian package
59
#
610
# Pull base image
7-
FROM ubuntu:20.04
11+
ARG BASE_DISTRO=ubuntu:20.04
12+
FROM $BASE_DISTRO
813
LABEL org.opencontainers.image.authors="[email protected]"
9-
10-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
11-
curl gpg
14+
# Needed for later use of BASE_DISTRO
15+
ARG BASE_DISTRO
1216

1317
ARG REPO_FILE_URL
14-
RUN if [ -n "$REPO_FILE_URL" ]; then \
15-
cd /etc/apt/sources.list.d && \
16-
curl -f -o daos_ci-ubuntu20.04-artifactory.list.tmp \
17-
"$REPO_FILE_URL"daos_ci-ubuntu20.04-artifactory.list && \
18-
true > ../sources.list && \
19-
mv daos_ci-ubuntu20.04-artifactory.list.tmp \
20-
daos_ci-ubuntu20.04-artifactory.list; \
21-
url="${REPO_FILE_URL%/*/}/hpe-ilorest-ubuntu-bionic-proxy/"; \
22-
else \
23-
url="https://downloads.linux.hpe.com/SDR/repo/ilorest/"; \
24-
fi; \
25-
cd -; \
26-
mkdir -p /usr/local/share/keyrings/; \
27-
curl -f -O "$url"GPG-KEY-hprest; \
28-
gpg --no-default-keyring --keyring ./temp-keyring.gpg \
29-
--import GPG-KEY-hprest; \
30-
gpg --no-default-keyring --keyring ./temp-keyring.gpg --export \
31-
--output /usr/local/share/keyrings/hpe-sdr-public.gpg; \
32-
rm ./temp-keyring.gpg; \
33-
curl -f -O "$REPO_FILE_URL"esad_repo.key; \
34-
gpg --no-default-keyring --keyring ./temp-keyring.gpg \
35-
--import esad_repo.key; \
36-
gpg --no-default-keyring --keyring ./temp-keyring.gpg --export \
37-
--output /usr/local/share/keyrings/daos-stack-public.gpg
18+
ARG DAOS_LAB_CA_FILE_URL
19+
ARG REPOSITORY_NAME
20+
# script to setup local repo if available
21+
COPY ./packaging/scripts/repo-helper-ubuntu.sh /tmp/repo-helper.sh
22+
23+
RUN chmod +x /tmp/repo-helper.sh && \
24+
/tmp/repo-helper.sh && \
25+
rm -f /tmp/repo-helper.sh
3826

39-
# Install basic tools
27+
# Install basic tools - rpmdevtools temporary commented out.
4028
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
4129
autoconf bash ca-certificates curl debhelper dh-make \
4230
dpkg-dev dh-python doxygen gcc git git-buildpackage \
4331
javahelper locales make patch pbuilder pkg-config \
44-
python3-dev python3-distro python3-distutils rpm scons wget \
45-
cmake valgrind rpmdevtools
32+
python3-dev python3-distro python3-distutils rpm scons sudo \
33+
wget cmake valgrind # rpmdevtools
4634

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

5038
# Add build user (to keep chrootbuild happy)
51-
ENV USER build
39+
ENV USER=build
5240
RUN useradd -u $UID -ms /bin/bash $USER
5341

5442
# need to run the build command as root, as it needs to chroot
5543
RUN if ! grep "^#includedir /etc/sudoers.d" /etc/sudoers; then \
5644
echo "#includedir /etc/sudoers.d" >> /etc/sudoers; \
5745
fi; \
5846
echo "Defaults env_keep += \"DPKG_GENSYMBOLS_CHECK_LEVEL\"" > /etc/sudoers.d/build; \
59-
echo "build ALL=(ALL) NOPASSWD: /usr/bin/tee /root/.pbuilderrc" >> /etc/sudoers.d/build; \
47+
echo "build ALL=(ALL) NOPASSWD: /usr/bin/tee /root/.pbuilderrc" >> /etc/sudoers.d/build; \
6048
echo "build ALL=(ALL) NOPASSWD: /usr/sbin/pbuilder" >> /etc/sudoers.d/build; \
6149
chmod 0440 /etc/sudoers.d/build; \
6250
visudo -c; \

packaging/Dockerfile.ubuntu.rolling

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#
22
# Copyright 2019, Intel Corporation
3+
# Copyright 2025 Hewlett Packard Enterprise Development LP
34
#
45
# 'recipe' for Docker to build an Debian package
56
#
67
# Pull base image
78
FROM ubuntu:rolling
8-
Maintainer daos-stack <daos@daos.groups.io>
9+
LABEL org.opencontainers.image.authors="[email protected]"
910

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

packaging/Makefile_packaging.mk

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ endif
168168

169169
$(notdir $(SOURCE) $(OTHER_SOURCES) $(REAL_SOURCE)): $(SPEC) $(CALLING_MAKEFILE)
170170
# TODO: need to clean up old ones
171+
export
171172
$(SPECTOOL) $(COMMON_RPM_ARGS) -g $(SPEC)
172173

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

packaging/debian_chrootbuild

+14-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,21 @@
22

33
set -uex
44

5+
: "${REPO_FILE_URL:=}"
6+
7+
# Currently not working
58
if [ -n "${ARTIFACTORY_URL:-}" ] && "$LOCAL_REPOS"; then
6-
echo "MIRRORSITE=${ARTIFACTORY_URL}artifactory/ubuntu-proxy" | sudo tee /root/.pbuilderrc
9+
pbuilderrc="./pbuilder_rc.txt"
10+
rm -f "$pbuilderrc"
11+
#echo "MIRRORSITE=${ARTIFACTORY_URL}/ubuntu-proxy/ubuntu" > "$pbuilderrc"
12+
echo "export http_proxy=\"${HTTPS_PROXY}\"" >> "$pbuilderrc"
13+
#if [ -n "$REPO_FILE_URL" ]; then
14+
# direct="${REPO_FILE_URL##*//}"
15+
# direct="${direct%%/*}"
16+
# echo "no_proxy=\"${direct}\"" >> "$pbuilderrc"
17+
#fi
18+
# shellcheck disable=SC2002
19+
cat "$pbuilderrc" | sudo tee /root/.pbuilderrc
720
fi
821

922
# shellcheck disable=SC2086

packaging/rpm_chrootbuild

+21-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
set -uex
44

5+
: "${HTTPS_PROXY:=}"
6+
: "${REPO_FILE_URL:=}"
7+
: "${ARCH:=$(arch)}"
8+
: "${REPOSITORY_NAME:=artifactory}"
9+
510
cp /etc/mock/"$CHROOT_NAME".cfg mock.cfg
611

712
# Enable mock ccache plugin
@@ -10,8 +15,20 @@ config_opts['plugin_conf']['ccache_enable'] = True
1015
config_opts['plugin_conf']['ccache_opts']['dir'] = "%(cache_topdir)s/%(root)s/ccache/"
1116
EOF
1217

18+
# Optionally add a proxy to mock
19+
if [ -n "$HTTPS_PROXY" ];then
20+
yum_proxy="http://${HTTPS_PROXY##*//}"
21+
echo "config_opts['https_proxy'] = '$yum_proxy'" >> mock.cfg
22+
fi
23+
24+
# No proxy for local mirrors
25+
if [ -n "$REPO_FILE_URL" ]; then
26+
direct="${REPO_FILE_URL##*//}"
27+
direct="${direct%%/*}"
28+
echo "config_opts['no_proxy'] = '${direct}'" >> mock.cfg
29+
fi
1330

14-
if [[ $CHROOT_NAME == *epel-8-x86_64 ]]; then
31+
if [[ $CHROOT_NAME == *"epel-8-${ARCH}" ]]; then
1532
cat <<EOF >> mock.cfg
1633
config_opts['module_setup_commands'] = [
1734
('enable', 'javapackages-tools:201801'),
@@ -21,7 +38,7 @@ EOF
2138
fi
2239

2340
# Use dnf on CentOS 7
24-
if [[ $CHROOT_NAME == *epel-7-x86_64 ]]; then
41+
if [[ $CHROOT_NAME == *"epel-7-${ARCH}" ]]; then
2542
MOCK_OPTIONS="--dnf --no-bootstrap-chroot${MOCK_OPTIONS:+ }$MOCK_OPTIONS"
2643
fi
2744

@@ -61,7 +78,7 @@ if [ -n "${ARTIFACTORY_URL:-}" ] && "$LOCAL_REPOS"; then
6178
fi
6279
fi
6380
curl -sSf "$REPO_FILE_URL"daos_ci-"${CHROOT_NAME%-*}".repo >> mock.cfg
64-
repo_adds+=("--enablerepo *-artifactory")
81+
repo_adds+=("--enablerepo *-${REPOSITORY_NAME}")
6582
fi
6683
fi
6784

@@ -127,7 +144,7 @@ if ! eval time mock -r mock.cfg ${repo_dels[*]} ${repo_adds[*]} --no-clean \
127144
fi
128145

129146
# Save the ccache
130-
if [ -d /scratch/ ]; then
147+
if [ -d /scratch/mock ]; then
131148
mkdir -p "$bs_dir"/
132149
if ! flock "$bs_dir" -c "tar -czf $bs_dir/ccache-$CHROOT_NAME-$PACKAGE.tar.gz /var/cache/mock/${CHROOT_NAME}/ccache"; then
133150
echo "Failed to save ccache. Plowing onward."

0 commit comments

Comments
 (0)