Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
!utils/build.config
!utils/certs
!utils/ci
!ci/parse_ci_envs.sh
!ci/rpm/install_deps.sh
!ci/rpm/build_deps.sh
!ci/rpm/build.sh
!utils/completion
!utils/config
!utils/node_local_test.py
Expand Down
593 changes: 13 additions & 580 deletions Jenkinsfile

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion ci/docker_nlt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ sudo --preserve-env=SL_PREFIX,SL_SPDK_PREFIX ./utils/setup_daos_server_helper.sh

TMP_DIR=$(mktemp -d)

cp utils/node_local_test.py utils/nlt_server.yaml .build_vars.json "$TMP_DIR"
#cp utils/node_local_test.py utils/nlt_server.yaml .build_vars.json "$TMP_DIR"
cp utils/node_local_test.py utils/nlt_server.yaml "$TMP_DIR"
cp src/tests/ftest/cart/util/cart_logparse.py src/tests/ftest/cart/util/cart_logtest.py "$TMP_DIR"
if [ -e nltr.json ]
then
Expand Down
55 changes: 9 additions & 46 deletions ci/rpm/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Script for building RPMs in a chroot
# Script for building DAOS
# If the STAGE_NAME environment variable is present the script will
# attempt to parse it to determine what distribution to build for.
#
Expand All @@ -12,49 +12,12 @@
# has disabled fault injection or this is a Release build
set -uex

id
if [ "$(id -u)" = "0" ]; then
echo "Should not be run as root"
exit 1
fi
# Default values for variables that may be set in the environment
: "${JOBS:=144}"
: "${COMPILER:=gcc}"
: "${DAOS_BUILD_TYPE:=dev}"
: "${DAOS_TARGET_TYPE:=release}"

mydir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
ci_envs="$mydir/../parse_ci_envs.sh"
if [ -e "${ci_envs}" ]; then
# shellcheck source=parse_ci_envs.sh disable=SC1091
source "${ci_envs}"
fi

: "${SCONS_FAULTS_ARGS:=BUILD_TYPE=dev}"
SCONS_ARGS="${SCONS_FAULTS_ARGS}"

: "${CHROOT_NAME:='rocky+epel-8-x86_64'}"
: "${TARGET:='el8'}"
: "${REPO_SPEC:='el-8'}"

: "${COVFN_DISABLED:=true}"
: "${JOB_REPOS:=}"
EXTERNAL_COMPILER_OPT=""

if ! $COVFN_DISABLED && [[ $REPO_SPEC == el-* ]]; then
compiler_args="COMPILER=covc"
EXTERNAL_COMPILER_OPT=" --define \"compiler_args ${compiler_args}\""
fi

EXTERNAL_SCONS_OPT=" --define \"scons_args ${SCONS_ARGS}\""
EXTERNAL_RPM_BUILD_OPTIONS="${EXTERNAL_SCONS_OPT}${EXTERNAL_COMPILER_OPT}"

rm -rf "artifacts/${TARGET}/"
if ! mkdir -p "artifacts/${TARGET}/"; then
echo "Failed to create directory \"artifacts/${TARGET}/\""
ls -ld . || true
pwd || true
exit 1
fi

