diff --git a/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py b/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py index 5a070c4eb5d..68f528f67a8 100644 --- a/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py +++ b/src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py @@ -1022,6 +1022,14 @@ def _getPilotOptions(self, queue, **kwargs): else: self.log.info("DIRAC project will be installed by pilots") + # Preinstalled environment defined ? + preinstalledEnv = opsHelper.getValue("Pilot/PreinstalledEnv", "") + preinstalledEnvPrefix = opsHelper.getValue("Pilot/PreinstalledEnvPrefix", "") + if preinstalledEnv: + pilotOptions.append(f"--preinstalledEnv={preinstalledEnv}") + elif preinstalledEnvPrefix: + pilotOptions.append(f"--preinstalledEnvPrefix={preinstalledEnvPrefix}") + pilotOptions.append("--pythonVersion=3") # DIRAC Extensions to be used in pilots