From 05d85a9d2790e29c59f203ca4f695afeb7f07cec Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Fri, 18 Aug 2023 14:41:01 +0200 Subject: [PATCH 01/14] initial version for bot/inspect.sh --- bot/inspect.sh | 240 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 bot/inspect.sh diff --git a/bot/inspect.sh b/bot/inspect.sh new file mode 100644 index 0000000000..39ac7ceb99 --- /dev/null +++ b/bot/inspect.sh @@ -0,0 +1,240 @@ +#!/usr/bin/env bash +# +# Script to inspect result of a build job for the EESSI software layer. +# Intended use is that it is called with a path to a job directory. +# +# This script is part of the EESSI software layer, see +# https://github.com/EESSI/software-layer.git +# +# author: Thomas Roeblitz (@trz42) +# +# license: GPLv2 +# + +# ASSUMPTIONs: +# - Script is executed on the same architecture the job was running on. +# - Initially, we also assume that is run on the same resource with the +# same (compute) node setup (local disk space, HTTP proxies, etc.) +# - The job directory being supplied has been prepared by the bot with a +# checkout of a pull request (OR by some other means) +# - The job directory contains a directory 'cfg' where the main config +# file 'job.cfg' has been deposited. +# - The 'cfg' directory may contain any additional files referenced in +# 'job.cfg' (repos.cfg, etc.). +# - The job produced some tarballs for its state (tmp disk for overlayfs, +# CVMFS cache, etc.) under 'previous_tmp/{build,tarball}_step'. + +# stop as soon as something fails +set -e + +display_help() { + echo "usage: $0 [OPTIONS]" + echo " -h | --help - display this usage information" + echo " -j | --job-dir DIR - inspect job with the given work directory DIR" + echo " -x | --http-proxy URL - provides URL for the environment variable http_proxy" + echo " -y | --https-proxy URL - provides URL for the environment variable https_proxy" +} + +job_dir= +http_proxy= +https_proxy= + +POSITIONAL_ARGS=() + +while [[ $# -gt 0 ]]; do + case ${1} in + -h|--help) + display_help + exit 0 + ;; + -j|--job-dir) + export job_dir="${2}" + shift 2 + ;; + -x|--http-proxy) + export http_proxy="${2}" + shift 2 + ;; + -y|--https-proxy) + export https_proxy="${2}" + shift 2 + ;; + -*|--*) + echo "Error: Unknown option: ${1}" >&2 + exit 1 + ;; + *) # No more options + POSITIONAL_ARGS+=("${1}") # save positional arg + shift + ;; + esac +done + +set -- "${POSITIONAL_ARGS[@]}" + +# source utils.sh and cfg_files.sh +source scripts/utils.sh +source scripts/cfg_files.sh + +if [[ -z ${job_dir} ]]; then + echo_yellow "path to job directory missing" + display_help + exit 1 +fi + +# defaults +export JOB_CFG_FILE="${job_dir}/cfg/job.cfg}" +HOST_ARCH=$(uname -m) + +# check if ${JOB_CFG_FILE} exists +if [[ ! -r "${JOB_CFG_FILE}" ]]; then + fatal_error "job config file (JOB_CFG_FILE=${JOB_CFG_FILE}) does not exist or not readable" +fi +echo "bot/inspect.sh: showing ${JOB_CFG_FILE} from software-layer side" +cat ${JOB_CFG_FILE} + +echo "bot/inspect.sh: obtaining configuration settings from '${JOB_CFG_FILE}'" +cfg_load ${JOB_CFG_FILE} + +# if http_proxy is defined in ${JOB_CFG_FILE} use it, if not use env var $http_proxy +HTTP_PROXY=$(cfg_get_value "site_config" "http_proxy") +HTTP_PROXY=${HTTP_PROXY:-${http_proxy}} +echo "bot/inspect.sh: HTTP_PROXY='${HTTP_PROXY}'" + +# if https_proxy is defined in ${JOB_CFG_FILE} use it, if not use env var $https_proxy +HTTPS_PROXY=$(cfg_get_value "site_config" "https_proxy") +HTTPS_PROXY=${HTTPS_PROXY:-${https_proxy}} +echo "bot/build.sh: HTTPS_PROXY='${HTTPS_PROXY}'" + +LOCAL_TMP=$(cfg_get_value "site_config" "local_tmp") +echo "bot/inspect.sh: LOCAL_TMP='${LOCAL_TMP}'" +# TODO should local_tmp be mandatory? --> then we check here and exit if it is not provided + +# check if path to copy build logs to is specified, so we can copy build logs for failing builds there +BUILD_LOGS_DIR=$(cfg_get_value "site_config" "build_logs_dir") +echo "bot/inspect.sh: BUILD_LOGS_DIR='${BUILD_LOGS_DIR}'" +# if $BUILD_LOGS_DIR is set, add it to $SINGULARITY_BIND so the path is available in the build container +if [[ ! -z ${BUILD_LOGS_DIR} ]]; then + mkdir -p ${BUILD_LOGS_DIR} + if [[ -z ${SINGULARITY_BIND} ]]; then + export SINGULARITY_BIND="${BUILD_LOGS_DIR}" + else + export SINGULARITY_BIND="${SINGULARITY_BIND},${BUILD_LOGS_DIR}" + fi +fi + +SINGULARITY_CACHEDIR=$(cfg_get_value "site_config" "container_cachedir") +echo "bot/inspect.sh: SINGULARITY_CACHEDIR='${SINGULARITY_CACHEDIR}'" +if [[ ! -z ${SINGULARITY_CACHEDIR} ]]; then + # make sure that separate directories are used for different CPU families + SINGULARITY_CACHEDIR=${SINGULARITY_CACHEDIR}/${HOST_ARCH} + export SINGULARITY_CACHEDIR +fi + +echo -n "setting \$STORAGE by replacing any var in '${LOCAL_TMP}' -> " +# replace any env variable in ${LOCAL_TMP} with its +# current value (e.g., a value that is local to the job) +STORAGE=$(envsubst <<< ${LOCAL_TMP}) +echo "'${STORAGE}'" + +# make sure ${STORAGE} exists +mkdir -p ${STORAGE} + +# make sure the base tmp storage is unique +JOB_STORAGE=$(mktemp --directory --tmpdir=${STORAGE} bot_job_tmp_XXX) +echo "bot/inspect.sh: created unique base tmp storage directory at ${JOB_STORAGE}" + +# obtain list of modules to be loaded +LOAD_MODULES=$(cfg_get_value "site_config" "load_modules") +echo "bot/inspect.sh: LOAD_MODULES='${LOAD_MODULES}'" + +# singularity/apptainer settings: CONTAINER, HOME, TMPDIR, BIND +CONTAINER=$(cfg_get_value "repository" "container") +export SINGULARITY_HOME="${PWD}:/eessi_bot_job" +export SINGULARITY_TMPDIR="${PWD}/singularity_tmpdir" +mkdir -p ${SINGULARITY_TMPDIR} + +# load modules if LOAD_MODULES is not empty +if [[ ! -z ${LOAD_MODULES} ]]; then + for mod in $(echo ${LOAD_MODULES} | tr ',' '\n') + do + echo "bot/inspect.sh: loading module '${mod}'" + module load ${mod} + done +else + echo "bot/inspect.sh: no modules to be loaded" +fi + +# determine repository to be used from entry .repository in ${JOB_CFG_FILE} +REPOSITORY=$(cfg_get_value "repository" "repo_id") +EESSI_REPOS_CFG_DIR_OVERRIDE=$(cfg_get_value "repository" "repos_cfg_dir") +export EESSI_REPOS_CFG_DIR_OVERRIDE=${EESSI_REPOS_CFG_DIR_OVERRIDE:-${PWD}/cfg} +echo "bot/inspect.sh: EESSI_REPOS_CFG_DIR_OVERRIDE='${EESSI_REPOS_CFG_DIR_OVERRIDE}'" + +# determine pilot version to be used from .repository.repo_version in ${JOB_CFG_FILE} +# here, just set & export EESSI_PILOT_VERSION_OVERRIDE +# next script (eessi_container.sh) makes use of it via sourcing init scripts +# (e.g., init/eessi_defaults or init/minimal_eessi_env) +export EESSI_PILOT_VERSION_OVERRIDE=$(cfg_get_value "repository" "repo_version") +echo "bot/inspect.sh: EESSI_PILOT_VERSION_OVERRIDE='${EESSI_PILOT_VERSION_OVERRIDE}'" + +# determine CVMFS repo to be used from .repository.repo_name in ${JOB_CFG_FILE} +# here, just set EESSI_CVMFS_REPO_OVERRIDE, a bit further down +# "source init/eessi_defaults" via sourcing init/minimal_eessi_env +export EESSI_CVMFS_REPO_OVERRIDE=$(cfg_get_value "repository" "repo_name") +echo "bot/inspect.sh: EESSI_CVMFS_REPO_OVERRIDE='${EESSI_CVMFS_REPO_OVERRIDE}'" + +# determine architecture to be used from entry .architecture in ${JOB_CFG_FILE} +# fallbacks: +# - ${CPU_TARGET} handed over from bot +# - left empty to let downstream script(s) determine subdir to be used +EESSI_SOFTWARE_SUBDIR_OVERRIDE=$(cfg_get_value "architecture" "software_subdir") +EESSI_SOFTWARE_SUBDIR_OVERRIDE=${EESSI_SOFTWARE_SUBDIR_OVERRIDE:-${CPU_TARGET}} +export EESSI_SOFTWARE_SUBDIR_OVERRIDE +echo "bot/inspect.sh: EESSI_SOFTWARE_SUBDIR_OVERRIDE='${EESSI_SOFTWARE_SUBDIR_OVERRIDE}'" + +# get EESSI_OS_TYPE from .architecture.os_type in ${JOB_CFG_FILE} (default: linux) +EESSI_OS_TYPE=$(cfg_get_value "architecture" "os_type") +export EESSI_OS_TYPE=${EESSI_OS_TYPE:-linux} +echo "bot/inspect.sh: EESSI_OS_TYPE='${EESSI_OS_TYPE}'" + +# prepare arguments to eessi_container.sh common to build and tarball steps +declare -a COMMON_ARGS=() +COMMON_ARGS+=("--verbose") +COMMON_ARGS+=("--access" "rw") +COMMON_ARGS+=("--mode" "run") +[[ ! -z ${CONTAINER} ]] && COMMON_ARGS+=("--container" "${CONTAINER}") +[[ ! -z ${HTTP_PROXY} ]] && COMMON_ARGS+=("--http-proxy" "${HTTP_PROXY}") +[[ ! -z ${HTTPS_PROXY} ]] && COMMON_ARGS+=("--https-proxy" "${HTTPS_PROXY}") +[[ ! -z ${REPOSITORY} ]] && COMMON_ARGS+=("--repository" "${REPOSITORY}") + +# make sure to use the same parent dir for storing tarballs of tmp +PREVIOUS_TMP_DIR=${PWD}/previous_tmp + +# prepare directory to store tarball of tmp for build step +TARBALL_TMP_BUILD_STEP_DIR=${PREVIOUS_TMP_DIR}/build_step +mkdir -p ${TARBALL_TMP_BUILD_STEP_DIR} + +# prepare arguments to eessi_container.sh specific to build step +declare -a BUILD_STEP_ARGS=() +BUILD_STEP_ARGS+=("--save" "${TARBALL_TMP_BUILD_STEP_DIR}") +BUILD_STEP_ARGS+=("--storage" "${STORAGE}") + +# prepare arguments to install_software_layer.sh (specific to build step) +declare -a INSTALL_SCRIPT_ARGS=() +if [[ ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} =~ .*/generic$ ]]; then + INSTALL_SCRIPT_ARGS+=("--generic") +fi +[[ ! -z ${BUILD_LOGS_DIR} ]] && INSTALL_SCRIPT_ARGS+=("--build-logs-dir" "${BUILD_LOGS_DIR}") + +# create tmp file for output of build step +build_outerr=$(mktemp build.outerr.XXXX) + +echo "Executing command to build software:" +echo "./eessi_container.sh ${COMMON_ARGS[@]} ${BUILD_STEP_ARGS[@]}" +echo " -- ./install_software_layer.sh \"${INSTALL_SCRIPT_ARGS[@]}\" \"$@\" 2>&1 | tee -a ${build_outerr}" +#./eessi_container.sh "${COMMON_ARGS[@]}" "${BUILD_STEP_ARGS[@]}" \ +# -- ./install_software_layer.sh "${INSTALL_SCRIPT_ARGS[@]}" "$@" 2>&1 | tee -a ${build_outerr} + + +exit 0 From 90f1018066a88aa25599c34ed861a34f32366b19 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Fri, 18 Aug 2023 14:45:44 +0200 Subject: [PATCH 02/14] change permissions --- bot/inspect.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bot/inspect.sh diff --git a/bot/inspect.sh b/bot/inspect.sh old mode 100644 new mode 100755 From 0ec406eedc6285a3b7571265892e4a455f51300a Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Fri, 18 Aug 2023 14:53:56 +0200 Subject: [PATCH 03/14] fix cfg file path --- bot/inspect.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/inspect.sh b/bot/inspect.sh index 39ac7ceb99..591529a31f 100755 --- a/bot/inspect.sh +++ b/bot/inspect.sh @@ -83,7 +83,7 @@ if [[ -z ${job_dir} ]]; then fi # defaults -export JOB_CFG_FILE="${job_dir}/cfg/job.cfg}" +export JOB_CFG_FILE="${job_dir}/cfg/job.cfg" HOST_ARCH=$(uname -m) # check if ${JOB_CFG_FILE} exists From d3a0457b7665a41b440369eb7710f4d165c9b95f Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Fri, 18 Aug 2023 14:58:14 +0200 Subject: [PATCH 04/14] report more env var settings --- bot/inspect.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot/inspect.sh b/bot/inspect.sh index 591529a31f..f860169d95 100755 --- a/bot/inspect.sh +++ b/bot/inspect.sh @@ -104,7 +104,7 @@ echo "bot/inspect.sh: HTTP_PROXY='${HTTP_PROXY}'" # if https_proxy is defined in ${JOB_CFG_FILE} use it, if not use env var $https_proxy HTTPS_PROXY=$(cfg_get_value "site_config" "https_proxy") HTTPS_PROXY=${HTTPS_PROXY:-${https_proxy}} -echo "bot/build.sh: HTTPS_PROXY='${HTTPS_PROXY}'" +echo "bot/inspect.sh: HTTPS_PROXY='${HTTPS_PROXY}'" LOCAL_TMP=$(cfg_get_value "site_config" "local_tmp") echo "bot/inspect.sh: LOCAL_TMP='${LOCAL_TMP}'" @@ -150,8 +150,11 @@ echo "bot/inspect.sh: LOAD_MODULES='${LOAD_MODULES}'" # singularity/apptainer settings: CONTAINER, HOME, TMPDIR, BIND CONTAINER=$(cfg_get_value "repository" "container") +echo "bot/inspect.sh: CONTAINER='${CONTAINER}'" export SINGULARITY_HOME="${PWD}:/eessi_bot_job" +echo "bot/inspect.sh: SINGULARITY_HOME='${SINGULARITY_HOME}'" export SINGULARITY_TMPDIR="${PWD}/singularity_tmpdir" +echo "bot/inspect.sh: SINGULARITY_TMPDIR='${SINGULARITY_TMPDIR}'" mkdir -p ${SINGULARITY_TMPDIR} # load modules if LOAD_MODULES is not empty @@ -167,6 +170,7 @@ fi # determine repository to be used from entry .repository in ${JOB_CFG_FILE} REPOSITORY=$(cfg_get_value "repository" "repo_id") +echo "bot/inspect.sh: REPOSITORY='${REPOSITORY}'" EESSI_REPOS_CFG_DIR_OVERRIDE=$(cfg_get_value "repository" "repos_cfg_dir") export EESSI_REPOS_CFG_DIR_OVERRIDE=${EESSI_REPOS_CFG_DIR_OVERRIDE:-${PWD}/cfg} echo "bot/inspect.sh: EESSI_REPOS_CFG_DIR_OVERRIDE='${EESSI_REPOS_CFG_DIR_OVERRIDE}'" From 9fb5db25f3e7ce8e2d267a25f225b72911d08794 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Mon, 21 Aug 2023 10:49:23 +0200 Subject: [PATCH 05/14] simply run startprefix --- bot/inspect.sh | 106 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 72 insertions(+), 34 deletions(-) diff --git a/bot/inspect.sh b/bot/inspect.sh index f860169d95..9138d6e9b4 100755 --- a/bot/inspect.sh +++ b/bot/inspect.sh @@ -203,42 +203,80 @@ export EESSI_OS_TYPE=${EESSI_OS_TYPE:-linux} echo "bot/inspect.sh: EESSI_OS_TYPE='${EESSI_OS_TYPE}'" # prepare arguments to eessi_container.sh common to build and tarball steps -declare -a COMMON_ARGS=() -COMMON_ARGS+=("--verbose") -COMMON_ARGS+=("--access" "rw") -COMMON_ARGS+=("--mode" "run") -[[ ! -z ${CONTAINER} ]] && COMMON_ARGS+=("--container" "${CONTAINER}") -[[ ! -z ${HTTP_PROXY} ]] && COMMON_ARGS+=("--http-proxy" "${HTTP_PROXY}") -[[ ! -z ${HTTPS_PROXY} ]] && COMMON_ARGS+=("--https-proxy" "${HTTPS_PROXY}") -[[ ! -z ${REPOSITORY} ]] && COMMON_ARGS+=("--repository" "${REPOSITORY}") - -# make sure to use the same parent dir for storing tarballs of tmp -PREVIOUS_TMP_DIR=${PWD}/previous_tmp - -# prepare directory to store tarball of tmp for build step -TARBALL_TMP_BUILD_STEP_DIR=${PREVIOUS_TMP_DIR}/build_step -mkdir -p ${TARBALL_TMP_BUILD_STEP_DIR} - -# prepare arguments to eessi_container.sh specific to build step -declare -a BUILD_STEP_ARGS=() -BUILD_STEP_ARGS+=("--save" "${TARBALL_TMP_BUILD_STEP_DIR}") -BUILD_STEP_ARGS+=("--storage" "${STORAGE}") - -# prepare arguments to install_software_layer.sh (specific to build step) -declare -a INSTALL_SCRIPT_ARGS=() -if [[ ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} =~ .*/generic$ ]]; then - INSTALL_SCRIPT_ARGS+=("--generic") +declare -a CMDLINE_ARGS=() +CMDLINE_ARGS+=("--verbose") +CMDLINE_ARGS+=("--access" "rw") +CMDLINE_ARGS+=("--mode" "shell") +[[ ! -z ${CONTAINER} ]] && CMDLINE_ARGS+=("--container" "${CONTAINER}") +[[ ! -z ${HTTP_PROXY} ]] && CMDLINE_ARGS+=("--http-proxy" "${HTTP_PROXY}") +[[ ! -z ${HTTPS_PROXY} ]] && CMDLINE_ARGS+=("--https-proxy" "${HTTPS_PROXY}") +[[ ! -z ${REPOSITORY} ]] && CMDLINE_ARGS+=("--repository" "${REPOSITORY}") + +# create a directory for creating a tarball of the tmp directory +INSPECT_TMP_DIR=$(mktemp -d ${PWD}/inspect.XXX) + +# add arguments for temporary storage and storing a tarball of tmp +CMDLINE_ARGS+=("--save" "${INSPECT_TMP_DIR}") +CMDLINE_ARGS+=("--storage" "${STORAGE}") + +# # prepare arguments to install_software_layer.sh (specific to build step) +# declare -a INSTALL_SCRIPT_ARGS=() +# if [[ ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} =~ .*/generic$ ]]; then +# INSTALL_SCRIPT_ARGS+=("--generic") +# fi +# [[ ! -z ${BUILD_LOGS_DIR} ]] && INSTALL_SCRIPT_ARGS+=("--build-logs-dir" "${BUILD_LOGS_DIR}") + +# make sure some environment settings are available inside the shell started via +# startprefix +base_dir=$(dirname $(realpath $0)) +source ${base_dir}/init/eessi_defaults + +if [ -z $EESSI_PILOT_VERSION ]; then + echo "ERROR: \$EESSI_PILOT_VERSION must be set!" >&2 + exit 1 +fi +EESSI_COMPAT_LAYER_DIR="${EESSI_CVMFS_REPO}/versions/${EESSI_PILOT_VERSION}/compat/linux/$(uname -m)" + +# NOTE The below requires access to the CVMFS repository. We could make a first +# test run with a container. For now we skip the test. +# if [ ! -d ${EESSI_COMPAT_LAYER_DIR} ]; then +# echo "ERROR: ${EESSI_COMPAT_LAYER_DIR} does not exist!" >&2 +# exit 1 +# fi + +# When we want to run a script with arguments, the next line is ensures to retain +# these arguments. +# INPUT=$(echo "$@") +if [ ! -z ${SLURM_JOB_ID} ]; then + INPUT="export SLURM_JOB_ID=${SLURM_JOB_ID}; ${INPUT}" +fi +if [ ! -z ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} ]; then + INPUT="export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${EESSI_SOFTWARE_SUBDIR_OVERRIDE}; ${INPUT}" +fi +if [ ! -z ${EESSI_CVMFS_REPO_OVERRIDE} ]; then + INPUT="export EESSI_CVMFS_REPO_OVERRIDE=${EESSI_CVMFS_REPO_OVERRIDE}; ${INPUT}" +fi +if [ ! -z ${EESSI_PILOT_VERSION_OVERRIDE} ]; then + INPUT="export EESSI_PILOT_VERSION_OVERRIDE=${EESSI_PILOT_VERSION_OVERRIDE}; ${INPUT}" +fi +if [ ! -z ${http_proxy} ]; then + INPUT="export http_proxy=${http_proxy}; ${INPUT}" +fi +if [ ! -z ${https_proxy} ]; then + INPUT="export https_proxy=${https_proxy}; ${INPUT}" fi -[[ ! -z ${BUILD_LOGS_DIR} ]] && INSTALL_SCRIPT_ARGS+=("--build-logs-dir" "${BUILD_LOGS_DIR}") - -# create tmp file for output of build step -build_outerr=$(mktemp build.outerr.XXXX) -echo "Executing command to build software:" -echo "./eessi_container.sh ${COMMON_ARGS[@]} ${BUILD_STEP_ARGS[@]}" -echo " -- ./install_software_layer.sh \"${INSTALL_SCRIPT_ARGS[@]}\" \"$@\" 2>&1 | tee -a ${build_outerr}" -#./eessi_container.sh "${COMMON_ARGS[@]}" "${BUILD_STEP_ARGS[@]}" \ -# -- ./install_software_layer.sh "${INSTALL_SCRIPT_ARGS[@]}" "$@" 2>&1 | tee -a ${build_outerr} +echo "Executing command to start interactive session to inspect build job:" +# TODO possibly add information on how to init session after the prefix is +# entered, initialization consists of +# - environment variable settings (see 'run_in_compat_layer_env.sh') +# - setup steps run in 'EESSI-pilot-install-software.sh' +# These initializations are combined into a single script that is executed when +# the shell in startprefix is started. We set the env variable BASH_ENV here. +echo "./eessi_container.sh ${CMDLINE_ARGS[@]}" +echo " -- ${EESSI_COMPAT_LAYER_DIR}/startprefix" +./eessi_container.sh "${CMDLINE_ARGS[@]}" \ + -- ${EESSI_COMPAT_LAYER_DIR}/startprefix exit 0 From e02c02475884ca87a5ebad32a7e7134e5a4f3475 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Mon, 21 Aug 2023 11:12:17 +0200 Subject: [PATCH 06/14] fix path to access eessi_defaults --- bot/inspect.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/inspect.sh b/bot/inspect.sh index 9138d6e9b4..f303724d5f 100755 --- a/bot/inspect.sh +++ b/bot/inspect.sh @@ -229,7 +229,8 @@ CMDLINE_ARGS+=("--storage" "${STORAGE}") # make sure some environment settings are available inside the shell started via # startprefix base_dir=$(dirname $(realpath $0)) -source ${base_dir}/init/eessi_defaults +# base_dir of inspect.sh script is '.../bot', 'init' dir is at the same level +source ${base_dir}/../init/eessi_defaults if [ -z $EESSI_PILOT_VERSION ]; then echo "ERROR: \$EESSI_PILOT_VERSION must be set!" >&2 From df5fbf09c18948faefcdf7cab26e7bb35ceae688 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Tue, 22 Aug 2023 14:52:01 +0200 Subject: [PATCH 07/14] tweaks after testing to enter prefix --- bot/inspect.sh | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/bot/inspect.sh b/bot/inspect.sh index f303724d5f..3416426d7d 100755 --- a/bot/inspect.sh +++ b/bot/inspect.sh @@ -30,12 +30,15 @@ set -e display_help() { echo "usage: $0 [OPTIONS]" echo " -h | --help - display this usage information" - echo " -j | --job-dir DIR - inspect job with the given work directory DIR" + echo " -r | --resume TGZ - inspect job saved in tarball path TGZ; note, we assume the path" + echo " to be something like JOB_DIR/previous_tmp/{build,tarball}_step/TARBALL.tgz" + echo " and thus determine JOB_DIR from the given path" + echo " [default: none]" echo " -x | --http-proxy URL - provides URL for the environment variable http_proxy" echo " -y | --https-proxy URL - provides URL for the environment variable https_proxy" } -job_dir= +resume_tgz= http_proxy= https_proxy= @@ -47,8 +50,8 @@ while [[ $# -gt 0 ]]; do display_help exit 0 ;; - -j|--job-dir) - export job_dir="${2}" + -r|--resume) + export resume_tgz="${2}" shift 2 ;; -x|--http-proxy) @@ -76,12 +79,21 @@ set -- "${POSITIONAL_ARGS[@]}" source scripts/utils.sh source scripts/cfg_files.sh -if [[ -z ${job_dir} ]]; then - echo_yellow "path to job directory missing" +if [[ -z ${resume_tgz} ]]; then + echo_red "path to tarball for resuming build job is missing" display_help exit 1 fi +job_dir=$(dirname $(dirname $(dirname ${resume_tgz}))) + +if [[ -z ${job_dir} ]]; then + # job directory could be determined + echo_red "job directory could not be determined from '${resume_tgz}'" + display_help + exit 2 +fi + # defaults export JOB_CFG_FILE="${job_dir}/cfg/job.cfg" HOST_ARCH=$(uname -m) @@ -151,7 +163,9 @@ echo "bot/inspect.sh: LOAD_MODULES='${LOAD_MODULES}'" # singularity/apptainer settings: CONTAINER, HOME, TMPDIR, BIND CONTAINER=$(cfg_get_value "repository" "container") echo "bot/inspect.sh: CONTAINER='${CONTAINER}'" -export SINGULARITY_HOME="${PWD}:/eessi_bot_job" +# instead of using ${PWD} as HOME in the container, we use the job directory +# to have access to output files of the job +export SINGULARITY_HOME="${job_dir}:/eessi_bot_job" echo "bot/inspect.sh: SINGULARITY_HOME='${SINGULARITY_HOME}'" export SINGULARITY_TMPDIR="${PWD}/singularity_tmpdir" echo "bot/inspect.sh: SINGULARITY_TMPDIR='${SINGULARITY_TMPDIR}'" @@ -171,6 +185,7 @@ fi # determine repository to be used from entry .repository in ${JOB_CFG_FILE} REPOSITORY=$(cfg_get_value "repository" "repo_id") echo "bot/inspect.sh: REPOSITORY='${REPOSITORY}'" +# TODO better to read this from tarball??? EESSI_REPOS_CFG_DIR_OVERRIDE=$(cfg_get_value "repository" "repos_cfg_dir") export EESSI_REPOS_CFG_DIR_OVERRIDE=${EESSI_REPOS_CFG_DIR_OVERRIDE:-${PWD}/cfg} echo "bot/inspect.sh: EESSI_REPOS_CFG_DIR_OVERRIDE='${EESSI_REPOS_CFG_DIR_OVERRIDE}'" @@ -185,7 +200,7 @@ echo "bot/inspect.sh: EESSI_PILOT_VERSION_OVERRIDE='${EESSI_PILOT_VERSION_OVERRI # determine CVMFS repo to be used from .repository.repo_name in ${JOB_CFG_FILE} # here, just set EESSI_CVMFS_REPO_OVERRIDE, a bit further down # "source init/eessi_defaults" via sourcing init/minimal_eessi_env -export EESSI_CVMFS_REPO_OVERRIDE=$(cfg_get_value "repository" "repo_name") +export EESSI_CVMFS_REPO_OVERRIDE="/cvmfs/$(cfg_get_value 'repository' 'repo_name')" echo "bot/inspect.sh: EESSI_CVMFS_REPO_OVERRIDE='${EESSI_CVMFS_REPO_OVERRIDE}'" # determine architecture to be used from entry .architecture in ${JOB_CFG_FILE} @@ -206,12 +221,14 @@ echo "bot/inspect.sh: EESSI_OS_TYPE='${EESSI_OS_TYPE}'" declare -a CMDLINE_ARGS=() CMDLINE_ARGS+=("--verbose") CMDLINE_ARGS+=("--access" "rw") -CMDLINE_ARGS+=("--mode" "shell") +CMDLINE_ARGS+=("--mode" "run") [[ ! -z ${CONTAINER} ]] && CMDLINE_ARGS+=("--container" "${CONTAINER}") [[ ! -z ${HTTP_PROXY} ]] && CMDLINE_ARGS+=("--http-proxy" "${HTTP_PROXY}") [[ ! -z ${HTTPS_PROXY} ]] && CMDLINE_ARGS+=("--https-proxy" "${HTTPS_PROXY}") [[ ! -z ${REPOSITORY} ]] && CMDLINE_ARGS+=("--repository" "${REPOSITORY}") +[[ ! -z ${resume_tgz} ]] && CMDLINE_ARGS+=("--resume" "${resume_tgz}") + # create a directory for creating a tarball of the tmp directory INSPECT_TMP_DIR=$(mktemp -d ${PWD}/inspect.XXX) @@ -230,6 +247,7 @@ CMDLINE_ARGS+=("--storage" "${STORAGE}") # startprefix base_dir=$(dirname $(realpath $0)) # base_dir of inspect.sh script is '.../bot', 'init' dir is at the same level +# TODO better use script from tarball??? source ${base_dir}/../init/eessi_defaults if [ -z $EESSI_PILOT_VERSION ]; then From 45dac8b254e2fd3d0c738f630de9a997f8f86ad5 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Thu, 24 Aug 2023 15:16:19 +0200 Subject: [PATCH 08/14] initializing bot build environment settings incl EasyBuild + information note --- bot/inspect.sh | 149 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 139 insertions(+), 10 deletions(-) diff --git a/bot/inspect.sh b/bot/inspect.sh index 3416426d7d..e5e4df5970 100755 --- a/bot/inspect.sh +++ b/bot/inspect.sh @@ -229,12 +229,17 @@ CMDLINE_ARGS+=("--mode" "run") [[ ! -z ${resume_tgz} ]] && CMDLINE_ARGS+=("--resume" "${resume_tgz}") -# create a directory for creating a tarball of the tmp directory -INSPECT_TMP_DIR=$(mktemp -d ${PWD}/inspect.XXX) +# create a directory for creating temporary data and scripts for the inspection +INSPECT_DIR=$(mktemp --directory --tmpdir=${PWD} inspect.XXX) +if [[ -z ${SINGULARITY_BIND} ]]; then + export SINGULARITY_BIND="${INSPECT_DIR}:/inspect_eessi_build_job" +else + export SINGULARITY_BIND="${SINGULARITY_BIND},${INSPECT_DIR}:/inspect_eessi_build_job" +fi # add arguments for temporary storage and storing a tarball of tmp -CMDLINE_ARGS+=("--save" "${INSPECT_TMP_DIR}") -CMDLINE_ARGS+=("--storage" "${STORAGE}") +CMDLINE_ARGS+=("--save" "${INSPECT_DIR}") +CMDLINE_ARGS+=("--storage" "${JOB_STORAGE}") # # prepare arguments to install_software_layer.sh (specific to build step) # declare -a INSTALL_SCRIPT_ARGS=() @@ -266,23 +271,147 @@ EESSI_COMPAT_LAYER_DIR="${EESSI_CVMFS_REPO}/versions/${EESSI_PILOT_VERSION}/comp # When we want to run a script with arguments, the next line is ensures to retain # these arguments. # INPUT=$(echo "$@") +mkdir -p ${INSPECT_DIR}/scripts +RESUME_SCRIPT=${INSPECT_DIR}/scripts/resume_env.sh +echo "bot/inspect.sh: creating script '${RESUME_SCRIPT}' to resume environment settings" + +cat << EOF > ${RESUME_SCRIPT} +#!${EESSI_COMPAT_LAYER_DIR}/bin/bash +echo "Sourcing '\$BASH_SOURCE' to init bot environment of build job" +EOF if [ ! -z ${SLURM_JOB_ID} ]; then - INPUT="export SLURM_JOB_ID=${SLURM_JOB_ID}; ${INPUT}" + # TODO do we need the value at all? if so which one: current or of the job to + # inspect? + echo "export CURRENT_SLURM_JOB_ID=${SLURM_JOB_ID}" >> ${RESUME_SCRIPT} fi if [ ! -z ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} ]; then - INPUT="export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${EESSI_SOFTWARE_SUBDIR_OVERRIDE}; ${INPUT}" + echo "export EESSI_SOFTWARE_SUBDIR_OVERRIDE=${EESSI_SOFTWARE_SUBDIR_OVERRIDE}" >> ${RESUME_SCRIPT} fi if [ ! -z ${EESSI_CVMFS_REPO_OVERRIDE} ]; then - INPUT="export EESSI_CVMFS_REPO_OVERRIDE=${EESSI_CVMFS_REPO_OVERRIDE}; ${INPUT}" + echo "export EESSI_CVMFS_REPO_OVERRIDE=${EESSI_CVMFS_REPO_OVERRIDE}" >> ${RESUME_SCRIPT} fi if [ ! -z ${EESSI_PILOT_VERSION_OVERRIDE} ]; then - INPUT="export EESSI_PILOT_VERSION_OVERRIDE=${EESSI_PILOT_VERSION_OVERRIDE}; ${INPUT}" + echo "export EESSI_PILOT_VERSION_OVERRIDE=${EESSI_PILOT_VERSION_OVERRIDE}" >> ${RESUME_SCRIPT} fi if [ ! -z ${http_proxy} ]; then - INPUT="export http_proxy=${http_proxy}; ${INPUT}" + echo "export http_proxy=${http_proxy}" >> ${RESUME_SCRIPT} fi if [ ! -z ${https_proxy} ]; then - INPUT="export https_proxy=${https_proxy}; ${INPUT}" + echo "export https_proxy=${https_proxy}" >> ${RESUME_SCRIPT} +fi +cat << 'EOF' >> ${RESUME_SCRIPT} +TOPDIR=$(dirname $(realpath $BASH_SOURCE)) + +source ${TOPDIR}/scripts/utils.sh + +# honor $TMPDIR if it is already defined, use /tmp otherwise +if [ -z $TMPDIR ]; then + export WORKDIR=/tmp/$USER +else + export WORKDIR=$TMPDIR/$USER +fi + +TMPDIR=$(mktemp -d) + +echo ">> Setting up environment..." + +source $TOPDIR/init/minimal_eessi_env + +if [ -d $EESSI_CVMFS_REPO ]; then + echo_green "$EESSI_CVMFS_REPO available, OK!" +else + fatal_error "$EESSI_CVMFS_REPO is not available!" +fi + +# make sure we're in Prefix environment by checking $SHELL +if [[ ${SHELL} = ${EPREFIX}/bin/bash ]]; then + echo_green ">> It looks like we're in a Gentoo Prefix environment, good!" +else + fatal_error "Not running in Gentoo Prefix environment, run '${EPREFIX}/startprefix' first!" +fi + +# avoid that pyc files for EasyBuild are stored in EasyBuild installation directory +export PYTHONPYCACHEPREFIX=$TMPDIR/pycache + +DETECTION_PARAMETERS='' +GENERIC=0 +EB='eb' +if [[ "$EASYBUILD_OPTARCH" == "GENERIC" || "$EESSI_SOFTWARE_SUBDIR_OVERRIDE" == *"/generic" ]]; then + echo_yellow ">> GENERIC build requested, taking appropriate measures!" + DETECTION_PARAMETERS="$DETECTION_PARAMETERS --generic" + GENERIC=1 + export EASYBUILD_OPTARCH=GENERIC + EB='eb --optarch=GENERIC' +fi + +echo ">> Determining software subdirectory to use for current build host..." +if [ -z $EESSI_SOFTWARE_SUBDIR_OVERRIDE ]; then + export EESSI_SOFTWARE_SUBDIR_OVERRIDE=$(python3 $TOPDIR/eessi_software_subdir.py $DETECTION_PARAMETERS) + echo ">> Determined \$EESSI_SOFTWARE_SUBDIR_OVERRIDE via 'eessi_software_subdir.py $DETECTION_PARAMETERS' script" +else + echo ">> Picking up pre-defined \$EESSI_SOFTWARE_SUBDIR_OVERRIDE: ${EESSI_SOFTWARE_SUBDIR_OVERRIDE}" +fi + +# Set all the EESSI environment variables (respecting $EESSI_SOFTWARE_SUBDIR_OVERRIDE) +# $EESSI_SILENT - don't print any messages +# $EESSI_BASIC_ENV - give a basic set of environment variables +EESSI_SILENT=1 EESSI_BASIC_ENV=1 source $TOPDIR/init/eessi_environment_variables + +if [[ -z ${EESSI_SOFTWARE_SUBDIR} ]]; then + fatal_error "Failed to determine software subdirectory?!" +elif [[ "${EESSI_SOFTWARE_SUBDIR}" != "${EESSI_SOFTWARE_SUBDIR_OVERRIDE}" ]]; then + fatal_error "Values for EESSI_SOFTWARE_SUBDIR_OVERRIDE (${EESSI_SOFTWARE_SUBDIR_OVERRIDE}) and EESSI_SOFTWARE_SUBDIR (${EESSI_SOFTWARE_SUBDIR}) differ!" +else + echo_green ">> Using ${EESSI_SOFTWARE_SUBDIR} as software subdirectory!" +fi + +echo ">> Initializing Lmod..." +source $EPREFIX/usr/share/Lmod/init/bash +ml_version_out=$TMPDIR/ml.out +ml --version &> $ml_version_out +if [[ $? -eq 0 ]]; then + echo_green ">> Found Lmod ${LMOD_VERSION}" +else + fatal_error "Failed to initialize Lmod?! (see output in ${ml_version_out}" +fi + +echo ">> Configuring EasyBuild..." +source $TOPDIR/configure_easybuild + +echo ">> Setting up \$MODULEPATH..." +# make sure no modules are loaded +module --force purge +# ignore current $MODULEPATH entirely +module unuse $MODULEPATH +module use $EASYBUILD_INSTALLPATH/modules/all +if [[ -z ${MODULEPATH} ]]; then + fatal_error "Failed to set up \$MODULEPATH?!" +else + echo_green ">> MODULEPATH set up: ${MODULEPATH}" +fi + +eb_version='4.7.2' + +# load EasyBuild module (will be installed if it's not available yet) +source ${TOPDIR}/load_easybuild_module.sh ${eb_version} + +echo_green "All set, let's start installing some software with EasyBuild v${eb_version} in ${EASYBUILD_INSTALLPATH}..." + +echo "Ready for inspection of build job:" +echo " - job directory is $HOME (\$HOME), check for slurm-*.out file" +echo " - temporary data of job available at /tmp" +echo " - Note, prefix $EESSI_PREFIX is writable" +echo " - EasyBuild v${eb_version} is available" + +EOF +chmod u+x ${RESUME_SCRIPT} + +# try to map it into the container's $HOME/.profile instead +# TODO check if script already exists, if so change its name and source it at the beginning of the RESUME_SCRIPT +if [[ -z ${SINGULARITY_BIND} ]]; then + export SINGULARITY_BIND="${RESUME_SCRIPT}:/eessi_bot_job/.profile" +else + export SINGULARITY_BIND="${SINGULARITY_BIND},${RESUME_SCRIPT}:/eessi_bot_job/.profile" fi echo "Executing command to start interactive session to inspect build job:" From b3e6b8acddd5c4afcb453d31b00115a7a007338e Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Tue, 26 Sep 2023 10:03:15 +0200 Subject: [PATCH 09/14] Add the option to pass a command to the inspect script, which will get executed in the container. Useful if you want to e.g. run this in a job, but just submit that job manually (not by the bot). --- bot/inspect.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/bot/inspect.sh b/bot/inspect.sh index e5e4df5970..a97a29b614 100755 --- a/bot/inspect.sh +++ b/bot/inspect.sh @@ -34,6 +34,7 @@ display_help() { echo " to be something like JOB_DIR/previous_tmp/{build,tarball}_step/TARBALL.tgz" echo " and thus determine JOB_DIR from the given path" echo " [default: none]" + echo " -c | --command COMMAND - command to execute inside the container, in the prefix environment" echo " -x | --http-proxy URL - provides URL for the environment variable http_proxy" echo " -y | --https-proxy URL - provides URL for the environment variable https_proxy" } @@ -62,6 +63,10 @@ while [[ $# -gt 0 ]]; do export https_proxy="${2}" shift 2 ;; + -c|--command) + export run_in_prefix="${2}" + shift 2 + ;; -*|--*) echo "Error: Unknown option: ${1}" >&2 exit 1 @@ -421,10 +426,16 @@ echo "Executing command to start interactive session to inspect build job:" # - setup steps run in 'EESSI-pilot-install-software.sh' # These initializations are combined into a single script that is executed when # the shell in startprefix is started. We set the env variable BASH_ENV here. -echo "./eessi_container.sh ${CMDLINE_ARGS[@]}" -echo " -- ${EESSI_COMPAT_LAYER_DIR}/startprefix" -./eessi_container.sh "${CMDLINE_ARGS[@]}" \ +if [[ -z ${run_in_prefix} ]]; then + echo "./eessi_container.sh ${CMDLINE_ARGS[@]}" + echo " -- ${EESSI_COMPAT_LAYER_DIR}/startprefix" + ./eessi_container.sh "${CMDLINE_ARGS[@]}" \ -- ${EESSI_COMPAT_LAYER_DIR}/startprefix - +else + echo "./eessi_container.sh ${CMDLINE_ARGS[@]}" + echo " -- ${EESSI_COMPAT_LAYER_DIR}/startprefix <<< ${run_in_prefix}" + ./eessi_container.sh "${CMDLINE_ARGS[@]}" \ + -- ${EESSI_COMPAT_LAYER_DIR}/startprefix <<< ${run_in_prefix} +fi exit 0 From 8e4c6b230e285f43e4d4a40b6a28f8ce16691396 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Tue, 26 Sep 2023 13:16:00 +0200 Subject: [PATCH 10/14] do not load EasyBuild module, rather provide instructions to load it --- bot/inspect.sh | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/bot/inspect.sh b/bot/inspect.sh index a97a29b614..b6d633744f 100755 --- a/bot/inspect.sh +++ b/bot/inspect.sh @@ -395,18 +395,22 @@ else echo_green ">> MODULEPATH set up: ${MODULEPATH}" fi -eb_version='4.7.2' - -# load EasyBuild module (will be installed if it's not available yet) -source ${TOPDIR}/load_easybuild_module.sh ${eb_version} - -echo_green "All set, let's start installing some software with EasyBuild v${eb_version} in ${EASYBUILD_INSTALLPATH}..." - -echo "Ready for inspection of build job:" +echo_green "Build environment set up with install path ${EASYBUILD_INSTALLPATH}." +echo +echo "The build job can be inspected with the following resources:" echo " - job directory is $HOME (\$HOME), check for slurm-*.out file" -echo " - temporary data of job available at /tmp" -echo " - Note, prefix $EESSI_PREFIX is writable" -echo " - EasyBuild v${eb_version} is available" +echo " - temporary data of the job is available at /tmp" +echo " - note, the prefix $EESSI_PREFIX is writable" +echo +echo "You may want to load an EasyBuild module. The inspect.sh script does not load" +echo "that automatically, because multiple versions might have been used by the job." +echo "Choose an EasyBuild version (see installed versions with 'module avail')" +echo "and run" +echo +echo "source ${TOPDIR}/load_easybuild_module.sh EasyBuild_version" +echo +echo "Note, if you choose a version that is not installed yet, it will be" +echo "installed first." EOF chmod u+x ${RESUME_SCRIPT} From eb29516eabaf54cb867eb6e331bab94516264061 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Tue, 26 Sep 2023 13:56:15 +0200 Subject: [PATCH 11/14] tweaking of instructions for setting up EasyBuild --- bot/inspect.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bot/inspect.sh b/bot/inspect.sh index b6d633744f..d35f11cf35 100755 --- a/bot/inspect.sh +++ b/bot/inspect.sh @@ -404,13 +404,20 @@ echo " - note, the prefix $EESSI_PREFIX is writable" echo echo "You may want to load an EasyBuild module. The inspect.sh script does not load" echo "that automatically, because multiple versions might have been used by the job." -echo "Choose an EasyBuild version (see installed versions with 'module avail')" +echo "Choose an EasyBuild version (see installed versions with 'module avail EasyBuild')" echo "and run" echo -echo "source ${TOPDIR}/load_easybuild_module.sh EasyBuild_version" +echo "source ${TOPDIR}/load_easybuild_module.sh _EasyBuild_version_" +echo +echo "Replace _EasyBuild_version_ with the version you want to use." echo echo "Note, if you choose a version that is not installed yet, it will be" echo "installed first." +echo +echo "If the version you need is already listed with 'module avail', you can" +echo "simply run" +echo +echo "module load EasyBuild/VERSION_YOU_NEED" EOF chmod u+x ${RESUME_SCRIPT} From eb113c2dae51cada092fd32d849e4b709f43cb26 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Tue, 26 Sep 2023 14:03:45 +0200 Subject: [PATCH 12/14] minor tweaking --- bot/inspect.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bot/inspect.sh b/bot/inspect.sh index d35f11cf35..5b89705019 100755 --- a/bot/inspect.sh +++ b/bot/inspect.sh @@ -395,6 +395,7 @@ else echo_green ">> MODULEPATH set up: ${MODULEPATH}" fi +echo echo_green "Build environment set up with install path ${EASYBUILD_INSTALLPATH}." echo echo "The build job can be inspected with the following resources:" From dd6c4c0f126fc2572378dc1eb6d34a03decbf47d Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Fri, 29 Sep 2023 19:50:48 +0200 Subject: [PATCH 13/14] change the instructions to simply use module load for getting access to EasyBuild --- bot/inspect.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/bot/inspect.sh b/bot/inspect.sh index 5b89705019..637eaea97f 100755 --- a/bot/inspect.sh +++ b/bot/inspect.sh @@ -406,19 +406,16 @@ echo echo "You may want to load an EasyBuild module. The inspect.sh script does not load" echo "that automatically, because multiple versions might have been used by the job." echo "Choose an EasyBuild version (see installed versions with 'module avail EasyBuild')" -echo "and run" +echo "and simply run" echo -echo "source ${TOPDIR}/load_easybuild_module.sh _EasyBuild_version_" +echo "module load EasyBuild/_VERSION_" echo -echo "Replace _EasyBuild_version_ with the version you want to use." +echo "Replace _VERSION_ with the version you want to use." echo -echo "Note, if you choose a version that is not installed yet, it will be" -echo "installed first." +echo "Note, you can try to install a newer version with 'eb'. The script" +echo "load_easybuild_module.sh cannot be used currently, because it exits at" +echo "the end which also leaves the container." echo -echo "If the version you need is already listed with 'module avail', you can" -echo "simply run" -echo -echo "module load EasyBuild/VERSION_YOU_NEED" EOF chmod u+x ${RESUME_SCRIPT} From 470a22109d96762e9603739f7fda8152a1ad5dcf Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Fri, 29 Sep 2023 21:17:31 +0200 Subject: [PATCH 14/14] remove note about installing a new EasyBuild --- bot/inspect.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bot/inspect.sh b/bot/inspect.sh index 637eaea97f..a3b88e5017 100755 --- a/bot/inspect.sh +++ b/bot/inspect.sh @@ -412,10 +412,6 @@ echo "module load EasyBuild/_VERSION_" echo echo "Replace _VERSION_ with the version you want to use." echo -echo "Note, you can try to install a newer version with 'eb'. The script" -echo "load_easybuild_module.sh cannot be used currently, because it exits at" -echo "the end which also leaves the container." -echo EOF chmod u+x ${RESUME_SCRIPT}