# shellcheck disable=SC2086
DEBEMAIL="$DAOS_EMAIL" DEBFULLNAME="$DAOS_FULLNAME" \
TOPDIR=$PWD make CHROOT_NAME="${CHROOT_NAME}" ${JOB_REPOS} \
EXTERNAL_RPM_BUILD_OPTIONS="${EXTERNAL_RPM_BUILD_OPTIONS}" \
SCONS_ARGS="${SCONS_ARGS}" DISTRO_VERSION="${DISTRO_VERSION}" \
-C utils/rpms chrootbuild
scons --jobs "$JOBS" --build-deps=no install PREFIX=/opt/daos COMPILER="$COMPILER" \
FIRMWARE_MGMT=1 BUILD_TYPE="$DAOS_BUILD_TYPE" TARGET_TYPE="$DAOS_TARGET_TYPE" \
USE_INSTALLED=all
60 changes: 35 additions & 25 deletions utils/docker/Dockerfile.el.9
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2022-2024 Intel Corporation
# Copyright 2025 Google LLC
# Copyright 2025 Hewlett Packard Enterprise Development LP
# Copyright 2025-2026 Hewlett Packard Enterprise Development LP
# All rights reserved.
#
# 'recipe' for Docker to build an image of EL 9 based
Expand Down Expand Up @@ -33,27 +33,22 @@
echo "NO_PROXY=${DAOS_NO_PROXY}" >> /etc/environment

# script to install OS updates basic tools and daos dependencies
COPY ./utils/scripts/install-el9.sh /tmp/install.sh
# script to setup local repo if available
COPY ./utils/scripts/helpers/repo-helper-el9.sh /tmp/repo-helper.sh

RUN chmod +x /tmp/repo-helper.sh /tmp/install.sh && \
/tmp/repo-helper.sh && \
rm -f /tmp/repo-helper.sh
RUN --mount=type=bind,source=utils/scripts/helpers/repo-helper-el9.sh,target=/tmp/repo-helper.sh \
/tmp/repo-helper.sh

FROM basic
# Install OS updates and package. Include basic tools and daos dependencies
RUN dnf upgrade && \
/tmp/install.sh && \
dnf clean all && \
rm -f /tmp/install.sh
RUN dnf upgrade && \
dnf clean all

RUN --mount=type=bind,source=utils/scripts/install-el9.sh,target=/tmp/install.sh \
/tmp/install.sh && \
dnf clean all

# Add DAOS users
ARG UID=1000
COPY ./utils/scripts/helpers/daos-server-user-setup.sh \
/tmp/daos-server-user-setup.sh
RUN set -e; \
chmod +x /tmp/daos-server-user-setup.sh && \
RUN --mount=type=bind,source=utils/scripts/helpers/daos-server-user-setup.sh,target=/tmp/daos-server-user-setup.sh \
/tmp/daos-server-user-setup.sh
RUN useradd --no-log-init --user-group --create-home --shell /bin/bash daos_agent
RUN echo "daos_agent:daos_agent" | chpasswd
Expand All @@ -70,13 +65,15 @@
ENV PATH=/home/daos/venv/bin:$PATH
ENV VIRTUAL_ENV=/home/daos/venv/

# Install latest versions of python tools.
COPY requirements-build.txt requirements-utest.txt ./
RUN python3 -m pip --no-cache-dir install --upgrade pip && \
python3 -m pip --no-cache-dir install -r requirements-build.txt -r requirements-utest.txt
# Install latest versions of python tools without COPY (bind-mount the requirement files).
RUN --mount=type=bind,source=requirements-build.txt,target=/tmp/requirements-build.txt \
--mount=type=bind,source=requirements-utest.txt,target=/tmp/requirements-utest.txt \
python3 -m pip install --upgrade pip && \
python3 -m pip install -r /tmp/requirements-build.txt -r /tmp/requirements-utest.txt

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 3: pipCommand not pinned by hash
Click Remediation section below to solve this issue

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 3: pipCommand not pinned by hash
Click Remediation section below to solve this issue
Comment on lines +69 to +72
Comment on lines +69 to +72

WORKDIR /home/daos/pre
RUN mkdir -p /home/daos/pre/site_scons/prereq_tools /home/daos/pre/site_scons/components
RUN mkdir -p /home/daos/pre/ci
COPY --chown=daos_server:daos_server SConstruct .
COPY --chown=daos_server:daos_server deps deps
COPY --chown=daos_server:daos_server site_scons/prereq_tools site_scons/prereq_tools
Expand All @@ -85,6 +82,13 @@
COPY --chown=daos_server:daos_server utils/scripts/copy_files.sh utils/scripts/copy_files.sh
COPY --chown=daos_server:daos_server utils/scripts/create_spdk_pkgconfig.sh utils/scripts/create_spdk_pkgconfig.sh

