Skip to content

Commit ae6d6dd

Browse files
committed
Update packaging
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
1 parent 8532d2f commit ae6d6dd

8 files changed

Lines changed: 99 additions & 48 deletions

packaging/Dockerfile.coverity

Lines changed: 2 additions & 1 deletion
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 <daos@daos.groups.io>
10+
LABEL maintainer="daos-stack <daos@daos.groups.io>""
1011

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

packaging/Dockerfile.mockbuild

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ LABEL maintainer="daos@daos.groups.io"
1515
# Use local repo server if present
1616
ARG REPO_FILE_URL
1717
ARG DAOS_LAB_CA_FILE_URL
18+
ARG REPOSITORY_NAME
1819
# script to install OS updates basic tools and daos dependencies
1920
# COPY ./utils/scripts/install-fedora.sh /tmp/install.sh
2021
# script to setup local repo if available
@@ -41,6 +42,8 @@ RUN if [ $UID != 0 ]; then \
4142
useradd -u $UID -ms /bin/bash $USER; \
4243
echo "$USER:$PASSWD" | chpasswd; \
4344
usermod -a -G mock $USER; \
45+
mkdir -p /var/cache/mock; \
46+
chown $USER:root /var/cache/mock; \
4447
fi
4548

4649
ARG CB0

packaging/Dockerfile.ubuntu

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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
36
# Copyright 2025 Hewlett Packard Enterprise Development LP
@@ -13,9 +16,14 @@ ARG BASE_DISTRO
1316

1417
ARG REPO_FILE_URL
1518
ARG DAOS_LAB_CA_FILE_URL
19+
ARG REPOSITORY_NAME
1620
# script to setup local repo if available
1721
COPY ./scripts/repo-helper-ubuntu.sh /tmp/repo-helper.sh
1822

23+
RUN chmod +x /tmp/repo-helper.sh && \
24+
/tmp/repo-helper.sh && \
25+
rm -f /tmp/repo-helper.sh
26+
1927
# Install basic tools
2028
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
2129
autoconf bash ca-certificates curl debhelper dh-make \
@@ -36,7 +44,7 @@ RUN if ! grep "^#includedir /etc/sudoers.d" /etc/sudoers; then
3644
echo "#includedir /etc/sudoers.d" >> /etc/sudoers; \
3745
fi; \
3846
echo "Defaults env_keep += \"DPKG_GENSYMBOLS_CHECK_LEVEL\"" > /etc/sudoers.d/build; \
39-
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; \
4048
echo "build ALL=(ALL) NOPASSWD: /usr/sbin/pbuilder" >> /etc/sudoers.d/build; \
4149
chmod 0440 /etc/sudoers.d/build; \
4250
visudo -c; \

packaging/Dockerfile.ubuntu.20.04

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@ ARG BASE_DISTRO
1616

1717
ARG REPO_FILE_URL
1818
ARG DAOS_LAB_CA_FILE_URL
19+
ARG REPOSITORY_NAME
1920
# script to setup local repo if available
20-
COPY ./scripts/repo-helper-ubuntu.sh /tmp/repo-helper.sh
21+
COPY ./packaging/scripts/repo-helper-ubuntu.sh /tmp/repo-helper.sh
2122

22-
# Install basic tools
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 - rpmdevtools temporary commented out.
2328
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
2429
autoconf bash ca-certificates curl debhelper dh-make \
2530
dpkg-dev dh-python doxygen gcc git git-buildpackage \
2631
javahelper locales make patch pbuilder pkg-config \
27-
python3-dev python3-distro python3-distutils rpm scons wget \
28-
cmake valgrind rpmdevtools
32+
python3-dev python3-distro python3-distutils rpm scons sudo \
33+
wget cmake valgrind # rpmdevtools
2934

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

packaging/Dockerfile.ubuntu.rolling

Lines changed: 2 additions & 1 deletion
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="daos@daos.groups.io"
910

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

packaging/debian_chrootbuild

Lines changed: 48 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,35 @@
22

33
set -uex
44

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

926
# shellcheck disable=SC2086
1027
sudo pbuilder create \
1128
--extrapackages "gnupg ca-certificates" \
12-
$DISTRO_ID_OPT
29+
$DISTRO_ID_OPT || true # Ignore error status for now.
1330

1431
repo_args=""
1532
repos_added=()
33+
# currently a bit broken, pbuilder will not accept user provided CAs.
1634
for repo in $DISTRO_BASE_PR_REPOS $PR_REPOS; do
1735
branch="master"
1836
build_number="lastSuccessfulBuild"
@@ -32,31 +50,34 @@ for repo in $DISTRO_BASE_PR_REPOS $PR_REPOS; do
3250
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/ ./"
3351
done
3452

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

packaging/rpm_chrootbuild

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -uex
44

55
: "${HTTPS_PROXY:=}"
66
: "${REPO_FILE_URL:=}"
7+
: "${ARCH:=$(arch)}"
8+
: "${REPOSITORY_NAME:=artifactory}"
79

810
cp /etc/mock/"$CHROOT_NAME".cfg mock.cfg
911

