Skip to content

Commit

Permalink
Merge pull request #391 from boegel/2023.06-software.eessi.io_scripts
Browse files Browse the repository at this point in the history
get rid of 'pilot' terminology in scripts
  • Loading branch information
bedroge authored Nov 25, 2023
2 parents 246d438 + 5d532ee commit 5c395f2
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 34 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/tests_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- build_container.sh
- create_directory_tarballs.sh
- EESSI-pilot-install-software.sh
- EESSI-install-software.sh
- install_software_layer.sh
- load_easybuild_module.sh
- run_in_compat_layer_env.sh
Expand All @@ -16,7 +16,7 @@ on:
paths:
- build_container.sh
- create_directory_tarballs.sh
- EESSI-pilot-install-software.sh
- EESSI-install-software.sh
- install_software_layer.sh
- load_easybuild_module.sh
- run_in_compat_layer_env.sh
Expand All @@ -40,7 +40,7 @@ jobs:
# bind current directory into container as /software-layer
export SINGULARITY_BIND="${PWD}:/software-layer"
# can't test with EasyBuild versions older than v4.5.2 when using EESSI pilot 2023.06,
# can't test with EasyBuild versions older than v4.5.2 when using EESSI 2023.06,
# since Python in compat layer is Python 3.11.x;
# testing with a single EasyBuild version takes a while in GitHub Actions, so stick to a single sensible version
for EB_VERSION in '4.6.0'; do
Expand Down Expand Up @@ -84,15 +84,15 @@ jobs:
cp -a * /tmp/
cd /tmp
# force using x86_64/generic, to avoid triggering an installation from scratch
sed -i "s@./EESSI-pilot-install-software.sh@\"export EESSI_SOFTWARE_SUBDIR_OVERRIDE='x86_64/generic'; ./EESSI-pilot-install-software.sh\"@g" install_software_layer.sh
./build_container.sh run /tmp/$USER/EESSI /tmp/install_software_layer.sh
sed -i "s@./EESSI-install-software.sh@\"export EESSI_SOFTWARE_SUBDIR_OVERRIDE='x86_64/generic'; ./EESSI-install-software.sh\"@g" install_software_layer.sh
./eessi_container.sh --mode run --verbose /tmp/install_software_layer.sh
- name: test create_directory_tarballs.sh script
run: |
# scripts need to be copied to /tmp,
# since create_directory_tarballs.sh must be accessible from within build container
cp -a * /tmp/
cd /tmp
./build_container.sh run /tmp/$USER/EESSI /tmp/create_directory_tarballs.sh 2023.06
./eessi_container.sh --mode run --verbose /tmp/create_directory_tarballs.sh 2023.06
# check if tarballs have been produced
ls -l *.tar.gz
6 changes: 3 additions & 3 deletions EESSI-pilot-install-software.sh → EESSI-install-software.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Script to install EESSI pilot software stack (version set through init/eessi_defaults)
# Script to install EESSI software stack (version set through init/eessi_defaults)

