Skip to content

Commit

Permalink
Feature: option to use containers for ND280 RDP
Browse files Browse the repository at this point in the history
  • Loading branch information
NickHastings committed Jan 21, 2025
1 parent 9fe6086 commit 5be6f5e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ganga/GangaND280/ND280Control/runND280RDP.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from GangaCore.Utility.Config import getConfig
from GangaCore.Utility.files import expandfilename
from GangaCore.GPIDev.Adapters.ApplicationRuntimeHandlers import allHandlers
from GangaCore.Lib.Virtualization import Apptainer
from . import ND280Configs

shared_path = os.path.join(
Expand Down Expand Up @@ -75,6 +76,16 @@ class runND280RDP(IPrepareApp):
comparable=1,
doc='Location of shared resources. Presence of this attribute implies the application has been prepared.',
),
'container': SimpleItem(
defvalue=None, doc='Path to container', typelist=['type(None)', 'str']
),
'mounts': SimpleItem(
defvalue=[],
doc='Container paths to mount',
typelist=['str'],
sequence=1,
strict_sequence=0,
),
},
)
_category = 'applications'
Expand All @@ -88,6 +99,11 @@ def configure(self, masterappconfig):
args = convertIntToStringArgs(self.args)

job = self.getJobObject()
if self.container:
job.virtualization = Apptainer(image=self.container)

if len(self.mounts) > 0:
job.virtualization.mounts = {mount: mount for mount in self.mounts}

if self.cmtsetup == []:
raise ApplicationConfigurationError('No cmt setup script given.')
Expand Down

0 comments on commit 5be6f5e

Please sign in to comment.