From 6437a6ed538745ff1c6187149f3532e6b179c839 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Wed, 23 Jul 2025 11:02:13 -0500 Subject: [PATCH 1/2] prevent binding nonexistent files/directories --- bind_condor.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/bind_condor.sh b/bind_condor.sh index 3aed633..580dad3 100755 --- a/bind_condor.sh +++ b/bind_condor.sh @@ -1,5 +1,14 @@ #!/bin/bash +bind_if_exists(){ + for ITEM in "$@"; do + TESTITEM="${ITEM%%:*}" + if [ -e "$TESTITEM" ]; then + export APPTAINER_BIND=${APPTAINER_BIND}${APPTAINER_BIND:+,}${ITEM} + fi + done +} + LPC_CONDOR_CONFIG=/etc/condor/config.d/01_cmslpc_interactive LPC_CONDOR_LOCAL=/usr/local/bin/cmslpc-local-conf.py @@ -12,18 +21,18 @@ if [ "$COMMAND_NAME" = "$(basename $LPC_CONDOR_LOCAL)" ]; then fi OSG_CONDOR_CONFIG=/etc/condor/condor_config -OSG_CONDOR_LOCAL=/usr/share/condor/config.d,/etc/condor/config.d +OSG_CONDOR_LOCAL=(/usr/share/condor/config.d /etc/condor/config.d) LXP_CONDOR_CONFIG=/etc/condor/condor_config -LXP_CONDOR_LOCAL=/etc/condor/config.d,/usr/bin/myschedd.sh,/usr/bin/myschedd,/etc/myschedd +LXP_CONDOR_LOCAL=(/etc/condor/config.d /usr/bin/myschedd.sh /usr/bin/myschedd /etc/myschedd) if [[ "$(uname -a)" == *cms*.fnal.gov* ]]; then - export APPTAINER_BIND=${APPTAINER_BIND}${APPTAINER_BIND:+,}${LPC_CONDOR_CONFIG},${LPC_CONDOR_LOCAL}:${LPC_CONDOR_LOCAL}.orig,${COMMAND_PATH}:${LPC_CONDOR_LOCAL} + bind_if_exists ${LPC_CONDOR_CONFIG} ${LPC_CONDOR_LOCAL}:${LPC_CONDOR_LOCAL}.orig "${COMMAND_PATH}":${LPC_CONDOR_LOCAL} export APPTAINERENV_CONDOR_CONFIG=${LPC_CONDOR_CONFIG} elif [[ "$(uname -a)" == *.uscms.org* ]] || [[ "$(uname -a)" == *.osg-htc.org* ]]; then - export APPTAINER_BIND=${APPTAINER_BIND}${APPTAINER_BIND:+,}${OSG_CONDOR_CONFIG},${OSG_CONDOR_LOCAL} + bind_if_exists ${OSG_CONDOR_CONFIG} "${OSG_CONDOR_LOCAL[@]}" export APPTAINERENV_CONDOR_CONFIG=${OSG_CONDOR_CONFIG} elif [[ "$(uname -a)" == *lxplus*.cern.ch* ]]; then - export APPTAINER_BIND=${APPTAINER_BIND}${APPTAINER_BIND:+,}${LXP_CONDOR_CONFIG},${LXP_CONDOR_LOCAL} + bind_if_exists ${LXP_CONDOR_CONFIG} "${LXP_CONDOR_LOCAL[@]}" export APPTAINERENV_CONDOR_CONFIG=${LXP_CONDOR_CONFIG} fi From de677059230576440251fb0ea897117107e01dc8 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Wed, 23 Jul 2025 11:13:06 -0500 Subject: [PATCH 2/2] updates for new cms connect host --- bind_condor.sh | 2 +- call_host.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bind_condor.sh b/bind_condor.sh index 580dad3..772bac2 100755 --- a/bind_condor.sh +++ b/bind_condor.sh @@ -29,7 +29,7 @@ LXP_CONDOR_LOCAL=(/etc/condor/config.d /usr/bin/myschedd.sh /usr/bin/myschedd /e if [[ "$(uname -a)" == *cms*.fnal.gov* ]]; then bind_if_exists ${LPC_CONDOR_CONFIG} ${LPC_CONDOR_LOCAL}:${LPC_CONDOR_LOCAL}.orig "${COMMAND_PATH}":${LPC_CONDOR_LOCAL} export APPTAINERENV_CONDOR_CONFIG=${LPC_CONDOR_CONFIG} -elif [[ "$(uname -a)" == *.uscms.org* ]] || [[ "$(uname -a)" == *.osg-htc.org* ]]; then +elif [[ "$(uname -a)" == *.uscms.org* ]] || [[ "$(uname -a)" == *.osg-htc.org* ]] || [[ "$(uname -a)" == *cmscon.hep.wisc.edu* ]]; then bind_if_exists ${OSG_CONDOR_CONFIG} "${OSG_CONDOR_LOCAL[@]}" export APPTAINERENV_CONDOR_CONFIG=${OSG_CONDOR_CONFIG} elif [[ "$(uname -a)" == *lxplus*.cern.ch* ]]; then diff --git a/call_host.sh b/call_host.sh index ad719fa..5efbbbe 100755 --- a/call_host.sh +++ b/call_host.sh @@ -19,7 +19,7 @@ fi if [ -z "$CALL_HOST_DIR" ]; then if [[ "$(uname -a)" == *cms*.fnal.gov* ]]; then export CALL_HOST_DIR=~/nobackup/pipes - elif [[ "$(uname -a)" == *.uscms.org* ]] || [[ "$(uname -a)" == *.osg-htc.org* ]] ; then + elif [[ "$(uname -a)" == *.uscms.org* ]] || [[ "$(uname -a)" == *.osg-htc.org* ]] || [[ "$(uname -a)" == *cmscon.hep.wisc.edu* ]]; then export CALL_HOST_DIR=/scratch/$(whoami)/pipes elif [[ "$(uname -a)" == *lxplus*.cern.ch* ]]; then export CALL_HOST_DIR=/tmp/$(whoami)/pipes