Skip to content

Commit 12f13ce

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. Currently the pbuilder program is refusing to validate HTTPS certificates that are not using a well known root CA. Signed-off-by: John E. Malmberg <[email protected]>
1 parent 5d7a274 commit 12f13ce

13 files changed

+349
-79
lines changed

.dockerignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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
8+
!packaging/*

Jenkinsfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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

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

+15-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,13 +35,15 @@ 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; \
4143
echo "$USER:$PASSWD" | chpasswd; \
4244
usermod -a -G mock $USER; \
45+
mkdir -p /var/cache/mock; \
46+
chown $USER:root /var/cache/mock; \
4347
fi
4448

4549
ARG CB0

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/debian_chrootbuild

+44-27
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,31 @@
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
1023
sudo pbuilder create \
1124
--extrapackages "gnupg ca-certificates" \
12-
$DISTRO_ID_OPT
25+
$DISTRO_ID_OPT || true # Ignore error status for now.
1326

1427
repo_args=""
1528
repos_added=()
29+
# currently a bit broken, pbuilder will not accept user provided CAs.
1630
for repo in $DISTRO_BASE_PR_REPOS $PR_REPOS; do
1731
branch="master"
1832
build_number="lastSuccessfulBuild"
@@ -32,31 +46,34 @@ for repo in $DISTRO_BASE_PR_REPOS $PR_REPOS; do
3246
repo_args="$repo_args|deb [trusted=yes] ${JENKINS_URL:-https://build.hpdd.intel.com/}job/daos-stack/job/$repo/job/$branch/$build_number/artifact/artifacts/$DISTRO/ ./"
3347
done
3448

35-
repo_args+="|$(curl -sSf "$REPO_FILE_URL"daos_ci-"$DISTRO"-artifactory.list |
36-
sed -e 's/#.*//' -e '/ubuntu-proxy/d' -e '/^$/d' -e '/^$/d' \
37-
-e 's/signed-by=.*\.gpg/trusted=yes/' |
38-
sed -e ':a; N; $!ba; s/\n/|/g')"
39-
for repo in $JOB_REPOS; do
40-
repo_name=${repo##*://}
41-
repo_name=${repo_name//\//_}
42-
if [[ " ${repos_added[*]} " = *\ ${repo_name}\ * ]]; then
43-
# don't add duplicates, first found wins
44-
continue
45-
fi
46-
repos_added+=("$repo_name")
47-
repo_args+="|deb ${repo} $VERSION_CODENAME main"
48-
done
49-
# NB: This PPA is needed to support modern go toolchains on ubuntu 20.04.
50-
# After the build is updated to use 22.04, which supports go >= 1.18, it
51-
# should no longer be needed.
52-
repo_args="$repo_args|deb [trusted=yes] https://ppa.launchpadcontent.net/longsleep/golang-backports/ubuntu $VERSION_CODENAME main"
53-
echo "$repo_args"
54-
if [ "$repo_args" = "|" ]; then
55-
repo_args=""
56-
else
57-
#repo_args="--othermirror"${repo_args#|}\""
58-
repo_args="${repo_args#|}"
59-
fi
49+
# currently broken, builder will not accept internal certs.
50+
# repo_args+="|$(curl -sSf "$REPO_FILE_URL"daos_ci-"$DISTRO"-artifactory.list |
51+
# sed -e 's/#.*//' -e '/ubuntu-proxy/d' -e '/^$/d' -e '/^$/d' \
52+
# -e 's/signed-by=.*\.gpg/trusted=yes/' |
53+
# sed -e ':a; N; $!ba; s/\n/|/g')"
54+
#for repo in $JOB_REPOS; do
55+
# repo_name=${repo##*://}
56+
# repo_name=${repo_name//\//_}
57+
# if [[ " ${repos_added[*]} " = *\ ${repo_name}\ * ]]; then
58+
# # don't add duplicates, first found wins
59+
# continue
60+
# fi
61+
# repos_added+=("$repo_name")
62+
# repo_args+="|deb ${repo} $VERSION_CODENAME main"
63+
#done
64+
65+
## NB: This PPA is needed to support modern go toolchains on ubuntu 20.04.
66+
## After the build is updated to use 22.04, which supports go >= 1.18, it
67+
## should no longer be needed.
68+
# currently broken - claim is public key not available.
69+
#repo_args="$repo_args|deb [trusted=yes] https://ppa.launchpadcontent.net/longsleep/golang-backports/ubuntu $VERSION_CODENAME main"
70+
#echo "$repo_args"
71+
#if [ "$repo_args" = "|" ]; then
72+
# repo_args=""
73+
#else
74+
# #repo_args="--othermirror"${repo_args#|}\""
75+
# repo_args="${repo_args#|}"
76+
#fi
6077
cd "$DEB_TOP"
6178
# shellcheck disable=SC2086
6279
sudo pbuilder update --override-config $DISTRO_ID_OPT ${repo_args:+--othermirror "$repo_args"}

0 commit comments

Comments
 (0)