Skip to content

SRE-3893 build: Consolidate build scripts - #19016

Open
grom72 wants to merge 8 commits into
masterfrom
grom72/SRE-3893-script2build
Open

grom72 wants to merge 8 commits into
masterfrom
grom72/SRE-3893-script2build

Conversation

@grom72

@grom72 grom72 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Consolidate dependency installation, dependency builds, DAOS builds,
package generation, and RPM verification under utils/build. Use these
entry points consistently from Jenkins, Docker builds, and bare-host
workflows while retaining support for custom scons options.

By default, generate dependency and DAOS RPMs directly under
<repo_root>/rpms/deps and <repo_root>/rpms/daos, respectively, and
create repository metadata under <repo_root>/rpms/repodata. Allow
RPM_OUTPUT_DIR to override the repository root.

Add distro auto-detection, optional external dependency repositories,
and configurable package-verification severity. Remove the superseded
wrappers from ci/rpm and utils/rpms.

Update Jenkins to copy dependency RPMs produced in the Docker build
image into the workspace repository so that dependency and DAOS RPMs
are included in the artifact upload.

Changes

  • Add shared utils/build scripts for:
    • installing pre-built dependencies;
    • building missing dependencies;
    • building DAOS;
    • generating and verifying packages.
  • Remove the superseded ci/rpm and utils/rpms/build_packages.sh wrappers.
  • Add automatic EL and openSUSE Leap distro detection.
  • Support an optional temporary dependency repository through
    DAOS_DEPS_EXT_REPO for the install_deps.sh script (to be used mainly as bare-host builds pre-step).
  • Allow additional options and variables to pass through to scons in build_daos.sh and build_deps.sh scripts.
  • Update the EL9 and Leap 15 Docker build flows to use the unified scripts.
  • Update Jenkins RPM generation and artifact collection.
  • Document the unified four-step build procedure.

Package verification

Package verification runs automatically after each nonempty RPM group.

  • verify=yes treats validation findings as errors.
  • verify=no reports validation findings as warnings.
  • Missing tooling and other critical setup errors remain fatal.

Requires:

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Errors are Unable to load ticket data
https://daosio.atlassian.net/browse/SRE-3893

@grom72
grom72 force-pushed the grom72/SRE-3893-script2build branch from f31fa70 to db5ee07 Compare September 4, 2026 11:21
@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

@grom72
grom72 force-pushed the grom72/SRE-3893-script2build branch 4 times, most recently from a6ee981 to b423038 Compare September 4, 2026 20:37
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium Verbs Provider MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-19016/10/execution/node/858/log

@grom72
grom72 force-pushed the grom72/SRE-3893-script2build branch 7 times, most recently from e0cbb87 to 32eb1f3 Compare September 9, 2026 15:03
Comment thread utils/build/build_utils.sh Outdated
Comment thread utils/build/build_utils.sh Outdated
Comment thread utils/build/build_utils.sh Outdated
Comment thread utils/build/build_utils.sh Outdated
Comment thread utils/build/build_utils.sh Outdated
Comment thread utils/build/build_deps.sh Outdated
Comment thread utils/build/build_deps.sh
@grom72
grom72 force-pushed the grom72/SRE-3893-script2build branch 4 times, most recently from 6deddc7 to 93864f9 Compare September 10, 2026 09:23
Consolidate dependency installation, dependency builds, DAOS builds,
package generation, and RPM verification under utils/build. Use these
entry points consistently from Jenkins, Docker builds, and bare-host
workflows while retaining support for custom scons options.

By default, generate dependency and DAOS RPMs directly under
<repo_root>/rpms/deps and <repo_root>/rpms/daos, respectively, and
create repository metadata under <repo_root>/rpms/repodata. Allow
RPM_OUTPUT_DIR to override the repository root.

Add distro auto-detection, optional external dependency repositories,
and configurable package-verification severity. Remove the superseded
wrappers from ci/rpm and utils/rpms.

Update Jenkins to copy dependency RPMs produced in the Docker build
image into the workspace repository so that dependency and DAOS RPMs
are included in the artifact upload.

skip-cancel-previous-builds: true
skip-python-bandit-check: true
skip-unit-tests: true
skip-test: true
skip-test-hardware: true
skip-functional-on-leap-15: false

Priority: 2
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
Document the shared scripts for installing dependencies, building DAOS, generating packages, and creating a complete RPM repository. Update Docker examples and packaging script paths to match the new layout.

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>

skip-cancel-previous-builds: true
skip-python-bandit-check: true
skip-unit-tests: true
skip-test: true
skip-test-hardware: true
skip-functional-on-leap-15: false
Move distro detection from build_packages.sh to build_utils.sh so it can
also be reused by install_deps.sh.

Propagate detection failures explicitly from command substitutions and
avoid importing variables from /etc/os-release into the calling shell.

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>