COPY --chown=daos_server:daos_server ci/rpm/install_deps.sh ci/rpm/install_deps.sh
COPY --chown=daos_server:daos_server ci/rpm/build_deps.sh ci/rpm/build_deps.sh
COPY --chown=daos_server:daos_server ci/parse_ci_envs.sh ci/parse_ci_envs.sh
COPY --chown=daos_server:daos_server utils/rpms/package_version.sh utils/rpms/package_version.sh
COPY --chown=daos_server:daos_server utils/rpms/package_info.sh utils/rpms/package_info.sh
COPY --chown=daos_server:daos_server utils/rpms/daos.spec utils/rpms/daos.spec

# Control what to build. By default Dockerfiles build everything to allow for
# ease-of-use for users, however in CI everything is turned off and then
# selectively enabled. Turning off any step disables all future steps.
Expand All @@ -101,13 +105,20 @@
dnf upgrade --exclude=spdk,spdk-devel,dpdk-devel,dpdk,mercury-devel,mercury && \
dnf clean all; \
}

USER daos_server:daos_server

# Install DAOS dependency RPMs from a pre-built repository.
# Set DAOS_DEPS_INSTALL to the release value (DAOS_RELVAL) to enable.
ARG DAOS_DEPS_INSTALL=
RUN [ -z "$DAOS_DEPS_INSTALL" ] || { \
export STAGE_NAME="el9"; ci/rpm/install_deps.sh el9 "$DAOS_DEPS_INSTALL" ;\
}

ARG DEPS_JOBS=1

RUN [ "$DAOS_DEPS_BUILD" != "yes" ] || { \
scons --build-deps=only --jobs $DEPS_JOBS PREFIX=/opt/daos \
TARGET_TYPE=$DAOS_TARGET_TYPE && \
ci/rpm/build_deps.sh && \
([ "$DAOS_KEEP_BUILD" != "no" ] || /bin/rm -rf build *.gz); \
}

Expand All @@ -119,7 +130,7 @@
export DISTRO="el9" && \
utils/rpms/build_packages.sh deps && \
mkdir -p /home/daos/rpms && \
mv *.rpm /home/daos/rpms; \
( mv *.rpm /home/daos/rpms || true ); \
}
USER root:root

Expand All @@ -143,6 +154,7 @@
COPY --chown=daos_server:daos_server utils/config utils/config
COPY --chown=daos_server:daos_server utils/certs utils/certs
COPY --chown=daos_server:daos_server utils/completion utils/completion
COPY --chown=daos_server:daos_server ci/rpm/build.sh ci/rpm/build.sh

# select compiler to use
ARG COMPILER=gcc
Expand All @@ -152,9 +164,7 @@

# Build DAOS
RUN [ "$DAOS_BUILD" != "yes" ] || { \
scons --jobs $JOBS install PREFIX=/opt/daos COMPILER=$COMPILER \
FIRMWARE_MGMT=1 BUILD_TYPE=$DAOS_BUILD_TYPE \
TARGET_TYPE=$DAOS_TARGET_TYPE && \
ci/rpm/build.sh && \
([ "$DAOS_KEEP_BUILD" != "no" ] || /bin/rm -rf build) && \
go clean -cache && \
cp -r utils/config/examples /opt/daos; \
Expand Down
Empty file modified utils/scripts/helpers/repo-helper-el9.sh
100644 → 100755
Empty file.
Empty file modified utils/scripts/helpers/repo-helper-fedora.sh
100644 → 100755
Empty file.
Empty file modified utils/scripts/helpers/repo-helper-ubuntu.sh
100644 → 100755
Empty file.
Loading