# see example parsing of command line arguments at
# https://wiki.bash-hackers.org/scripting/posparams#using_a_while_loop
Expand Down Expand Up @@ -172,8 +172,6 @@ if [ ! -z "${shared_fs_path}" ]; then
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 All @@ -200,6 +198,8 @@ for easystack_file in $(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[
# load EasyBuild module (will be installed if it's not available yet)
source ${TOPDIR}/load_easybuild_module.sh ${eb_version}

${EB} --show-config

echo_green "All set, let's start installing some software with EasyBuild v${eb_version} in ${EASYBUILD_INSTALLPATH}..."

if [ -f ${easystack_file} ]; then
Expand Down
16 changes: 8 additions & 8 deletions bot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ 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/build.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
# determine EESSI version to be used from .repository.repo_version in ${JOB_CFG_FILE}
# here, just set & export EESSI_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/build.sh: EESSI_PILOT_VERSION_OVERRIDE='${EESSI_PILOT_VERSION_OVERRIDE}'"
export EESSI_VERSION_OVERRIDE=$(cfg_get_value "repository" "repo_version")
echo "bot/build.sh: EESSI_VERSION_OVERRIDE='${EESSI_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
Expand Down Expand Up @@ -210,9 +210,9 @@ BUILD_TMPDIR=$(grep ' as tmp directory ' ${build_outerr} | cut -d ' ' -f 2)
TARBALL_STEP_ARGS+=("--resume" "${BUILD_TMPDIR}")

timestamp=$(date +%s)
# to set EESSI_PILOT_VERSION we need to source init/eessi_defaults now
# to set EESSI_VERSION we need to source init/eessi_defaults now
source init/eessi_defaults
export TGZ=$(printf "eessi-%s-software-%s-%s-%d.tar.gz" ${EESSI_PILOT_VERSION} ${EESSI_OS_TYPE} ${EESSI_SOFTWARE_SUBDIR_OVERRIDE//\//-} ${timestamp})
export TGZ=$(printf "eessi-%s-software-%s-%s-%d.tar.gz" ${EESSI_VERSION} ${EESSI_OS_TYPE} ${EESSI_SOFTWARE_SUBDIR_OVERRIDE//\//-} ${timestamp})

# value of first parameter to create_tarball.sh - TMP_IN_CONTAINER - needs to be
# synchronised with setting of TMP_IN_CONTAINER in eessi_container.sh
Expand All @@ -221,8 +221,8 @@ export TGZ=$(printf "eessi-%s-software-%s-%s-%d.tar.gz" ${EESSI_PILOT_VERSION} $
TMP_IN_CONTAINER=/tmp
echo "Executing command to create tarball:"
echo "./eessi_container.sh ${COMMON_ARGS[@]} ${TARBALL_STEP_ARGS[@]}"
echo " -- ./create_tarball.sh ${TMP_IN_CONTAINER} ${EESSI_PILOT_VERSION} ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} /eessi_bot_job/${TGZ} 2>&1 | tee -a ${tar_outerr}"
echo " -- ./create_tarball.sh ${TMP_IN_CONTAINER} ${EESSI_VERSION} ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} /eessi_bot_job/${TGZ} 2>&1 | tee -a ${tar_outerr}"
./eessi_container.sh "${COMMON_ARGS[@]}" "${TARBALL_STEP_ARGS[@]}" \
-- ./create_tarball.sh ${TMP_IN_CONTAINER} ${EESSI_PILOT_VERSION} ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} /eessi_bot_job/${TGZ} 2>&1 | tee -a ${tar_outerr}
-- ./create_tarball.sh ${TMP_IN_CONTAINER} ${EESSI_VERSION} ${EESSI_SOFTWARE_SUBDIR_OVERRIDE} /eessi_bot_job/${TGZ} 2>&1 | tee -a ${tar_outerr}

exit 0
20 changes: 10 additions & 10 deletions bot/inspect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ 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
# determine EESSI version to be used from .repository.repo_version in ${JOB_CFG_FILE}
# here, just set & export EESSI_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}'"
export EESSI_VERSION_OVERRIDE=$(cfg_get_value "repository" "repo_version")
echo "bot/inspect.sh: EESSI_VERSION_OVERRIDE='${EESSI_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
Expand Down Expand Up @@ -260,11 +260,11 @@ base_dir=$(dirname $(realpath $0))
# TODO better use script from tarball???
source ${base_dir}/../init/eessi_defaults

if [ -z $EESSI_PILOT_VERSION ]; then
echo "ERROR: \$EESSI_PILOT_VERSION must be set!" >&2
if [ -z $EESSI_VERSION ]; then
echo "ERROR: \$EESSI_VERSION must be set!" >&2
exit 1
fi
EESSI_COMPAT_LAYER_DIR="${EESSI_CVMFS_REPO}/versions/${EESSI_PILOT_VERSION}/compat/linux/$(uname -m)"
EESSI_COMPAT_LAYER_DIR="${EESSI_CVMFS_REPO}/versions/${EESSI_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.
Expand Down Expand Up @@ -295,8 +295,8 @@ fi
if [ ! -z ${EESSI_CVMFS_REPO_OVERRIDE} ]; then
echo "export EESSI_CVMFS_REPO_OVERRIDE=${EESSI_CVMFS_REPO_OVERRIDE}" >> ${RESUME_SCRIPT}
fi
if [ ! -z ${EESSI_PILOT_VERSION_OVERRIDE} ]; then
echo "export EESSI_PILOT_VERSION_OVERRIDE=${EESSI_PILOT_VERSION_OVERRIDE}" >> ${RESUME_SCRIPT}
if [ ! -z ${EESSI_VERSION_OVERRIDE} ]; then
echo "export EESSI_VERSION_OVERRIDE=${EESSI_VERSION_OVERRIDE}" >> ${RESUME_SCRIPT}
fi
if [ ! -z ${http_proxy} ]; then
echo "export http_proxy=${http_proxy}" >> ${RESUME_SCRIPT}
Expand Down Expand Up @@ -428,7 +428,7 @@ 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'
# - setup steps run in 'EESSI-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.
if [[ -z ${run_in_prefix} ]]; then
Expand Down
2 changes: 1 addition & 1 deletion install_software_layer.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
base_dir=$(dirname $(realpath $0))
source ${base_dir}/init/eessi_defaults
./run_in_compat_layer_env.sh ./EESSI-pilot-install-software.sh "$@"
./run_in_compat_layer_env.sh ./EESSI-install-software.sh "$@"
12 changes: 6 additions & 6 deletions run_in_compat_layer_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
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
if [ -z $EESSI_VERSION ]; then
echo "ERROR: \$EESSI_VERSION must be set!" >&2
exit 1
fi
EESSI_COMPAT_LAYER_DIR="${EESSI_CVMFS_REPO}/versions/${EESSI_PILOT_VERSION}/compat/linux/$(uname -m)"
EESSI_COMPAT_LAYER_DIR="${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/compat/linux/$(uname -m)"
if [ ! -d ${EESSI_COMPAT_LAYER_DIR} ]; then
echo "ERROR: ${EESSI_COMPAT_LAYER_DIR} does not exist!" >&2
exit 1
Expand All @@ -23,8 +23,8 @@ 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}"
if [ ! -z ${EESSI_VERSION_OVERRIDE} ]; then
INPUT="export EESSI_VERSION_OVERRIDE=${EESSI_VERSION_OVERRIDE}; ${INPUT}"
fi
if [ ! -z ${http_proxy} ]; then
INPUT="export http_proxy=${http_proxy}; ${INPUT}"
Expand All @@ -33,5 +33,5 @@ if [ ! -z ${https_proxy} ]; then
INPUT="export https_proxy=${https_proxy}; ${INPUT}"
fi

echo "Running '${INPUT}' in EESSI (${EESSI_CVMFS_REPO}) ${EESSI_PILOT_VERSION} compatibility layer environment..."
echo "Running '${INPUT}' in EESSI (${EESSI_CVMFS_REPO}) ${EESSI_VERSION} compatibility layer environment..."
${EESSI_COMPAT_LAYER_DIR}/startprefix <<< "${INPUT}"

0 comments on commit 5c395f2

Please sign in to comment.