Skip to content

Commit 9edb9ed

Browse files
authored
feat: lxplus condor submission without CMSSW and with mamba (cms-btv-pog#99)
1 parent 2785534 commit 9edb9ed

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

Diff for: condor/execute.sh

+21-15
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@ if [ -d /afs/cern.ch/user/${USER:0:1}/$USER ]; then
88
fi
99
env
1010

11+
1112
WORKDIR=`pwd`
1213

13-
# Load a base cmssw env
14-
export SCRAM_ARCH=slc7_amd64_gcc820
15-
source /cvmfs/cms.cern.ch/cmsset_default.sh
16-
scram p CMSSW CMSSW_11_1_0_pre5_PY3
17-
cd CMSSW_11_1_0_pre5_PY3/src
18-
eval `scram runtime -sh`
19-
cd ../..
2014

21-
# Set up conda environment
22-
wget https://repo.anaconda.com/miniconda/Miniconda3-py310_23.5.0-3-Linux-x86_64.sh
23-
bash Miniconda3-py310_23.5.0-3-Linux-x86_64.sh -b -p $WORKDIR/miniconda
15+
# Set up mamba environment
16+
## Interactive bash script with fallback pointing to $HOME, hence setting $PWD of worker node as $HOME
17+
export HOME=`pwd`
18+
wget -L micro.mamba.pm/install.sh
19+
chmod +x install.sh
20+
## FIXME parsing arguments does not work. will use defaults in install.sh instead, see https://github.com/mamba-org/micromamba-releases/blob/main/install.sh
21+
## Tried solutions listed in https://stackoverflow.com/questions/14392525/passing-arguments-to-an-interactive-program-non-interactively
22+
./install.sh <<< $'bin\nY\nY\nmicromamba\n'
23+
source .bashrc
24+
25+
export PATH=$WORKDIR:$PATH
2426

25-
export PATH=$WORKDIR/miniconda/bin:$PATH
26-
export PYTHONPATH=$WORKDIR/miniconda/lib/python3.10/site-packages
2727

2828
if [ ! -d /afs/cern.ch/user/${USER:0:1}/$USER ]; then
2929
## install necessary packages if on cmsconnect
30-
conda install -c conda-forge jq --yes
30+
micromamba install -c conda-forge jq --yes
3131
fi
3232

3333
# Get arguments
@@ -36,6 +36,12 @@ for key in workflow output samplejson year campaign isSyst isArray noHist overwr
3636
ARGS[$key]=$(jq -r ".$key" $WORKDIR/arguments.json)
3737
done
3838

39+
# Create base env with python=3.10 and setuptools<=70.1.1
40+
micromamba activate
41+
micromamba install python=3.10 -c conda-forge xrootd --yes
42+
micromamba activate base
43+
micromamba install setuptools=70.1.1
44+
3945
# Install BTVNanoCommissioning
4046
mkdir BTVNanoCommissioning
4147
cd BTVNanoCommissioning
@@ -51,7 +57,6 @@ ln -s /cvmfs/cms.cern.ch/rsync/cms-nanoAOD/jsonpog-integration src/BTVNanoCommis
5157
pip install -e .
5258

5359
## other dependencies
54-
conda install -c conda-forge xrootd --yes
5560
pip install psutil
5661

5762
# Build the sample json given the job id
@@ -62,9 +67,10 @@ OPTS="--wf ${ARGS[workflow]} --year ${ARGS[year]} --campaign ${ARGS[campaign]} -
6267
if [ "${ARGS[voms]}" != "null" ]; then
6368
OPTS="$OPTS --voms ${ARGS[voms]}"
6469
fi
65-
if [ "${ARGS[isSyst]}" != "null" ]; then
70+
if [ "${ARGS[isSyst]}" != "false" ]; then
6671
OPTS="$OPTS --isSyst ${ARGS[isSyst]}"
6772
fi
73+
6874
for key in isArray noHist overwrite skipbadfiles; do
6975
if [ "${ARGS[$key]}" == true ]; then
7076
OPTS="$OPTS --$key"

Diff for: condor/submitter.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -65,27 +65,30 @@ def get_main_parser():
6565
help="JSON file containing dataset and file locations (default: %(default)s)",
6666
)
6767
## Configuations
68-
parser.add_argument("--year", default="2017", help="Year")
68+
parser.add_argument("--year", default="2023", help="Year")
6969
parser.add_argument(
7070
"--campaign",
71-
default="Rereco17_94X",
71+
default="Summer23",
7272
choices=[
7373
"Rereco17_94X",
7474
"Winter22Run3",
75-
"Summer22Run3",
76-
"Summer22EERun3",
75+
"Summer22",
76+
"Summer22EE",
77+
"Summer23",
78+
"Summer23BPix",
7779
"2018_UL",
7880
"2017_UL",
7981
"2016preVFP_UL",
8082
"2016postVFP_UL",
83+
"CAMPAIGN_prompt_dataMC",
8184
],
8285
help="Dataset campaign, change the corresponding correction files",
8386
)
8487
parser.add_argument(
8588
"--isSyst",
86-
default=None,
89+
default=False,
8790
type=str,
88-
choices=[None, "all", "weight_only", "JERC_split"],
91+
choices=[False, "all", "weight_only", "JERC_split", "JP_MC"],
8992
help="Run with systematics, all, weights_only(no JERC uncertainties included),JERC_split, None",
9093
)
9194
parser.add_argument("--isArray", action="store_true", help="Output root files")
@@ -217,7 +220,6 @@ def get_main_parser():
217220
218221
Arguments = $(JOBNUM)
219222
220-
requirements = (OpSysAndVer =?= "CentOS7")
221223
request_cpus = 1
222224
request_memory = 2000
223225
use_x509userproxy = true

0 commit comments

Comments
 (0)