Skip to content

Commit

Permalink
Merge pull request #337 from boegel/2023.06_shared_fs_path
Browse files Browse the repository at this point in the history
use `easybuild/sources` subdirectory in shared filesystem path as EasyBuild source path, if specified via `shared_fs_path` in provided configuration
  • Loading branch information
trz42 authored Sep 26, 2023
2 parents f4e7350 + 74f74ae commit 12b9d14
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions EESSI-pilot-install-software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@

display_help() {
echo "usage: $0 [OPTIONS]"
echo " --build-logs-dir - location to copy EasyBuild logs to for failed builds"
echo " -g | --generic - instructs script to build for generic architecture target"
echo " -h | --help - display this usage information"
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"
echo " --shared-fs-path - path to directory on shared filesystem that can be used"
}

function copy_build_log() {
Expand Down Expand Up @@ -70,6 +72,10 @@ while [[ $# -gt 0 ]]; do
export build_logs_dir="${2}"
shift 2
;;
--shared-fs-path)
export shared_fs_path="${2}"
shift 2
;;
-*|--*)
echo "Error: Unknown option: $1" >&2
exit 1
Expand Down Expand Up @@ -160,6 +166,14 @@ fi
echo ">> Configuring EasyBuild..."
source $TOPDIR/configure_easybuild

if [ ! -z "${shared_fs_path}" ]; then
shared_eb_sourcepath=${shared_fs_path}/easybuild/sources
echo ">> Using ${shared_eb_sourcepath} as shared EasyBuild source path"
export EASYBUILD_SOURCEPATH=${shared_eb_sourcepath}:${EASYBUILD_SOURCEPATH}
fi

${EB} --show-config

echo ">> Setting up \$MODULEPATH..."
# make sure no modules are loaded
module --force purge
Expand Down
13 changes: 13 additions & 0 deletions bot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ else
export SINGULARITY_BIND="${SINGULARITY_BIND},${BUILD_LOGS_DIR}"
fi

# check if path to directory on shared filesystem is specified,
# and use it as location for source tarballs used by EasyBuild if so
SHARED_FS_PATH=$(cfg_get_value "site_config" "shared_fs_path")
echo "bot/build.sh: SHARED_FS_PATH='${SHARED_FS_PATH}'"
# if $SHARED_FS_PATH is set, add it to $SINGULARITY_BIND so the path is available in the build container
mkdir -p ${SHARED_FS_PATH}
if [[ -z ${SINGULARITY_BIND} ]]; then
export SINGULARITY_BIND="${SHARED_FS_PATH}"
else
export SINGULARITY_BIND="${SINGULARITY_BIND},${SHARED_FS_PATH}"
fi

SINGULARITY_CACHEDIR=$(cfg_get_value "site_config" "container_cachedir")
echo "bot/build.sh: SINGULARITY_CACHEDIR='${SINGULARITY_CACHEDIR}'"
if [[ ! -z ${SINGULARITY_CACHEDIR} ]]; then
Expand Down Expand Up @@ -167,6 +179,7 @@ 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}")
[[ ! -z ${SHARED_FS_PATH} ]] && INSTALL_SCRIPT_ARGS+=("--shared-fs-path" "${SHARED_FS_PATH}")

# create tmp file for output of build step
build_outerr=$(mktemp build.outerr.XXXX)
Expand Down

0 comments on commit 12b9d14

Please sign in to comment.