Skip to content

Commit 66901cb

Browse files
rautericbwbarrett
authored andcommitted
Fix Open MPI RPM build step: build and install deps
This change builds and installs openmpix and prrte from the ompi tree to ensure correct versions. Also skips building man pages if using RST documenation. Signed-off-by: Eric Raut <eraut@amazon.com>
1 parent 3f1e2ac commit 66901cb

File tree

2 files changed

+55
-8
lines changed

2 files changed

+55
-8
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
#
3+
# usage: build-rpm.sh <build_prefix> <srpm_name>
4+
#
5+
# Script to build a binary RPM from a source RPM
6+
#
7+
# Expected filesystem layout:
8+
# ${WORKSPACE}/ompi-scripts/ ompi-scripts checkout
9+
# ${WORKSPACE}/ompi/ ompi checkout @ target REF
10+
# ${WORKSPACE}/dist-files/ output of build
11+
12+
set -e
13+
14+
build_prefix="$1"
15+
srpm_name="$2"
16+
17+
aws s3 cp ${build_prefix}/${srpm_name} ${srpm_name}
18+
19+
# Build and install PRRTE and OpenPMIX, if available
20+
if [[ -d ${WORKSPACE}/ompi/3rd-party/openpmix ]]; then
21+
pushd ${WORKSPACE}/ompi/3rd-party/openpmix
22+
./autogen.pl; ./configure; make dist
23+
cd contrib
24+
tarball=$(find .. -name "*.bz2" -print)
25+
rpmtopdir="${WORKSPACE}/rpmbuild" build_srpm=no build_single=yes ./buildrpm.sh $tarball
26+
rpm_name=$(find ${WORKSPACE}/rpmbuild/RPMS -name "pmix*.rpm" -print)
27+
sudo rpm -Uvh ${rpm_name}
28+
popd
29+
fi
30+
31+
if [[ -d ${WORKSPACE}/ompi/3rd-party/prrte ]]; then
32+
pushd ${WORKSPACE}/ompi/3rd-party/prrte
33+
./autogen.pl; ./configure; make dist
34+
cd contrib/dist/linux
35+
tarball=$(find ../../.. -name "*.bz2" -print)
36+
rpmtopdir="${WORKSPACE}/rpmbuild" ./buildrpm.sh -b "${tarball}"
37+
rpm_name=$(find ${WORKSPACE}/rpmbuild/RPMS -name "prrte*.rpm" -print)
38+
sudo rpm -Uvh ${rpm_name}
39+
popd
40+
fi
41+
42+
rpmbuild --rebuild ${srpm_name}
43+
bin_rpm_name=`find ${WORKSPACE}/rpmbuild/RPMS -name "openmpi*.rpm" -print`
44+
sudo rpm -Uvh ${bin_rpm_name}

jenkins/open-mpi.dist.create-tarball.groovy

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,14 @@ parallel (
109109
node(manpage_builder) {
110110
stage('Build Man Pages') {
111111
checkout_code();
112-
sh "ls -lR . ; /bin/bash ompi-scripts/jenkins/open-mpi.dist.create-tarball.build-manpages.sh ${build_prefix} ${tarball} ${branch}"
113-
artifacts = sh(returnStdout:true, script:'cat ${WORKSPACE}/manpage-build-artifacts.txt').trim()
114-
currentBuild.description="${currentBuild.description}<b>Manpages:</b> <A HREF=\"${artifacts}\">${artifacts}</A><BR>\n"
112+
// Check if we need to build man pages
113+
if (sh(script: "test -f ${WORKSPACE}/ompi/docs/history.rst", returnStatus: true) != 0) {
114+
sh "ls -lR . ; /bin/bash ompi-scripts/jenkins/open-mpi.dist.create-tarball.build-manpages.sh ${build_prefix} ${tarball} ${branch}"
115+
artifacts = sh(returnStdout:true, script:'cat ${WORKSPACE}/manpage-build-artifacts.txt').trim()
116+
currentBuild.description="${currentBuild.description}<b>Manpages:</b> <A HREF=\"${artifacts}\">${artifacts}</A><BR>\n"
117+
} else {
118+
echo "Using RST; skipping building man pages"
119+
}
115120
}
116121
}
117122
},
@@ -132,11 +137,9 @@ make distcheck"""
132137
"rpm test suites" : {
133138
node(rpm_builder) {
134139
stage('RPM Build') {
135-
prep_rpm_environment()
136-
sh """aws s3 cp ${build_prefix}/${srpm_name} ${srpm_name}
137-
rpmbuild --rebuild ${srpm_name}
138-
bin_rpm_name=`find ${WORKSPACE}/rpmbuild/RPMS -name "*.rpm" -print`
139-
sudo rpm -Uvh \${bin_rpm_name}"""
140+
prep_rpm_environment();
141+
checkout_code();
142+
sh "/bin/bash ${WORKSPACE}/ompi-scripts/jenkins/open-mpi.dist.create-tarball.build-rpm.sh ${build_prefix} ${srpm_name}"
140143
}
141144
}
142145
},

0 commit comments

Comments
 (0)