Skip to content

Commit

Permalink
Fixes snakemake#2808 and snakemake#2872 by ensuring apptainer argumen…
Browse files Browse the repository at this point in the history
…ts are quoted
  • Loading branch information
Koppstein, David committed May 14, 2024
1 parent 1103b91 commit d8981c6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions snakemake/spawn_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import sys
from typing import Mapping, TypeVar, TYPE_CHECKING, Any
from snakemake_interface_executor_plugins.utils import format_cli_arg, join_cli_args
from snakemake_interface_executor_plugins.utils import format_cli_arg, format_cli_value, join_cli_args
from snakemake_interface_executor_plugins.settings import CommonSettings
from snakemake.resources import ParsedResource
from snakemake_interface_storage_plugins.registry import StoragePluginRegistry
Expand Down Expand Up @@ -248,6 +248,13 @@ def general_args(
else w2a("storage_settings.local_storage_prefix")
)

# ensure --apptainer-args are quoted
apptainer_args = w2a("deployment_settings.apptainer_args")
apptainer_args = '--apptainer-args ' + format_cli_value(
' '.join(apptainer_args.split()[1:]) if apptainer_args else "",
quote=True
)

args = [
"--force",
"--target-files-omit-workdir-adjustment",
Expand Down Expand Up @@ -275,7 +282,7 @@ def general_args(
skip=not shared_deployment,
),
w2a("deployment_settings.apptainer_prefix"),
w2a("deployment_settings.apptainer_args"),
apptainer_args,
w2a("resource_settings.max_threads"),
self.get_shared_fs_usage_arg(executor_common_settings),
w2a(
Expand Down

0 comments on commit d8981c6

Please sign in to comment.