Skip to main content

Janis assistant templates for Parkville

Project description

Janis Templates (assistant)

Janis-assistant is 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 template

You can see the parameters you will need to pass the template through the cli, for example:

janis init pawsey --help
usage: 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 request

Create your own template

Step 1 - Create the file + inherit

Create a file within the janis_templates folder along the lines of yourinstitute.py. Create a Python class that at least implements the EnvironmentTemplate declared in janis_assistant.templates.base. It's likely you'll be able to inherit from either:

  • Slurm Singularity: from janis_assistant.templates.slurm import SlurmSingularityTemplate
  • PBS Singularity: from janis_assistant.templates.pbs import PbsSingularityTemplate

For example: vim janis_templates/yourinstitute.py Contents:

from janis_assistant.templates.slurm import SlurmSingularityTemplate

class MyTemplate(SlurmSingularityTemplate):
    pass

Step 2 - Creating the file

Ensure you pass all the required properties to your super class's super().__init__. You can declare extra properties, and override the cromwell method, or the engine_config method too.

It's best to include type annotations, eg:

from listing import List
from janis_assistant.templates.slurm import SlurmSingularityTemplate

class MyTemplate(SlurmSingularityTemplate):
    def __init__(self, param1: str, param2: List[str]=None):
        super().__init__(executionDir=param1, **kwargs)
        self.param2 = param2

Step 2a - Optional step:

Add docstrings beneath the __init__ method with the following format:

from listing import List
from janis_assistant.templates.slurm import SlurmSingularityTemplate

class MyTemplate(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 = param2

Step 3 - Add an entrypoint

Add an entrypoint (best tutorial ever) in setup.py like the following:

    # other setup.py stuff
    entry_points={
        "janis.templates": [
            "yourtemplatename=janis_templates.yourinstitute:MyTemplate",
            # other templates here
        ]
    }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

janis-pipelines.templates-0.10.2.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

janis_pipelines.templates-0.10.2-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file janis-pipelines.templates-0.10.2.tar.gz.

File metadata

  • Download URL: janis-pipelines.templates-0.10.2.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.7

File hashes

Hashes for janis-pipelines.templates-0.10.2.tar.gz
Algorithm Hash digest
SHA256 65d8ad7228afd9ebee1ae95692080dcb33b3754f0f0111848249339aa51e28a5
MD5 a6edf26caa302d069b67217e53af6b15
BLAKE2b-256 b2762813029d1547b318f62e8d4b23b6f1b149eb1ee3373e5ff3c6c87907e6cd

See more details on using hashes here.

File details

Details for the file janis_pipelines.templates-0.10.2-py3-none-any.whl.

File metadata

  • Download URL: janis_pipelines.templates-0.10.2-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.7

File hashes

Hashes for janis_pipelines.templates-0.10.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2d20bc1d518ecbeb9f40a4ed7033a9deb186be95d223b9da5b7e10aad3ec1376
MD5 ffbff9a5ce22ce0817a9a0788b92902d
BLAKE2b-256 50bad2a5584c667d3d3c07fa71f05c487fa6f15946c7f31e670f3775e6193ad0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page