Skip to content

Commit 6bd7c3b

Browse files
authored
Merge pull request #8207 from fstagni/90_fixes15
[9.0] dirac-apptainer-exec : cd in /mnt to find locally-mounted files (e.g. pilot.cfg)
2 parents 4aeeece + be97490 commit 6bd7c3b

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

src/DIRAC/Core/scripts/dirac_apptainer_exec.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def main():
8383
cmd.extend(["--bind", f"{vomses_location}:/etc/grid-security/vomses"]) # X509_VOMSES
8484
cmd.extend(["--bind", "{0}:{0}:ro".format(etc_dir)]) # etc dir for dirac.cfg
8585
cmd.extend(["--bind", "{0}:{0}:ro".format(os.path.join(os.path.realpath(sys.base_prefix)))]) # code dir
86+
cmd.extend(["--cwd", "/mnt"]) # set working directory to /mnt
8687

8788
rootImage = user_image or gConfig.getValue("/Resources/Computing/Singularity/ContainerRoot") or CONTAINER_DEFROOT
8889

src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ def _getExecutable(self, queue: str, proxy: X509Chain, jobExecDir: str = "", env
580580
pilotOptions = []
581581

582582
pilotOptions = " ".join(pilotOptions)
583-
self.log.verbose(f"pilotOptions: {pilotOptions}")
583+
self.log.verbose(f"{pilotOptions=}")
584584

585585
# if a global workingDirectory is defined for the CEType (like HTCondor)
586586
# use it (otherwise the __cleanup done by HTCondor will be in the wrong folder !)

src/DIRAC/WorkloadManagementSystem/Utilities/test/Test_PilotWrapper.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,19 @@ def test_scriptPilot3_4():
136136
assert 'os.environ["someName"]="someValue"' in res
137137
assert "lhcb-portal.cern.ch" in res
138138
assert """locations += ["file:/cvmfs/dirac.egi.eu/pilot"]""" in res
139+
140+
141+
def test_scriptPilot3_5():
142+
"""test script creation"""
143+
res = pilotWrapperScript(
144+
pilotFilesCompressedEncodedDict={"proxy": "thisIsSomeProxy"},
145+
pilotOptions="-l LHCb --architectureScript=dirac-architecture --CVMFS_locations=/cvmfs/lhcb.cern.ch -e LHCb -N atlasce1.lnf.infn.it -Q condor -n LCG.Frascati.it --wnVO=lhcb --architectureScript=dirac-apptainer-exec dirac-architecture -o lbRunOnly",
146+
envVariables={"someName": "someValue", "someMore": "oneMore"},
147+
location="lhcb-portal.cern.ch",
148+
CVMFS_locations=[],
149+
)
150+
assert 'os.environ["someName"]="someValue"' in res
151+
assert "lhcb-portal.cern.ch" in res
152+
assert """locations += ["file:/cvmfs/dirac.egi.eu/pilot"]""" in res
153+
assert "dirac-architecture" in res
154+
assert "dirac-apptainer-exec dirac-architecture" in res

0 commit comments

Comments
 (0)