Skip to main content

This package provides a stable interface for interactions between Snakemake and its executor plugins.

Project description

Stable interfaces and functionality for Snakemake executor plugins

This package provides a stable interface for interactions between Snakemake and its executor plugins (WIP).

Plugins should implement the following skeleton to comply with this interface:

from snakemake_interface_executor_plugins.executors.remote import RemoteExecutor
from snakemake_interface_executor_plugins import ExecutorSettingsBase, CommonSettings

# Optional:
# define additional settings for your executor
# They will occur in the Snakemake CLI as --<executor-name>-<param-name>
# Omit this class if you don't need any.
@dataclass
class ExecutorSettings:
    myparam: int=field(default=None, metadata={"help": "Some help text"})


# Required:
# Specify common settings shared by various executors.
common_settings = CommonSettings(
    # define whether your executor plugin executes locally
    # or remotely. In virtually all cases, it will be remote execution
    # (cluster, cloud, etc.). Only Snakemake's standard execution 
    # plugins (snakemake-executor-plugin-dryrun, snakemake-executor-plugin-local)
    # are expected to specify False here.
    non_local_exec=True
)


# Required:
# Implementation of your executor
class Executor(RemoteExecutor)
    def __init__(
        self,
        workflow: WorkflowExecutorInterface,
        dag: DAGExecutorInterface,
        logger: LoggerExecutorInterface,

    ):
        super().__init__(
            workflow,
            dag,
            logger,
            executor_settings,
            # configure behavior of RemoteExecutor below
            pass_default_remote_provider_args=True,  # whether arguments for setting the remote provider shall  be passed to jobs
            pass_default_resources_args=True,  # whether arguments for setting default resources shall be passed to jobs
            pass_envvar_declarations_to_cmd=True,  # whether environment variables shall be passed to jobs
        )
        # access executor specific settings 
        self.executor_settings
        # access workflow
        self.workflow

        # IMPORTANT: in your plugin, only access methods and properties of Snakemake objects (like Workflow, Persistence, etc.)
        # that are defined in the interfaces found in THIS package. Other parts of those objects
        # are NOT guaranteed to remain the same across new releases.

        # To ensure that the used interfaces are not changing, you should depend on this package as
        # >=a.b.c,<d with d=a+1 (i.e. pin the dependency on this package to be at least the version at time of development
        # and less than the next major version which would introduce breaking changes).

    async def _wait_for_jobs(self):
        # implement here a loop that checks which jobs are already finished
        

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

snakemake_interface_executor_plugins-2.0.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file snakemake_interface_executor_plugins-2.0.0.tar.gz.

File metadata

File hashes

Hashes for snakemake_interface_executor_plugins-2.0.0.tar.gz
Algorithm Hash digest
SHA256 a3ef56fe4383362100851df9803a38710de1403fabad1471f2bc6136402e3c26
MD5 5e53da65f5b7392afd7b1316af240740
BLAKE2b-256 5281955dcc23888251a5cee7aa01eb0e59136a90150a5f712b52903645f34401

See more details on using hashes here.

File details

Details for the file snakemake_interface_executor_plugins-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for snakemake_interface_executor_plugins-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ad1d6b9cc60313fea9baf2ceecc8c83dadc4c3d33db56282658c8480a8d8729
MD5 fbdabc24c14b53fd4dd46b0b242838c3
BLAKE2b-256 8afc489b2c3b1062a1dc8cb7a87db589002684d0a3be26d942d172ce29056468

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