@@ -13,6 +15,7 @@ config_opts['plugin_conf']['ccache_enable'] = True
1315
config_opts['plugin_conf']['ccache_opts']['dir'] = "%(cache_topdir)s/%(root)s/ccache/"
1416
EOF
1517

18+
1619
# Optionally add a proxy to mock
1720
if [ -n "$HTTPS_PROXY" ];then
1821
yum_proxy="http://${HTTPS_PROXY##*//}"
@@ -26,7 +29,7 @@ if [ -n "$REPO_FILE_URL" ]; then
2629
echo "config_opts['no_proxy'] = '${direct}'" >> mock.cfg
2730
fi
2831

29-
if [[ $CHROOT_NAME == *epel-8-x86_64 ]]; then
32+
if [[ $CHROOT_NAME == *"epel-8-${ARCH}" ]]; then
3033
cat <<EOF >> mock.cfg
3134
config_opts['module_setup_commands'] = [
3235
('enable', 'javapackages-tools:201801'),
@@ -36,7 +39,7 @@ EOF
3639
fi
3740

3841
# Use dnf on CentOS 7
39-
if [[ $CHROOT_NAME == *epel-7-x86_64 ]]; then
42+
if [[ $CHROOT_NAME == *"epel-7-$ARCH" ]]; then
4043
MOCK_OPTIONS="--dnf --no-bootstrap-chroot${MOCK_OPTIONS:+ }$MOCK_OPTIONS"
4144
fi
4245

@@ -76,7 +79,7 @@ if [ -n "${ARTIFACTORY_URL:-}" ] && "$LOCAL_REPOS"; then
7679
fi
7780
fi
7881
curl -sSf "$REPO_FILE_URL"daos_ci-"${CHROOT_NAME%-*}".repo >> mock.cfg
79-
repo_adds+=("--enablerepo *-artifactory")
82+
repo_adds+=("--enablerepo *-${REPOSITORY_NAME}")
8083
fi
8184
fi
8285

packaging/scripts/repo-helper-ubuntu.sh

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/bin/bash
22
set -uex
33

4-
# This script is used by dockerfiles to optionally use
4+
# This script is used by Dockerfiles to optionally use
55
# a local repository instead of a distro provided repository.
66
# It will also optionally allow running a /tmp/install script
77
# for custom packages if present.
88

99
: "${REPO_FILE_URL:=}"
1010
: "${HTTPS_PROXY:=}"
11-
: "${DAOS_LAB_CA_FILE_UR:=}"
11+
: "${DAOS_LAB_CA_FILE_URL:=}"
1212
: "${REPOSITORY_NAME:=artifactory}"
1313

1414
disable_repos () {
@@ -29,7 +29,8 @@ install_curl() {
2929
return
3030
else
3131
apt-get update
32-
apt-get install curl ca-certificates gpg gpg-agent
32+
apt-get install curl ca-certificates gpg gpg-agent \
33+
software-properties-common
3334
fi
3435

3536
if command -v wget; then
@@ -72,10 +73,17 @@ DISTRO_VERSION="${BASE_DISTRO##*:}"
7273
if [ -n "$REPO_FILE_URL" ]; then
7374
install_curl
7475
install_optional_ca
75-
curl -k --noproxy '*' -sSf \
76-
-o "daos_ci-ubuntu${DISTRO_VERSION}-${REPOSITORY_NAME}.list" \
77-
"${REPO_FILE_URL}daos_ci-ubuntu${DISTRO_VERSION}-${REPOSITORY_NAME}.list"
78-
disable_repos
76+
# Ubuntu local repo mirror is not working
77+
# curl -k --noproxy '*' -sSf \
78+
# -o "daos_ci-ubuntu${DISTRO_VERSION}-${REPOSITORY_NAME}.list" \
79+
# "${REPO_FILE_URL}daos_ci-ubuntu${DISTRO_VERSION}-${REPOSITORY_NAME}.list"
80+
# disable_repos
81+
# temp hack until we can debug the Ubuntu repos.
82+
REPO_BASE="${REPO_FILE_URL%repo-files/}"
83+
curl -k --noproxy '*' -sSf \
84+
-o "rpmdevtools_8.10-10_amd64.deb" \
85+
"${REPO_BASE}daos-stack-deps-ubuntu-${DISTRO_VERSION}-x86_64-stable-local/pool/rpmdevtools_8.10-10_amd64.deb"
86+
apt-get install "./rpmdevtools_8.10-10_amd64.deb"
7987
mkdir -p /usr/local/share/keyrings/
8088
curl --noproxy '*' -sSf -O "${REPO_FILE_URL}esad_repo.key"
8189
gpg --no-default-keyring --keyring ./temp-keyring.gpg \
@@ -86,9 +94,10 @@ fi
8694

8795
apt-get update
8896
apt-get upgrade
89-
apt-get install gpg-agent software-properties-common
90-
add-apt-repository ppa:longsleep/golang-backports
97+
# add-apt-repository ppa:longsleep/golang-backports
9198
apt-get update
92-
chmod +x /tmp/install.sh
93-
/tmp/install.sh
99+
if [ -e /tmp/install.sh ]; then
100+
chmod +x /tmp/install.sh
101+
/tmp/install.sh
102+
fi
94103
apt-get clean all

0 commit comments

Comments
 (0)