Skip to content

Commit

Permalink
improve bind_condor functionality for lpc configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
kpedro88 committed Oct 8, 2024
1 parent 28253b2 commit ff047ce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ scram-venv
cmsenv
pip3 install --upgrade pip
cmsenv
pip3 install --upgrade htcondor==10.3.0
pip3 install htcondor
```
In this particular case, it is necessary to upgrade `pip` and install a specific version of the bindings
because the Python version in `CMSSW_10_6_X` is old (Python 3.6.4).
In this particular case, it is necessary to upgrade `pip` because the Python version in `CMSSW_10_6_X` is old (Python 3.6.4).
`pip` should then automatically install a compatible version of the bindings.
**NOTE**: These recipes only install the bindings for Python3. (Python2 was still the default in `CMSSW_10_6_X`.)
You will need to make sure any scripts using the bindings are compatible with Python3.
Expand Down
16 changes: 12 additions & 4 deletions bind_condor.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/bin/bash

if [[ "$(uname -a)" == *cms*.fnal.gov* ]]; then
BIND_CONDOR_CONFIG=/etc/condor/config.d/01_cmslpc_interactive
BIND_CONDOR_PY=/usr/local/bin/cmslpc-local-conf.py
export APPTAINER_BIND=${APPTAINER_BIND}${APPTAINER_BIND:+,}${BIND_CONDOR_CONFIG},${BIND_CONDOR_PY}
LPC_CONDOR_CONFIG=/etc/condor/config.d/01_cmslpc_interactive
LPC_CONDOR_LOCAL=/usr/local/bin/cmslpc-local-conf.py

# not all containers have /usr/bin/python3
COMMAND_NAME=$(basename $0)
COMMAND_PATH=$(readlink -f "$BASH_SOURCE")
if [ "$COMMAND_NAME" = "$(basename $LPC_CONDOR_LOCAL)" ]; then
python3 ${LPC_CONDOR_LOCAL}.orig | grep -v "LOCAL_CONFIG_FILE"
exit $?
fi

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}
export APPTAINERENV_CONDOR_CONFIG=/etc/condor/config.d/01_cmslpc_interactive
fi

0 comments on commit ff047ce

Please sign in to comment.