Package: janis-pipelines.templates
Janis Templates (assistant)Janis-assistantis a component of Janis used to run workflows across various execution environments. This repository contains a number of preconfigured "templates" that you can use to run your workflow.A (non-exhaustive) list of examples:Peter MacCallum Cancer Centre (pmac)University of Melbourne (spartan)Walter and Eliza Hall Institute of Medical Research (wehi)Pawsey Supercomputing Centre (pawsey)These templates are provided with no warranty of guarantee.Using a templateYou can see the parameters you will need to pass the template through the cli, for example:janisinitpawsey--helpusage: janis init pawsey [-h] --executionDir EXECUTIONDIR --containerDir
                         CONTAINERDIR [--queues QUEUES]
                         [--singularityVersion SINGULARITYVERSION]
                         [--catchSlurmErrors] [--sendSlurmEmails]
                         [--singularityBuildInstructions SINGULARITYBUILDINSTRUCTIONS]
                         [--max_cores MAX_CORES] [--max_ram MAX_RAM]

optional arguments:
  -h, --help            show this help message and exit

required arguments:
  --executionDir EXECUTIONDIR
  --containerDir CONTAINERDIR
                        Location where to save and execute containers from

optional arguments:
  --queues QUEUES       A single or list of queues that woork should be
                        submitted to
  --singularityVersion SINGULARITYVERSION
                        Version of singularity to load
  --catchSlurmErrors    Catch Slurm errors (like OOM or walltime)
  --sendSlurmEmails     (requires JanisConfiguration.notifications.email to be
                        set) Send emails for mail types END
  --singularityBuildInstructions SINGULARITYBUILDINSTRUCTIONS
                        Instructions for building singularity, it's
                        recommended to not touch this setting.
  --max_cores MAX_CORES
                        Maximum number of cores a task can request
  --max_ram MAX_RAM     Maximum amount of ram (GB) that a task can requestCreate your own templateStep 1 - Create the file + inheritCreate a file within thejanis_templatesfolder along the lines ofyourinstitute.py. Create a Python class that at least implements theEnvironmentTemplatedeclared injanis_assistant.templates.base. It's likely you'll be able to inherit from either:Slurm Singularity:from janis_assistant.templates.slurm import SlurmSingularityTemplatePBS Singularity:from janis_assistant.templates.pbs import PbsSingularityTemplateFor example:vim janis_templates/yourinstitute.pyContents:fromjanis_assistant.templates.slurmimportSlurmSingularityTemplateclassMyTemplate(SlurmSingularityTemplate):passStep 2 - Creating the fileEnsure you pass all the required properties to your super class'ssuper().__init__. You can declare extra properties, and override thecromwellmethod, or theengine_configmethod too.It's best to include type annotations, eg:fromlistingimportListfromjanis_assistant.templates.slurmimportSlurmSingularityTemplateclassMyTemplate(SlurmSingularityTemplate):def__init__(self,param1:str,param2:List[str]=None):super().__init__(executionDir=param1,**kwargs)self.param2=param2Step 2a - Optional step:Add docstrings beneath the__init__method with the following format:fromlistingimportListfromjanis_assistant.templates.slurmimportSlurmSingularityTemplateclassMyTemplate(SlurmSingularityTemplate):def__init__(self,param1:str,param2:List[str]=None):""":param param1: docstring for param1:param param2: docstring for param2"""super().__init__(executionDir=param1,**kwargs)self.param2=param2Step 3 - Add an entrypointAdd an entrypoint (best tutorial ever) insetup.pylike the following:# other setup.py stuffentry_points={"janis.templates":["yourtemplatename=janis_templates.yourinstitute:MyTemplate",# other templates here]}