Priority: 2
@grom72
grom72 force-pushed the grom72/SRE-3893-script2build branch from 93864f9 to 9d48806 Compare September 10, 2026 16:21
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>

Priority: 2
@grom72
grom72 requested a review from janekmi September 10, 2026 16:53
@grom72 grom72 changed the title SRE-3893 build: script2build SRE-3893 build: Consolidate build scripts Sep 10, 2026
@grom72
grom72 marked this pull request as ready for review September 10, 2026 16:54
@grom72
grom72 requested a review from a team as a code owner September 10, 2026 16:54
@grom72
grom72 requested a review from a team as a code owner September 10, 2026 16:54
@grom72
grom72 requested review from daltonbohning, knard38 and phender and removed request for a team September 10, 2026 16:54
Comment thread docs/dev/development.md
Comment thread docs/dev/development.md Outdated
Comment thread docs/dev/development.md Outdated
Comment thread docs/dev/development.md Outdated
Comment thread docs/dev/development.md Outdated
ARG DAOS_TARGET_TYPE=
ARG DEPS_JOBS=

ARG DAOS_BUILD_TYPE=$DAOS_TARGET_TYPE

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these arguments are named differently by mean the same thing? 😕

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ask scons ;)

utils/build/build_deps.sh \
${DEPS_JOBS:+--jobs "$DEPS_JOBS"} \
${DAOS_BUILD_TYPE:+BUILD_TYPE="$DAOS_BUILD_TYPE"} \
${DAOS_TARGET_TYPE:+TARGET_TYPE="$DAOS_TARGET_TYPE"} && \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does truely the cleanup step depend on the build step hence you need && ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not about cleanup it is about failing the whole Docker step.

Comment thread utils/docker/Dockerfile.el.9 Outdated
[ "$DAOS_KEEP_BUILD" != "no" ] || { \
rm -rf .sconf_temp .sconsign.dblite config.log && \
([ "$DAOS_KEEP_BUILD" != "no" ] || /bin/rm -rf build *.gz); \
/bin/rm -rf build *.gz; \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Indentation.
  2. /bin/rm seriously?
  3. You can probably combine both calls.
Suggested change
/bin/rm -rf build *.gz; \
rm -rf .sconf_temp .sconsign.dblite config.log build *.gz;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done
4aca75c

Comment thread utils/docker/Dockerfile.el.9 Outdated
ARG DAOS_DEPS_BUILD
ARG DAOS_BUILD=$DAOS_DEPS_BUILD
ARG DAOS_JAVA_BUILD=$DAOS_BUILD
ARG DAOS_JAVA_BUILD=no

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant?

Suggested change
ARG DAOS_JAVA_BUILD=no
ARG DAOS_JAVA_BUILD

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch ;)
4aca75c

Comment thread utils/docker/Dockerfile.el.9 Outdated
Comment on lines +291 to +292
mkdir -p /home/daos/daos/src && \
cp -r /tmp/daos-src/. /home/daos/daos/src && \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation.

Suggested change
mkdir -p /home/daos/daos/src && \
cp -r /tmp/daos-src/. /home/daos/daos/src && \
mkdir -p /home/daos/daos/src && \
cp -r /tmp/daos-src/. /home/daos/daos/src && \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium Verbs Provider MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-19016/36/execution/node/1869/log

Replace positional build and verification modes with named options:
--build-range, --rpm-suffix, -Werror, and -Wno-error. Make the
package output directory optional and update all Jenkins and Docker
callers accordingly.

Update dependency and verification script usage documentation, support
command-line BUILD_TYPE cleanup with --force, fix Docker ownership and
RPM output path handling, and synchronize the development guide with
the new interfaces.

Address review comments.

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
@grom72
grom72 requested a review from janekmi September 14, 2026 08:29
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>

Doc-only: true
Priority: 2
skip-cancel-previous-builds: true
@daosbuild3

Copy link
Copy Markdown
Collaborator

Test stage Functional Hardware Medium Verbs Provider MD on SSD completed with status FAILURE. https://jenkins-3.daos.hpc.amslabs.hpecorp.net//job/daos-stack/job/daos/view/change-requests/job/PR-19016/37/execution/node/1745/log

@knard38 knard38 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good to me.
Some points to clarify and/or fix.

