Singularity Build

The COMPS Platform supports building singularity images remotely through the idmtools_platform_comps.utils.singularity_build.SingularityBuildWorkItem workitem.

The workitem supports a few different scenarios for creating Singularity images

Building from Definition Files

You can build from a Singularity definition file. See Definition Document.

To build using a definition file, you need to set the definition_file parameter to the path of a definition file. You can specify inputs to be consumed in the build by adding them to the assets or transient_assets fields. It is generally best to use the assets since they take advantage of caching. Remember that the resulting path of any files added to assets will be need to be references with Assets/filename in your definition file

Building from Definition String

You can build from a definition that is in script(as a string) using the definition_content. Be sure the is_template is false.

Building from Definition Template

The SingularityBuildWorkItem can also build using jinja templates. The template should produce a singularity definition file when rendered.

To use a template, specify the template using definition_content and also by setting is_template to True. You can also use the template_args to define items to be passed to the template when rendered. In addition to those items, the current executing environment variables are accessible as env and the workitem is accessible as sbi.

For details on Jinja’s syntax see https://jinja.palletsprojects.com/