From 51d3d91b7c33bfabdefbf26ebe196656a97d259a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 5 Aug 2025 17:20:51 +0200 Subject: [PATCH 1/6] use fuse mounts by default, make sure trailing newlines are removed from variables --- eessi_container.sh | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/eessi_container.sh b/eessi_container.sh index cc477abb..b2595c0b 100755 --- a/eessi_container.sh +++ b/eessi_container.sh @@ -762,22 +762,29 @@ do [[ ${VERBOSE} -eq 1 ]] && echo "add fusemount options for CVMFS repo '${cvmfs_repo}'" # split into name, access mode, and mount mode readarray -td, cvmfs_repo_args <<<"$cvmfs_repo" - cvmfs_repo_name=$(sed -e 's/\\n//g' <<< "${cvmfs_repo_args[0]}") + cvmfs_repo_name=${cvmfs_repo_args[0]%$'\n'} # remove possible trailing newline cvmfs_repo_access="${ACCESS}" # initialize to the default access mode + cvmfs_repo_mount="fuse" # use fuse mounts by default for arg in ${cvmfs_repo_args[@]:1}; do if [[ $arg == "access="* ]]; then cvmfs_repo_access=${arg/access=} + # remove possible trailing newline + cvmfs_repo_access=${cvmfs_repo_access%$'\n'} fi if [[ $arg == "mount="* ]]; then cvmfs_repo_mount=${arg/mount=} - # check if the specified mount mode is a valid one - if [[ ${cvmfs_repo_mount} != "bind" ]] && [[ ${cvmfs_repo_mount} != "fuse" ]]; then - echo -e "ERROR: mount mode '${cvmfs_repo_mount}' for CVMFS repository\n '${cvmfs_repo_name}' is not known" - exit ${REPOSITORY_ERROR_EXITCODE} - fi + # remove possible trailing newline + cvmfs_repo_mount=${cvmfs_repo_mount%$'\n'} fi done + # check if the specified mount mode is a valid one + if [[ ${cvmfs_repo_mount} != "bind" ]] && [[ ${cvmfs_repo_mount} != "fuse" ]]; then + echo -e "ERROR: mount mode '${cvmfs_repo_mount}' for CVMFS repository\n '${cvmfs_repo_name}' is not known" + exit ${REPOSITORY_ERROR_EXITCODE} + fi + [[ ${VERBOSE} -eq 1 ]] && echo "Using a ${cvmfs_repo_mount} mount for /cvmfs/${cvmfs_repo_name}" + # obtain cvmfs_repo_name from EESSI_REPOS_CFG_FILE if cvmfs_repo is in cfg_cvmfs_repos if [[ ${cfg_cvmfs_repos[${cvmfs_repo_name}]} ]]; then [[ ${VERBOSE} -eq 1 ]] && echo "repo '${cvmfs_repo_name}' is not an EESSI CVMFS repository..." @@ -791,15 +798,6 @@ do # remove project subdir in container cvmfs_repo_name=${cvmfs_repo_name%"/${EESSI_DEV_PROJECT}"} - # if a mount mode was not specified, we use a bind mount if the repository is available on the host, - # and otherwise we use a fuse mount - if [[ -z ${cvmfs_repo_mount} ]]; then - cvmfs_repo_mount="fuse" - if [[ -x $(command -v cvmfs_config) ]] && cvmfs_config probe ${cvmfs_repo_name} >& /dev/null; then - cvmfs_repo_mount="bind" - fi - fi - [[ ${VERBOSE} -eq 1 ]] && echo "Using a ${cvmfs_repo_mount} mount for /cvmfs/${cvmfs_repo_name}" # if a bind mount was requested, check if the repository is really available on the host if [[ ${cvmfs_repo_mount} == "bind" ]]; then if [[ ! -x $(command -v cvmfs_config) ]] || ! cvmfs_config probe ${cvmfs_repo_name} >& /dev/null; then From 289003cd1673effbade160b6792f60aa922d6540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 5 Aug 2025 19:31:47 +0200 Subject: [PATCH 2/6] dummy easystack --- .../2023.06/eessi-2023.06-eb-5.1.1-001-system.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.1-001-system.yml diff --git a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.1-001-system.yml b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.1-001-system.yml new file mode 100644 index 00000000..44fe4d92 --- /dev/null +++ b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.1-001-system.yml @@ -0,0 +1,2 @@ +easyconfigs: + - cowsay-3.04.eb From 231db5bc174cedf8d95e5dca227f0c5f9fb99653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 5 Aug 2025 19:52:34 +0200 Subject: [PATCH 3/6] explicitly enable bind mount in test --- .github/workflows/tests_scripts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests_scripts.yml b/.github/workflows/tests_scripts.yml index 7a3682c1..17d5470c 100644 --- a/.github/workflows/tests_scripts.yml +++ b/.github/workflows/tests_scripts.yml @@ -160,6 +160,6 @@ jobs: export EESSI_VERSION_OVERRIDE="${{matrix.EESSI_VERSION}}" out="${PWD}/eb-${EB_VERSION}.out" - ./eessi_container.sh --access rw --mode run --verbose /software-layer-scripts/run_in_compat_layer_env.sh ls 2>&1 | tee ${out} + ./eessi_container.sh --repository software.eessi.io,access=rw,mount=bind --mode run --verbose /software-layer-scripts/run_in_compat_layer_env.sh ls 2>&1 | tee ${out} echo $(grep "SINGULARITY_BIND" ${out}) grep "SINGULARITY_BIND" ${out} | grep "software.eessi.io" || (echo "software.eessi.io did not seem to be bind mounted!" && exit 1) From 0df26f7b6dc755ab8755f238918f30b79973d0d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 5 Aug 2025 20:17:21 +0200 Subject: [PATCH 4/6] prevent newline from being added by using printf, remove debugging statements --- eessi_container.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/eessi_container.sh b/eessi_container.sh index b2595c0b..a0729361 100755 --- a/eessi_container.sh +++ b/eessi_container.sh @@ -761,20 +761,16 @@ do unset cfg_repo_id [[ ${VERBOSE} -eq 1 ]] && echo "add fusemount options for CVMFS repo '${cvmfs_repo}'" # split into name, access mode, and mount mode - readarray -td, cvmfs_repo_args <<<"$cvmfs_repo" - cvmfs_repo_name=${cvmfs_repo_args[0]%$'\n'} # remove possible trailing newline + readarray -td, cvmfs_repo_args < <(printf '%s' "$cvmfs_repo") + cvmfs_repo_name=${cvmfs_repo_args[0]} cvmfs_repo_access="${ACCESS}" # initialize to the default access mode cvmfs_repo_mount="fuse" # use fuse mounts by default for arg in ${cvmfs_repo_args[@]:1}; do if [[ $arg == "access="* ]]; then cvmfs_repo_access=${arg/access=} - # remove possible trailing newline - cvmfs_repo_access=${cvmfs_repo_access%$'\n'} fi if [[ $arg == "mount="* ]]; then cvmfs_repo_mount=${arg/mount=} - # remove possible trailing newline - cvmfs_repo_mount=${cvmfs_repo_mount%$'\n'} fi done @@ -791,9 +787,7 @@ do # cvmfs_repo_name is actually a repository ID, use that to obtain # the actual name from the EESSI_REPOS_CFG_FILE cfg_repo_id=${cvmfs_repo_name} - echo "bob $cfg_repo_id" cvmfs_repo_name=$(cfg_get_value ${cfg_repo_id} "repo_name") - echo $cvmfs_repo_name fi # remove project subdir in container cvmfs_repo_name=${cvmfs_repo_name%"/${EESSI_DEV_PROJECT}"} From 6610e7e22257061115c05ca3d3c35e410617c151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 5 Aug 2025 20:23:40 +0200 Subject: [PATCH 5/6] apply same changes to other parts of the code where we loop over the repos --- eessi_container.sh | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/eessi_container.sh b/eessi_container.sh index a0729361..9b5d28d7 100755 --- a/eessi_container.sh +++ b/eessi_container.sh @@ -316,12 +316,9 @@ fi # iterate over entries in REPOSITORIES and check if they are known for cvmfs_repo in "${REPOSITORIES[@]}" do - # split into name and access mode if ',access=' in $cvmfs_repo - if [[ ${cvmfs_repo} == *",access="* ]] ; then - cvmfs_repo_name=${cvmfs_repo/,access=*/} # remove access mode specification - else - cvmfs_repo_name="${cvmfs_repo}" - fi + readarray -td, cvmfs_repo_args < <(printf '%s' "$cvmfs_repo") + cvmfs_repo_name=${cvmfs_repo_args[0]} + if [[ ! -n "${eessi_cvmfs_repos[${cvmfs_repo_name}]}" && ! -n ${cfg_cvmfs_repos[${cvmfs_repo_name}]} ]]; then fatal_error "The repository '${cvmfs_repo_name}' is not an EESSI CVMFS repository or it is not known how to mount it (could be due to a typo or missing configuration). Run '$0 -l' to obtain a list of available repositories." "${REPOSITORY_ERROR_EXITCODE}" fi @@ -331,7 +328,8 @@ done declare -A listed_repos=() for cvmfs_repo in "${REPOSITORIES[@]}" do - cvmfs_repo_name=${cvmfs_repo/,access=*/} # remove access mode + readarray -td, cvmfs_repo_args < <(printf '%s' "$cvmfs_repo") + cvmfs_repo_name=${cvmfs_repo_args[0]} [[ ${VERBOSE} -eq 1 ]] && echo "checking for duplicates: '${cvmfs_repo}' and '${cvmfs_repo_name}'" # if cvmfs_repo_name is not in eessi_cvmfs_repos, assume it's in cfg_cvmfs_repos # and obtain actual repo_name from config @@ -617,14 +615,8 @@ mkdir -p ${EESSI_TMPDIR}/repos_cfg for cvmfs_repo in "${REPOSITORIES[@]}" do [[ ${VERBOSE} -eq 1 ]] && echo "process CVMFS repo spec '${cvmfs_repo}'" - # split into name and access mode if ',access=' in $cvmfs_repo - if [[ ${cvmfs_repo} == *",access="* ]] ; then - cvmfs_repo_name=${cvmfs_repo/,access=*/} # remove access mode specification - cvmfs_repo_access=${cvmfs_repo/*,access=/} # remove repo name part - else - cvmfs_repo_name="${cvmfs_repo}" - cvmfs_repo_access="${ACCESS}" # use globally defined access mode - fi + readarray -td, cvmfs_repo_args < <(printf '%s' "$cvmfs_repo") + cvmfs_repo_name=${cvmfs_repo_args[0]} # if cvmfs_repo_name is in cfg_cvmfs_repos, it is a "repository ID" and was # derived from information in EESSI_REPOS_CFG_FILE, namely the section # names in that .ini-type file From 435863c38922fa7447ba9d64a057e76086bce161 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen <33718780+casparvl@users.noreply.github.com> Date: Tue, 5 Aug 2025 21:16:00 +0200 Subject: [PATCH 6/6] Delete easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.1-001-system.yml --- .../2023.06/eessi-2023.06-eb-5.1.1-001-system.yml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.1-001-system.yml diff --git a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.1-001-system.yml b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.1-001-system.yml deleted file mode 100644 index 44fe4d92..00000000 --- a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.1-001-system.yml +++ /dev/null @@ -1,2 +0,0 @@ -easyconfigs: - - cowsay-3.04.eb