diff --git a/iceprod/server/plugins/condor.py b/iceprod/server/plugins/condor.py index 7850c89e..338c84a5 100644 --- a/iceprod/server/plugins/condor.py +++ b/iceprod/server/plugins/condor.py @@ -145,6 +145,8 @@ def __init__(self, cfg: IceProdConfig, submit_dir: Path, credentials_dir: Path): self.transfer_plugins = self.condor_plugin_discovery() logger.info('transfer plugins installed: %s', list(self.transfer_plugins.keys())) + self.default_container = self.cfg['queue'].get('default_container', 'Undefined') + def condor_plugin_discovery(self): """Find all available HTCondor transfer plugins, and copy them to the submit_dir""" src_dir = importlib.resources.files('iceprod.server')/'data'/'condor_transfer_plugins' @@ -290,6 +292,7 @@ async def submit(self, tasks: list[Task], jel: Path): +OriginalTime = $(time) +TargetTime = (!isUndefined(Target.PYGLIDEIN_TIME_TO_LIVE) ? Target.PYGLIDEIN_TIME_TO_LIVE : Target.TimeToLive) requirements = $($(reqs)) ++SingularityImage= $(container) transfer_plugins = {transfer_plugin_str} when_to_transfer_output = ON_EXIT @@ -327,6 +330,10 @@ async def submit(self, tasks: list[Task], jel: Path): ads.update(self.condor_outfiles(s.outfiles)) ads.update(self.condor_resource_reqs(task)) + container = task.get_task_config().get('container', self.default_container) + if container != 'Undefined': + container = f'"{container}"' + reqs2 = reqs for k,v in tasks[0].get_task_config()['batchsys'].get('condor', {}).items(): if k.lower() == 'requirements': @@ -353,6 +360,7 @@ async def submit(self, tasks: list[Task], jel: Path): 'disk': f'{ads["request_disk"]}', 'time': f'{ads["+OriginalTime"]}', 'reqs': f'reqs{task.task_id}', + 'container': f'{container}', 'prec': f'{ads["PreCmd"]}', 'prea': f'{ads["PreArguments"]}', 'infiles': f'"{";".join(ads["transfer_input_files"])}"',