|
187 | 187 | # assume there's only one diff file that corresponds to the PR patch file |
188 | 188 | pr_diff=$(ls [0-9]*.diff | head -1) |
189 | 189 |
|
190 | | -# use PR patch file to determine in which easystack files stuff was added |
191 | | -for easystack_file in $(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^easystacks/.*yml$' | egrep -v 'known-issues|missing'); do |
192 | | - |
193 | | - echo -e "Processing easystack file ${easystack_file}...\n\n" |
194 | | - |
195 | | - # determine version of EasyBuild module to load based on EasyBuild version included in name of easystack file |
196 | | - eb_version=$(echo ${easystack_file} | sed 's/.*eb-\([0-9.]*\).*/\1/g') |
197 | | - |
198 | | - # load EasyBuild module (will be installed if it's not available yet) |
199 | | - source ${TOPDIR}/load_easybuild_module.sh ${eb_version} |
| 190 | +# install any additional required scripts |
| 191 | +# order is important: these are needed to install a full CUDA SDK in host_injections |
| 192 | +# for now, this just reinstalls all scripts. Note the most elegant, but works |
| 193 | +${TOPDIR}/install_scripts.sh --prefix ${EESSI_PREFIX} |
200 | 194 |
|
201 | | - ${EB} --show-config |
| 195 | +# Install full CUDA SDK in host_injections |
| 196 | +# Hardcode this for now, see if it works |
| 197 | +# TODO: We should make a nice yaml and loop over all CUDA versions in that yaml to figure out what to install |
| 198 | +${EESSI_PREFIX}/scripts/gpu_support/nvidia/install_cuda_host_injections.sh -c 12.1.1 --accept-cuda-eula |
202 | 199 |
|
203 | | - echo_green "All set, let's start installing some software with EasyBuild v${eb_version} in ${EASYBUILD_INSTALLPATH}..." |
| 200 | +# Install drivers in host_injections |
| 201 | +# TODO: this is commented out for now, because the script assumes that nvidia-smi is available and works; |
| 202 | +# if not, an error is produced, and the bot flags the whole build as failed (even when not installing GPU software) |
| 203 | +# ${EESSI_PREFIX}/scripts/gpu_support/nvidia/link_nvidia_host_libraries.sh |
204 | 204 |
|
205 | | - if [ -f ${easystack_file} ]; then |
206 | | - echo_green "Feeding easystack file ${easystack_file} to EasyBuild..." |
207 | | - |
208 | | - ${EB} --easystack ${TOPDIR}/${easystack_file} --robot |
209 | | - ec=$? |
210 | | - |
211 | | - # copy EasyBuild log file if EasyBuild exited with an error |
212 | | - if [ ${ec} -ne 0 ]; then |
213 | | - eb_last_log=$(unset EB_VERBOSE; eb --last-log) |
214 | | - # copy to current working directory |
215 | | - cp -a ${eb_last_log} . |
216 | | - echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" |
217 | | - # copy to build logs dir (with context added) |
218 | | - copy_build_log "${eb_last_log}" "${build_logs_dir}" |
| 205 | +# use PR patch file to determine in which easystack files stuff was added |
| 206 | +changed_easystacks=$(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^easystacks/.*yml$' | egrep -v 'known-issues|missing') |
| 207 | +if [ -z ${changed_easystacks} ]; then |
| 208 | + echo "No missing installations, party time!" # Ensure the bot report success, as there was nothing to be build here |
| 209 | +else |
| 210 | + for easystack_file in ${changed_easystacks}; do |
| 211 | + |
| 212 | + echo -e "Processing easystack file ${easystack_file}...\n\n" |
| 213 | + |
| 214 | + # determine version of EasyBuild module to load based on EasyBuild version included in name of easystack file |
| 215 | + eb_version=$(echo ${easystack_file} | sed 's/.*eb-\([0-9.]*\).*/\1/g') |
| 216 | + |
| 217 | + # load EasyBuild module (will be installed if it's not available yet) |
| 218 | + source ${TOPDIR}/load_easybuild_module.sh ${eb_version} |
| 219 | + |
| 220 | + ${EB} --show-config |
| 221 | + |
| 222 | + echo_green "All set, let's start installing some software with EasyBuild v${eb_version} in ${EASYBUILD_INSTALLPATH}..." |
| 223 | + |
| 224 | + if [ -f ${easystack_file} ]; then |
| 225 | + echo_green "Feeding easystack file ${easystack_file} to EasyBuild..." |
| 226 | + |
| 227 | + ${EB} --easystack ${TOPDIR}/${easystack_file} --robot |
| 228 | + ec=$? |
| 229 | + |
| 230 | + # copy EasyBuild log file if EasyBuild exited with an error |
| 231 | + if [ ${ec} -ne 0 ]; then |
| 232 | + eb_last_log=$(unset EB_VERBOSE; eb --last-log) |
| 233 | + # copy to current working directory |
| 234 | + cp -a ${eb_last_log} . |
| 235 | + echo "Last EasyBuild log file copied from ${eb_last_log} to ${PWD}" |
| 236 | + # copy to build logs dir (with context added) |
| 237 | + copy_build_log "${eb_last_log}" "${build_logs_dir}" |
| 238 | + fi |
| 239 | + |
| 240 | + $TOPDIR/check_missing_installations.sh ${TOPDIR}/${easystack_file} |
| 241 | + else |
| 242 | + fatal_error "Easystack file ${easystack_file} not found!" |
219 | 243 | fi |
220 | | - |
221 | | - $TOPDIR/check_missing_installations.sh ${TOPDIR}/${easystack_file} |
222 | | - else |
223 | | - fatal_error "Easystack file ${easystack_file} not found!" |
224 | | - fi |
225 | | - |
226 | | -done |
| 244 | + |
| 245 | + done |
| 246 | +fi |
227 | 247 |
|
228 | 248 | ### add packages here |
229 | 249 |
|
230 | 250 | echo ">> Creating/updating Lmod cache..." |
231 | 251 | export LMOD_RC="${EASYBUILD_INSTALLPATH}/.lmod/lmodrc.lua" |
232 | | -if [ ! -f $LMOD_RC ]; then |
| 252 | +lmodrc_changed=$(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep '^create_lmodrc.py$' > /dev/null; echo $?) |
| 253 | +if [ ! -f $LMOD_RC ] || [ ${lmodrc_changed} == '0' ]; then |
233 | 254 | python3 $TOPDIR/create_lmodrc.py ${EASYBUILD_INSTALLPATH} |
234 | 255 | check_exit_code $? "$LMOD_RC created" "Failed to create $LMOD_RC" |
235 | 256 | fi |
|
0 commit comments