Skip to content

Commit

Permalink
Merge pull request #7699 from DIRACGridBot/cherry-pick-2-83daa3939-in…
Browse files Browse the repository at this point in the history
…tegration

[sweep:integration] feat: added possibility to specify UserEnvVariable (pilot option) at CE level
  • Loading branch information
fstagni authored Jun 26, 2024
2 parents baf6c56 + 6fcacfa commit 95bb0b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dirac.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,11 @@ Resources
# Will be added to the pilot configuration as /LocalSite/SharedArea
SharedArea = /cvmfs/lhcb.cern.ch/lib

# For adding Extra environments (only for pilots submitted by SiteDirectors)
UserEnvVariables = DIRACSYSCONFIG:::pilot.cfg,RUCIO_HOME:::/home/dirac/rucio

# for adding some extra pilot options (only for pilots submitted by SiteDirectors)
# the example below will add the environment variable DIRACSYSCONFIG (see :ref:`bashrc_variables`)
ExtraPilotOptions = --userEnvVariables DIRACSYSCONFIG:::pilot.cfg
ExtraPilotOptions = --pilotLogging True

# for adding some generic pilot options (only for pilots submitted by SiteDirectors)
# which will be transleted as "-o" options of the Pilot
Expand Down
3 changes: 3 additions & 0 deletions src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,9 @@ def _getPilotOptions(self, queue: str) -> list[str]:
if "SharedArea" in queueDict:
pilotOptions.append(f"-o '/LocalSite/SharedArea={queueDict['SharedArea']}'")

if "UserEnvVariables" in queueDict:
pilotOptions.append(f"--userEnvVariables={queueDict['UserEnvVariables']}")

if "ExtraPilotOptions" in queueDict:
for extraPilotOption in queueDict["ExtraPilotOptions"].split(","):
pilotOptions.append(extraPilotOption.strip())
Expand Down

0 comments on commit 95bb0b1

Please sign in to comment.