Comment thread utils/build/build_deps.sh
Comment on lines +69 to +71
BUILD_TYPE=*)
build_type="${arg#BUILD_TYPE=}"
;;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding scons prefers TARGET_TYPE over BUILD_TYPE for naming the real prereq directory whenever TARGET_TYPE is set to anything other than default (site_scons/prereq_tools/base.py's _setup_build_type()), and this script has no TARGET_TYPE=* case at all.

If I am correct, this is what it should looks like in practice:

$ utils/build/build_deps.sh --force TARGET_TYPE=debug
Removing "/opt/daos/prereq/release"      # untouched artifacts, wiped anyway
Removing "build/external/release"        # same
...
# scons then builds with TARGET_TYPE=debug, i.e. into
# prereq/debug/ -- the one directory --force never cleaned

So --force wipes the wrong (release) tree and leaves the one that's actually about to be (re)built (debug) alone -- the opposite of what -f/--force promises.

A possible fix could be to mirroring scons's own precedence (prefer TARGET_TYPE when given, else fall back to BUILD_TYPE):

target_type=""
build_type=release
for arg in "$@"; do
    case "$arg" in
        ...
        BUILD_TYPE=*)
            build_type="${arg#BUILD_TYPE=}"
            ;;
        TARGET_TYPE=*)
            target_type="${arg#TARGET_TYPE=}"
            ;;
    esac
done
ttype="${target_type:-$build_type}"
# ... then use "${ttype}" instead of "${build_type}" in
# both rm -rf lines below

@grom72 grom72 Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good-catch :) c88d6fe

;;
esac
done
verify_mode="${verify_mode:--Werror}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding, the Jenkins bare-host "Build DAOS RPMs" step calls with no -Werror/-Wno-error flag (line 853 and 919 of the Jenkinsfile), so it runs with the script's own default (-Werror, strict).

Meanwhile both Docker-image RPM-build steps explicitly do:

set -- --build-range=daos /home/daos/rpms;
[ "$DAOS_PACKAGES_VERIFY" = "yes" ] || set -- "$@" -Wno-error;

Thus, they stay lenient by default unless DAOS_PACKAGES_VERIFY=yes is explicitly set. From my investigation, I was not able to find usage of this last variable. If I am correct, the rpm used by the Jenkins bare host and the one from the docker image are not consistent.
Should the bare-host call also pass  -Wno-error  for parity, or is stricter-by-default intentional here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal is to let Dockerfile user to disable RPMs validation.
The default behavior is to verify RPMs and the way to disable it (but still get warnings is something is wrong) is to use --build-arg DAOS_PACKAGES_VERIFY=no

Comment thread utils/build/install_deps.sh Outdated


# The script can be used only on el9 and leap/sles 15
validate_rpm_suffix() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we put this function in build_utils.sh and replace equivalent inline code in verify_packages.sh and build_packages.sh ?

@grom72 grom72 Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do You mean install_deps.sh?

The build_package.sh script can also be used for Debian/Ubuntu:
OUTPUT_TYPE=deb ./utils/build/build_packages.sh --build-range=deps

validate_rpm_suffix() has been moved to build_utils.sh -> c88d6fe

Comment thread utils/build/build_daos.sh
Comment on lines +44 to +48
case "$arg" in
-c)
scons -c
exit 0
;;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
case "$arg" in
-c)
scons -c
exit 0
;;
-c)
scons -c
rm -rf .sconf_temp .sconsign.dblite config.log build .build_vars.sh .build_vars.json
exit 0
;;
--full-clean)
scons -c
rm -rf .sconf_temp .sconsign.dblite config.log build .build_vars.sh .build_vars.json daos.conf
exit 0
;;

From my experience, the scons -c is not fully reliable. To have a proper cleanup, I have to remove some files generated by the build process. Most of the time, I am doing a full cleanup with removing the daos.conf file generated: without this it reuse the initial setting even if I redefine it on the command line.

However, I am not sure of the exact goal behind the -c that you aim ?

@grom72 grom72 Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fxed: c88d6fe

Comment thread docs/dev/development.md
make sure the file is referenced by the
`RPM_CHANGELOG="<component>.changelog"` variable in `utils/rpms/<component>.sh`.

## Unified DAOS Build Procedure

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding, most of these new scripts are not yet supporting Debian like distribution.
It should be valuable, to clearly to define the status of the support of such distribution.
From my side, I am still able to build Debian package as before and thus I have not detected regression.

@grom72 grom72 Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation updated: c88d6fe

- Align build and dependency script usage messages.
- Handle help and clean options directly in each script.
- Validate supported RPM suffixes through shared helpers.
- Use SCons defaults for build_daos dependency handling.
- Improve dependency cleanup for BUILD_TYPE and TARGET_TYPE.
- Reuse build_daos cleanup in the EL9 and Leap Dockerfiles.
- Clarify supported distributions and build-script behavior in the docs.
- improving the help content - usage()

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
@grom72
grom72 requested a review from knard38 September 15, 2026 21:49
- Add full-clean support to build_daos.sh while preserving build metadata
  for the regular clean path.
- Keep Docker dependency-stage cleanup independent of the full DAOS source
  tree and preserve build variables required for RPM packaging.
- Suppress unnecessary RPM packaging xtrace output.
- Improve usage formatting for build and dependency scripts.
- Clarify RPM suffix, dependency installation, verification, and cleanup
  documentation.
- Make read-only site_scons cache cleanup non-fatal.

Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants