From 5553728dc77acf820e260bab824d923422a96467 Mon Sep 17 00:00:00 2001 From: Jonathan Bloedow Date: Tue, 2 Jul 2024 17:08:48 -0700 Subject: [PATCH] Adding script and SIF asset collection id to run a version of laser on COMPS. --- jb/laser.id | 1 + jb/run_laser_on_comps.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 jb/laser.id create mode 100644 jb/run_laser_on_comps.py diff --git a/jb/laser.id b/jb/laser.id new file mode 100644 index 0000000..d2878eb --- /dev/null +++ b/jb/laser.id @@ -0,0 +1 @@ +f3307b5d-c738-ef11-aa15-9440c9be2c51 diff --git a/jb/run_laser_on_comps.py b/jb/run_laser_on_comps.py new file mode 100644 index 0000000..b94e22f --- /dev/null +++ b/jb/run_laser_on_comps.py @@ -0,0 +1,30 @@ +import os +import sys + +from idmtools.assets import AssetCollection +from idmtools.core.platform_factory import Platform +from idmtools.entities import CommandLine +from idmtools.entities.command_task import CommandTask +from idmtools.entities.experiment import Experiment + +if __name__ == "__main__": + here = os.path.dirname(__file__) + + # Create a platform to run the workitem + platform = Platform("CALCULON") + + # create commandline input for the task + command = CommandLine("singularity exec ./Assets/laser.sif python3 -m idmlaser.measles") + task = CommandTask(command=command) + # Add our image + task.common_assets.add_assets(AssetCollection.from_id_file("laser.id")) + task.common_assets.add_directory('inputs_ew') + + experiment = Experiment.from_task( + task, + name=os.path.split(sys.argv[0])[1], + tags=dict(type='singularity', description='laser') + ) + experiment.run(wait_until_done=True) + if experiment.succeeded: + experiment.to_id_file("experiment.id")