Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snakemake 8.9.0 on a singularity slurm cluster combination error #2808

Open
tinu-t opened this issue Apr 13, 2024 · 5 comments
Open

Snakemake 8.9.0 on a singularity slurm cluster combination error #2808

tinu-t opened this issue Apr 13, 2024 · 5 comments

Comments

@tinu-t
Copy link

tinu-t commented Apr 13, 2024

I am trying to run snakemake 8.9.0 using singularity on a slurm cluster,
Constantly getting this error, not sure what is wrong with the syntax

Command:

snakemake --cores 3 --configfile config.yaml --executor cluster-generic --cluster-generic-submit-cmd 'sbatch -t {params.res_time} --cpus-per-task {threads} --mem-per-cpu {params.res_mem} -o {params.lsf_log}' -j 20 -k -p --notemp --latency-wait 24 --rerun-incomplete --use-singularity --singularity-args '--bind /cluster/snakemake
-path'

Error:
__main__.py: error: argument --apptainer-args/--singularity-args: expected one argument

@tinu-t
Copy link
Author

tinu-t commented Apr 16, 2024

The apptainer parameters had to be written in a YAML file and given as argument to the -profile argument like shown below:

snakemake --cores 3 --configfile config.yaml --executor cluster-generic --cluster-generic-submit-cmd 'sbatch -t {params.res_time} --cpus-per-task {threads} --mem-per-cpu {params.res_mem} -o {params.lsf_log}' -j 20 -k -p --notemp --latency-wait 24 --rerun-incomplete --profile ./profile/apptainer

cat ./profile/apptainer/config.v8+.yaml

use-singularity: True
singularity-args: "\"--bind /cluster/snakemake/\""

This worked for me

@amadeovezz
Copy link

amadeovezz commented Apr 17, 2024

I am also running into this error while trying to use --singularity-args with slurm:

__main__.py: error: argument --apptainer-args/--singularity-args: expected one argument

The above solution did not work and I've also tried passing it through the command line:
--use-singularity --singularity-args "--bind /some/path"

I'm not sure if this is an issue with the snakemake-executor-plugin-slurm or with snakemake itself. I noticed this regression after I upgraded from 8.4.2.

Additional details:

Config

executor: slurm

# Slurm specific
default-resources:
  slurm_account: "some_account"
  slurm_partition: "some_partition,common"
  runtime: 60 
  mem_mb: 4000
  nodes: 1
 # Non-standard resource specifications
  slurm_extra: "'--exclude=some_node'"

jobs: 1 
printshellcmds: True
restart-times: 0 

use-singularity: True
singularity-args: "--bind some/path"

Minimal snakefile

rule all:
    output:
        "test_output.txt"
    singularity:
        "/path/to/v4/RSingleCell.sif" 
    shell:
        "ls /mnt > {output}"

Command

snakemake --profile ./profiles/generic/

My current versions:

snakemake                 8.10.7
snakemake-executor-plugin-slurm 0.4.4             
snakemake-executor-plugin-slurm-jobstep 0.2.1              
snakemake-interface-common 1.17.2             
snakemake-interface-executor-plugins 9.1.1             
snakemake-interface-report-plugins 1.0.0             
snakemake-interface-storage-plugins 3.2.0             

Any help is appreciated 🙏

@weber8thomas
Copy link
Contributor

Same issue using that command on snakemake 8.10.7:

snakemake  --sdm conda apptainer --conda-frontend mamba --forceall -j1 --executor slurm --set-resources preprocess_data:constraint="rome" --apptainer-args "--bind /g:/g"

@mhjiang97
Copy link

Same issue to me using snakemake version 8.10.7 and --executor cluster-generic

@KatharinaHoff
Copy link

KatharinaHoff commented Apr 27, 2024

Same issue with snakemake version 8.11.0 and --executor slurm. However, the solution suggested by @tinu-t worked for me. It would still be great if this could be fixed because it's a bummer when sharing workflows with other users who need different bindings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants