Skip to content

Commit 442e98f

Browse files
authored
Merge pull request #30 from stackhpc/openhpc-update
Update for OpenHPC element
2 parents 40a47b4 + d87678f commit 442e98f

5 files changed

Lines changed: 51 additions & 9 deletions

File tree

elements/openhpc/README.rst

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,34 @@ openhpc
33
=======
44
Install OpenHPC RPMs from a repo using ``yum``.
55

6+
* ``DIB_OPENHPC_VERSION`` Specify the version of OpenHPC to install. OpenHPC 1.3
7+
is based on CentOS 7, and OpenHPC 2.0 is based on CentOS 8. Default is ``2.0``
8+
9+
* ``DIB_OPENHPC_REPO_RPM`` Override default settings for the URL for the OpenHPC repo
10+
RPM package.
11+
12+
For OpenHPC 1.3 the default is https://github.com/openhpc/ohpc/releases/download/v1.3.GA/ohpc-release-1.3-1.el7.x86_64.rpm
13+
14+
For OpenHPC 2.0 the default is http://repos.openhpc.community/OpenHPC/2/CentOS_8/x86_64/ohpc-release-2-1.el8.x86_64.rpm
15+
616
* ``DIB_OPENHPC_GRPLIST`` Define a space-separated list of package groups to install.
7-
Default is:
17+
Default for OpenHPC 1.3 is:
818

919
``ohpc-base-compute ohpc-slurm-client "InfiniBand Support"``
1020

21+
Default for OpenHPC 2.0 is no groups.
22+
1123
Set to an empty string to install no package groups
1224

1325
* ``DIB_OPENHPC_PKGLIST`` Define a space-separated list of packages to install.
14-
Default is:
26+
Default is for OpenHPC 1.3 is:
1527

1628
``lmod-ohpc mrsh-ohpc lustre-client-ohpc``
1729

30+
Default for OpenHPC 2.0 is:
31+
32+
``ohpc-base lmod-ohpc ohpc-slurm-client ohpc-gnu9-runtimes openmpi4-gnu9-ohpc``
33+
1834
Set to an empty string to install no individual packages
1935

2036
* ``DIB_OPENHPC_DELETE_REPO`` Set to ``y`` or ``Y`` to delete the repo after building the image.
Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
#!/bin/bash
22

3-
export OPENHPC_GRPLIST=${DIB_OPENHPC_GRPLIST:-"ohpc-base-compute ohpc-slurm-client 'InfiniBand Support'"}
4-
export OPENHPC_PKGLIST=${DIB_OPENHPC_PKGLIST:-"lmod-ohpc mrsh-ohpc lustre-client-ohpc"}
3+
# Choose from one of a couple of pre-defined repo RPM values
4+
case ${DIB_OPENHPC_VERSION:="2.0"} in
5+
"1.3")
6+
export OPENHPC_REPO_RPM="https://github.com/openhpc/ohpc/releases/download/v1.3.GA/ohpc-release-1.3-1.el7.x86_64.rpm"
7+
export OPENHPC_PKGMGR="yum"
8+
export OPENHPC_GRPLIST=${DIB_OPENHPC_GRPLIST:-"ohpc-base-compute ohpc-slurm-client 'InfiniBand Support'"}
9+
export OPENHPC_PKGLIST=${DIB_OPENHPC_PKGLIST:-"lmod-ohpc mrsh-ohpc lustre-client-ohpc"}
10+
;;
11+
"2.0")
12+
export OPENHPC_REPO_RPM="http://repos.openhpc.community/OpenHPC/2/CentOS_8/x86_64/ohpc-release-2-1.el8.x86_64.rpm"
13+
export OPENHPC_PKGMGR="dnf"
14+
export OPENHPC_GRPLIST=${DIB_OPENHPC_GRPLIST:-""}
15+
export OPENHPC_PKGLIST=${DIB_OPENHPC_PKGLIST:-"ohpc-base lmod-ohpc ohpc-slurm-client ohpc-gnu9-runtimes openmpi4-gnu9-ohpc"}
16+
;;
17+
"*")
18+
echo "Unrecognised/unsupported version of OpenHPC requested: $DIB_OPENHPC_VERSION"
19+
exit -1;;
20+
esac
21+
export DIB_OPENHPC_VERSION
22+
23+
# A URL for the repo RPM can be supplied directly
24+
[[ ! -z "${DIB_OPENHPC_REPO_RPM:-}" ]] && export OPENHPC_REPO_RPM=$DIB_OPENHPC_REPO_RPM
25+
526
export OPENHPC_DELETE_REPO=${DIB_OPENHPC_DELETE_REPO:-n}

elements/openhpc/install.d/92-install-ohpc-packages

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ fi
66
set -eu
77
set -o pipefail
88

9-
[ ! -z "$OPENHPC_GRPLIST" ] && yum groupinstall -y $OPENHPC_GRPLIST
10-
[ ! -z "$OPENHPC_PKGLIST" ] && yum install -y $OPENHPC_PKGLIST
9+
[ ! -z "$OPENHPC_GRPLIST" ] && $OPENHPC_PKGMGR groupinstall -y $OPENHPC_GRPLIST
10+
[ ! -z "$OPENHPC_PKGLIST" ] && $OPENHPC_PKGMGR install -y $OPENHPC_PKGLIST

elements/openhpc/post-install.d/93-openhpc-cleanup

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -o pipefail
88

99
if [ "$OPENHPC_DELETE_REPO" = "y" -o "$OPENHPC_DELETE_REPO" = "Y" ]
1010
then
11-
rm -f /etc/yum.repos.d/OpenHPC.repo
11+
$OPENHPC_PKGMGR remove ohpc-release
1212
fi
1313

14-
systemctl enable ntpd.service
14+
#systemctl enable ntpd.service

elements/openhpc/pre-install.d/91-install-ohpc-repo

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ set -eu
77
set -o pipefail
88

99
[ -d /etc/yum.repos.d ] || exit -1
10-
yum install -y https://github.com/openhpc/ohpc/releases/download/v1.3.GA/ohpc-release-1.3-1.el7.x86_64.rpm
10+
${OPENHPC_PKGMGR} install -y ${OPENHPC_REPO_RPM}
11+
12+
if [ "$DIB_OPENHPC_VERSION" = "2.0" ]
13+
then
14+
${OPENHPC_PKGMGR} config-manager --set-enabled powertools
15+
fi

0 commit comments

Comments
 (0)