Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lobster/cmssw/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def _recycle(self, outdir):

def _get_cmssw_arch(self, dirname):
candidates = glob.glob('{}/.SCRAM/slc*'.format(dirname))
if len(candidates) != 1:
candidates = glob.glob('{}/.SCRAM/el*'.format(dirname))
if len(candidates) != 1:
raise AttributeError("Can't determine SCRAM arch!")
return os.path.basename(candidates[0])
Expand Down
2 changes: 1 addition & 1 deletion lobster/core/data/autosense.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cd "$release"
eval $(scramv1 runtime -sh)
cd - > /dev/null

python <<EOF > /dev/null 2>&1
python3 <<EOF > /dev/null 2>&1
import imp
import json
import shlex
Expand Down
4 changes: 2 additions & 2 deletions lobster/core/data/task.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from collections import defaultdict, Counter
from contextlib import contextmanager
Expand Down Expand Up @@ -54,7 +54,7 @@ def format(self, record):
fmt = '{chevron} {context}: {message}'
else:
fmt = '{chevron} {message}'
chevron = '>' * (record.levelno / logging.DEBUG + 1)
chevron = '>' * int(record.levelno / logging.DEBUG + 1)
return fmt.format(chevron=chevron, message=record.msg, date=time.strftime("%c"), context=self.context)


Expand Down
14 changes: 10 additions & 4 deletions lobster/core/data/wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ fi
log "sourcing CMS setup"
source /cvmfs/cms.cern.ch/cmsset_default.sh || exit_on_error $? 175 "Failed to source CMS"

slc=$(egrep "Red Hat Enterprise|Scientific|CentOS" /etc/redhat-release | sed 's/.*[rR]elease \([0-9]*\).*/\1/')
arch=$(echo sandbox-${LOBSTER_CMSSW_VERSION}-slc${slc}*.tar.bz2 | grep -oe "slc${slc}_[^.]*")
slc=$(sed -n 's/.*[Rr]elease \([0-9][0-9]*\).*/\1/p' /etc/redhat-release)
arch=$(echo sandbox-${LOBSTER_CMSSW_VERSION}-el${slc}_*.tar.bz2 | grep -oe "el${slc}_[^.]*")
#slc=$(egrep "Red Hat Enterprise|Scientific|CentOS" /etc/redhat-release | sed 's/.*[rR]elease \([0-9]*\).*/\1/')
#arch=$(echo sandbox-${LOBSTER_CMSSW_VERSION}-slc${slc}*.tar.bz2 | grep -oe "slc${slc}_[^.]*")

if [ -z "$LOBSTER_PROXY_INFO" -o \( -z "$LOBSTER_LCG_CP" -a -z "$LOBSTER_GFAL_COPY" \) ]; then
log "sourcing OSG setup"
Expand Down Expand Up @@ -161,8 +163,10 @@ date +%s > t_wrapper_ready

log "dir" "working directory before execution" ls -l

python -m ensurepip --user
python -m pip install --user future
python3 -m ensurepip --user
python3 -m pip install --user future

echo "Command to be executed: $*"

$*
res=$?
Expand All @@ -172,4 +176,6 @@ log "dir" "working directory after execution" ls -l
log "wrapper done"
log "final return status = $res"

echo "Command finished with status $res"

exit $res
2 changes: 1 addition & 1 deletion lobster/core/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def obtain(self, total, tasks):
'gridpack': False
}

cmd = 'sh wrapper.sh python task.py parameters.json'
cmd = 'sh wrapper.sh python3 task.py parameters.json'
env = {
'LOBSTER_CVMFS_PROXY': self.__cvmfs_proxy,
'LOBSTER_FRONTIER_PROXY': self.__frontier_proxy,
Expand Down