From 6fcacfa038d61c5648427235e352df43942dc76c Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Wed, 26 Jun 2024 13:52:29 +0200 Subject: [PATCH] sweep: #7698 feat: added possibility to specify UserEnvVariable (pilot option) at CE level --- dirac.cfg | 6 ++++-- src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dirac.cfg b/dirac.cfg index 3d0bb61e89b..2ebd6005cf4 100644 --- a/dirac.cfg +++ b/dirac.cfg @@ -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 diff --git a/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py b/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py index 540ff1e6948..5e0ac9f834d 100644 --- a/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py +++ b/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py @@ -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())