Skip to content

Commit 8702dfe

Browse files
authored
Merge pull request #21 from boegel/pilot_2020.09
add script for installing 2020.09 pilot stack
2 parents eb02b39 + 7def947 commit 8702dfe

File tree

3 files changed

+311
-0
lines changed

3 files changed

+311
-0
lines changed

.github/workflows/tests.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
2+
name: Tests
3+
on: [push, pull_request]
4+
jobs:
5+
build:
6+
runs-on: ubuntu-18.04
7+
strategy:
8+
matrix:
9+
python: [3.6, 3.7, 3.8]
10+
fail-fast: false
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: set up Python
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: ${{matrix.python}}
18+
architecture: x64
19+
20+
- name: install Python packages
21+
run: |
22+
pip install archspec
23+
24+
- name: test eessi_software_subdir.py script
25+
run: |
26+
./eessi_software_subdir.py | tee out
27+
grep '^x86_64/' out
28+
egrep '/intel/|/amd/' out

EESSI-pilot-2020.09.sh

Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
#!/bin/bash
2+
#
3+
# Script to install EESSI pilot software stack (version 2020.09)
4+
#
5+
6+
TOPDIR=$(dirname $(realpath $0))
7+
8+
function echo_green() {
9+
echo -e "\e[32m$1\e[0m"
10+
}
11+
12+
function echo_red() {
13+
echo -e "\e[31m$1\e[0m"
14+
}
15+
16+
function echo_yellow() {
17+
echo -e "\e[33m$1\e[0m"
18+
}
19+
20+
function error() {
21+
echo_red "ERROR: $1" >&2
22+
exit 1
23+
}
24+
25+
TMPDIR=$(mktemp -d)
26+
27+
echo ">> Setting up environment..."
28+
export CVMFS_REPO="/cvmfs/pilot.eessi-hpc.org"
29+
export EESSI_PILOT_VERSION="2020.09"
30+
export ARCH=$(uname -m)
31+
export EESSI_PREFIX=${CVMFS_REPO}/${EESSI_PILOT_VERSION}
32+
export EPREFIX=${EESSI_PREFIX}/compat/${ARCH}
33+
34+
DETECTION_PARAMETERS=''
35+
GENERIC=0
36+
EB='eb'
37+
if [[ "$1" == "--generic" || "$EASYBUILD_OPTARCH" == "GENERIC" ]]; then
38+
echo_yellow ">> GENERIC build requested, taking appropriate measures!"
39+
DETECTION_PARAMETERS="$DETECTION_PARAMETERS --generic"
40+
GENERIC=1
41+
EB='eb --optarch=GENERIC'
42+
fi
43+
44+
45+
# make sure that $PATH starts with $CVMFS_REPO
46+
# (if not, we're not running in the environment set up by 'startprefix')
47+
if [[ $PATH = ${CVMFS_REPO}* ]]; then
48+
echo_green ">> It looks like we're in a Gentoo Prefix environment, good!"
49+
else
50+
error "Not running in Gentoo Prefix environment, run '${EPREFIX}/startprefix' first!"
51+
fi
52+
53+
echo ">> Initializing Lmod..."
54+
source $EPREFIX/usr/lmod/lmod/init/bash
55+
ml_version_out=$TMPDIR/ml.out
56+
ml --version &> $ml_version_out
57+
if [[ $? -eq 0 ]]; then
58+
echo_green ">> Found Lmod ${LMOD_VERSION}"
59+
else
60+
error "Failed to initialize Lmod?! (see output in ${ml_version_out}"
61+
fi
62+
63+
echo ">> Determining software subdirectory to use for current build host..."
64+
export EESSI_SOFTWARE_SUBDIR=$(python3 $TOPDIR/eessi_software_subdir.py $DETECTION_PARAMETERS)
65+
if [[ -z ${EESSI_SOFTWARE_SUBDIR} ]]; then
66+
error "Failed to determine software subdirectory?!"
67+
else
68+
echo_green ">> Using ${EESSI_SOFTWARE_SUBDIR} as software subdirectory!"
69+
fi
70+
71+
echo ">> Configuring EasyBuild..."
72+
export EASYBUILD_PREFIX=/tmp/${USER}/easybuild
73+
export EASYBUILD_INSTALLPATH=${EESSI_PREFIX}/software/${EESSI_SOFTWARE_SUBDIR}
74+
export EASYBUILD_SOURCEPATH=/tmp/$USER/easybuild/sources:${EESSI_SOURCEPATH}
75+
76+
# just ignore OS dependencies for now, see https://github.com/easybuilders/easybuild-framework/issues/3430
77+
export EASYBUILD_IGNORE_OSDEPS=1
78+
79+
export EASYBUILD_SYSROOT=${EPREFIX}
80+
81+
export EASYBUILD_DEBUG=1
82+
export EASYBUILD_TRACE=1
83+
export EASYBUILD_ZIP_LOGS=bzip2
84+
85+
export EASYBUILD_RPATH=1
86+
export EASYBUILD_FILTER_ENV_VARS=LD_LIBRARY_PATH
87+
88+
89+
DEPS_TO_FILTER=Autoconf,Automake,Autotools,binutils,bzip2,gettext,libreadline,libtool,M4,ncurses,XZ,zlib
90+
# For aarch64 we need to also filter out Yasm.
91+
# See https://github.com/easybuilders/easybuild-easyconfigs/issues/11190
92+
if [[ "$ARCH" == "aarch64" ]]; then
93+
DEPS_TO_FILTER="${DEPS_TO_FILTER},Yasm"
94+
fi
95+
96+
export EASYBUILD_FILTER_DEPS=$DEPS_TO_FILTER
97+
98+
99+
export EASYBUILD_MODULE_EXTENSIONS=1
100+
101+
echo ">> Setting up \$MODULEPATH..."
102+
# make sure no modules are loaded
103+
module --force purge
104+
# ignore current $MODULEPATH entirely
105+
module unuse $MODULEPATH
106+
module use $EASYBUILD_INSTALLPATH/modules/all
107+
if [[ -z ${MODULEPATH} ]]; then
108+
error "Failed to set up \$MODULEPATH?!"
109+
else
110+
echo_green ">> MODULEPATH set up: ${MODULEPATH}"
111+
fi
112+
113+
echo ">> Checking for EasyBuild module..."
114+
ml_av_easybuild_out=$TMPDIR/ml_av_easybuild.out
115+
module avail easybuild &> ${ml_av_easybuild_out}
116+
if [[ $? -eq 0 ]]; then
117+
echo_green ">> EasyBuild module found!"
118+
else
119+
echo_yellow ">> No EasyBuild module yet, installing it..."
120+
121+
eb_bootstrap_out=${TMPDIR}/eb_bootstrap.out
122+
123+
workdir=${TMPDIR}/easybuild_bootstrap
124+
mkdir -p ${workdir}
125+
cd ${workdir}
126+
curl --silent -OL https://raw.githubusercontent.com/easybuilders/easybuild-framework/develop/easybuild/scripts/bootstrap_eb.py
127+
python3 bootstrap_eb.py ${EASYBUILD_INSTALLPATH} &> ${eb_bootstrap_out}
128+
cd - > /dev/null
129+
130+
module avail easybuild &> ${ml_av_easybuild_out}
131+
if [[ $? -eq 0 ]]; then
132+
echo_green ">> EasyBuild module installed!"
133+
else
134+
error "EasyBuild module failed to install?! (output of bootstrap script in ${eb_bootstrap_out}, output of 'ml av easybuild' in ${ml_av_easybuild_out})"
135+
fi
136+
fi
137+
138+
echo ">> Loading EasyBuild module..."
139+
module load EasyBuild
140+
$EB --version
141+
if [[ $? -eq 0 ]]; then
142+
echo_green ">> Looking good!"
143+
$EB --show-config
144+
else
145+
error "EasyBuild not working?!"
146+
fi
147+
148+
echo_green "All set, let's start installing some software in ${EASYBUILD_INSTALLPATH}..."
149+
150+
export GCC_EC="GCC-9.3.0.eb"
151+
echo ">> Starting slow with ${GCC_EC}..."
152+
$EB ${GCC_EC} --robot
153+
if [[ $? -eq 0 ]]; then
154+
echo_green "${GCC_EC} installed, yippy! Off to a good start..."
155+
else
156+
error "Installation of ${GCC_EC} failed!"
157+
fi
158+
159+
# side-step to fix missing build dependency for Perl,
160+
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/11200
161+
export PERL_EC="Perl-5.30.2-GCCcore-9.3.0.eb"
162+
echo ">> Taking a small side step to install ${PERL_EC}..."
163+
$EB --from-pr 11368 makeinfo-6.7-GCCcore-9.3.0.eb --robot && $EB --from-pr 11200 --robot
164+
if [[ $? -eq 0 ]]; then
165+
echo_green "${PERL_EC} installed via easyconfigs PR #11200, that was just a small side step, don't worry..."
166+
else
167+
error "Installation of ${PERL_EC} failed!"
168+
fi
169+
170+
# side-step to fix installation of CMake with zlib included in --filter-deps
171+
# see https://github.com/easybuilders/easybuild-easyblocks/pull/2187
172+
echo ">> Installing CMake with fixed easyblock..."
173+
$EB CMake-3.16.4-GCCcore-9.3.0.eb --include-easyblocks-from-pr 2187 --robot
174+
if [[ $? -eq 0 ]]; then
175+
echo_green "CMake installation done, glad that worked out!"
176+
else
177+
error "Installation of CMake failed, pfft..."
178+
fi
179+
180+
# required to make sure that libraries like zlib that are listed in --filter-deps can be found by pkg-config
181+
# FIXME: fix this in EasyBuild framework!
182+
# see https://github.com/easybuilders/easybuild-framework/pull/3451
183+
export PKG_CONFIG_PATH=$EPREFIX/usr/lib64/pkgconfig
184+
185+
# FIXME custom installation of Qt5 with patch required to build with Gentoo's zlib
186+
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/11385
187+
echo ">> Installing Qt5 with extra patch to use zlib provided by Gentoo..."
188+
$EB --from-pr 11385 --robot
189+
if [[ $? -eq 0 ]]; then
190+
echo_green "Done with custom Qt5!"
191+
else
192+
error "Installation of custom Qt5 failed, grrr..."
193+
fi
194+
195+
echo ">> Installing OpenBLAS, Python 3 and Qt5..."
196+
# If we're building OpenBLAS for GENERIC, we need https://github.com/easybuilders/easybuild-easyblocks/pull/1946
197+
if [[ $GENERIC -eq 1 ]]; then
198+
echo_yellow ">> Using https://github.com/easybuilders/easybuild-easyblocks/pull/1946 to build generic OpenBLAS."
199+
$EB --include-easyblocks-from-pr 1946 OpenBLAS-0.3.9-GCC-9.3.0.eb Python-3.8.2-GCCcore-9.3.0.eb Qt5-5.14.1-GCCcore-9.3.0.eb --robot
200+
else
201+
$EB OpenBLAS-0.3.9-GCC-9.3.0.eb Python-3.8.2-GCCcore-9.3.0.eb Qt5-5.14.1-GCCcore-9.3.0.eb --robot
202+
fi
203+
if [[ $? -eq 0 ]]; then
204+
echo_green "Done with OpenBLAS, Python 3 and Qt5!"
205+
else
206+
error "Installation of OpenBLAS, Python 3 and Qt5 failed!"
207+
fi
208+
209+
# FIXME: customized installation of OpenMPI, that supports high speed interconnects properly...
210+
# see https://github.com/EESSI/software-layer/issues/14
211+
echo ">> Installing properly configured OpenMPI..."
212+
$EB --from-pr 11387 OpenMPI-4.0.3-GCC-9.3.0.eb --include-easyblocks-from-pr 2188 --robot
213+
if [[ $? -eq 0 ]]; then
214+
echo_green "OpenMPI installed, w00!"
215+
else
216+
error "Installation of OpenMPI failed, that's not good..."
217+
fi
218+
219+
# FIXME custom instalation LAME with patch required to build on top of ncurses provided by Gentoo
220+
echo ">> Installing LAME with patch..."
221+
$EB --from-pr 11388 LAME-3.100-GCCcore-9.3.0.eb --robot
222+
if [[ $? -eq 0 ]]; then
223+
echo_green "LAME installed, yippy!"
224+
else
225+
error "Installation of LAME failed, oops..."
226+
fi
227+
228+
echo ">> Installing GROMACS and OpenFOAM (twice!)..."
229+
$EB GROMACS-2020.1-foss-2020a-Python-3.8.2.eb OpenFOAM-8-foss-2020a.eb OpenFOAM-v2006-foss-2020a.eb --robot
230+
if [[ $? -eq 0 ]]; then
231+
echo_green "GROMACS and OpenFOAM installed, wow!"
232+
else
233+
error "Installation of GROMACS and OpenFOAM failed, we were so close..."
234+
fi
235+
236+
echo ">> Installing R 4.0.0 (better be patient)..."
237+
$EB R-4.0.0-foss-2020a.eb --robot --include-easyblocks-from-pr 2189
238+
if [[ $? -eq 0 ]]; then
239+
echo_green "R installed, wow!"
240+
else
241+
error "Installation of R failed, so sad..."
242+
fi
243+
244+
echo ">> Installing Bioconductor 3.11 bundle..."
245+
$EB R-bundle-Bioconductor-3.11-foss-2020a-R-4.0.0.eb --robot
246+
if [[ $? -eq 0 ]]; then
247+
echo_green "Bioconductor installed, enjoy!"
248+
else
249+
error "Installation of Bioconductor failed, that's annoying..."
250+
fi
251+
252+
253+
echo ">> Cleaning up ${TMPDIR}..."
254+
rm -r ${TMPDIR}

eessi_software_subdir.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env python3
2+
#
3+
# Determine EESSI software subdirectory to use for current build host, using archspec
4+
#
5+
import os
6+
import argparse
7+
import archspec.cpu
8+
9+
parser = argparse.ArgumentParser(description='Determine EESSI software subdirectory to use for current build host.')
10+
parser.add_argument('--generic', dest='generic', action='store_true',
11+
default=False, help='Use generic for CPU name.')
12+
args = parser.parse_args()
13+
14+
host_cpu = archspec.cpu.host()
15+
vendors = {
16+
'GenuineIntel': 'intel',
17+
'AuthenticAMD': 'amd',
18+
}
19+
20+
vendor = vendors.get(host_cpu.vendor)
21+
22+
if args.generic:
23+
parts = (host_cpu.family.name, 'generic')
24+
elif vendor:
25+
parts = (host_cpu.family.name, vendor, host_cpu.name)
26+
else:
27+
parts = (host_cpu.family.name, host_cpu.name)
28+
29+
print(os.path.join(*parts))

0 commit comments

Comments
 (0)