Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP8 fixes for PR #2331 (apptainer_run) by autopep8 #2332

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 17 additions & 6 deletions ganga/GangaLHCb/Lib/Applications/GaudiExec.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@
'nMakeCores': SimpleItem(defvalue=1,
doc='Number of cores to be provided via the "-j" option to the "make" command'\
'when building the ganga-input-sandbox'),
'apptainerBuild': SimpleItem(defvalue=False, doc="Run the build command in apptainer"),
'containerLocation': SimpleItem(defvalue='/cvmfs/cernvm-prod.cern.ch/cvm4',
doc='Where is the container to use for the build located'),
'useApptainer': SimpleItem(defvalue=False, doc="Run the commands in apptainer"),
'containerLocation': SimpleItem(defvalue='/cvmfs/lhcb.cern.ch/containers/os-base/slc6-devel/prod/amd64',
doc='Where is the container to use for the build located'),
# Prepared job object
'is_prepared': SimpleItem(defvalue=None, strict_sequence=0, visitable=1, copyable=1, hidden=0,
typelist=[None, ShareDir], protected=0, comparable=1,
Expand Down Expand Up @@ -557,7 +557,18 @@
if isLbEnv:
initialCommand = 'source /cvmfs/lhcb.cern.ch/lib/LbEnv && source LbLogin.sh -c %s && make -j%s' % (
self.platform, self.nMakeCores)
rc, stdout, stderr = _exec_cmd(initialCommand, self.directory)
if self.useApptainer or 'slc6' in self.platform:
try:
logger.info('Building inside apptainer: %s' % self.containerLocation)
cmd_to_run = 'source /cvmfs/lhcb.cern.ch/lib/LbEnv && apptainer exec --bind $PWD --bind %s --bind /cvmfs:/cvmfs:ro ' % path.dirname(

Check failure on line 563 in ganga/GangaLHCb/Lib/Applications/GaudiExec.py

View workflow job for this annotation

GitHub Actions / Linting

E501 line too long (152 > 127 characters)
cmd_file.name) + self.containerLocation + ' bash -c "%s"' % initialCommand
rc, stdout, stderr = _exec_cmd(cmd_to_run, self.directory)
except BaseException:
logger.error('Failed to build the application inside a container. '
'Perhaps the specified container location is not accessible.')
raise GangaException('Failed to execute make command')
else:
rc, stdout, stderr = _exec_cmd(initialCommand, self.directory)
if rc != 0:
logger.error("Failed to perform initial make on a Cmake based project")
logger.error("This is required so that the './run' target exists and is callable within the project")
Expand All @@ -569,8 +580,8 @@
if self.apptainerBuild or 'slc6' in self.platform:
try:
logger.info('Building inside apptainer: %s' % self.containerLocation)
cmd_to_run = 'source /cvmfs/lhcb.cern.ch/lib/LbEnv && apptainer exec --env "PATH=$PATH" --bind $PWD --bind /cvmfs:/cvmfs:ro '\
+ self.containerLocation + ' ' + cmd_file.name
cmd_to_run = 'source /cvmfs/lhcb.cern.ch/lib/LbEnv && apptainer exec --bind $PWD --bind %s --bind /cvmfs:/cvmfs:ro ' % path.dirname(

Check failure on line 583 in ganga/GangaLHCb/Lib/Applications/GaudiExec.py

View workflow job for this annotation

GitHub Actions / Linting

E501 line too long (152 > 127 characters)
cmd_file.name) + self.containerLocation + ' bash -c "source ' + cmd_file.name + '"'
rc, stdout, stderr = _exec_cmd(cmd_to_run, self.directory)
except BaseException:
logger.error('Failed to build the application inside a container. '
Expand Down