Skip to content

Commit 04319bb

Browse files
feat!: added common setting for defining whether workflow sources shall be deployed.
1 parent fc37f38 commit 04319bb

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

snakemake_interface_executor_plugins/dag.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ def incomplete_external_jobid(self, job: JobExecutorInterface) -> Optional[str]:
1717
@abstractmethod
1818
def get_sources(self) -> Iterable[str]:
1919
...
20+
21+
@abstractmethod
22+
def get_unneeded_temp_files(self, job: JobExecutorInterface) -> Iterable[str]:
23+
...

snakemake_interface_executor_plugins/executors/real.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ def get_job_args(self, job: JobExecutorInterface, **kwargs):
9797
format_cli_arg("--cores", kwargs.get("cores", self.cores)),
9898
format_cli_arg("--attempt", job.attempt),
9999
format_cli_arg("--force-use-threads", not job.is_group()),
100+
format_cli_arg("--unneeded-temp-files", self.workflow.dag.unneeded_temp_files(job)),
100101
self.get_resource_declarations(job),
101102
]
102103
)

snakemake_interface_executor_plugins/settings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class CommonSettings:
2424
Whether to the executor implies to not have a shared file system.
2525
dryrun_exec : bool
2626
Whether to jobs will be executed in dry-run mode.
27+
job_deploy_sources : bool
28+
Whether to deploy workflow sources before job execution. This is e.g.
29+
needed when remote jobs are guaranteed to be not executed on a shared
30+
filesystem. For example, this is True in the kubernetes executor plugin.
2731
touch_exec : bool
2832
Whether job outputs will be touched only.
2933
use_threads : bool
@@ -46,6 +50,7 @@ class CommonSettings:
4650

4751
non_local_exec: bool
4852
implies_no_shared_fs: bool
53+
job_deploy_sources: bool
4954
dryrun_exec: bool = False
5055
touch_exec: bool = False
5156
use_threads: bool = False

0 commit comments

Comments
 (0)