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

fix: mount TMP directories for Singularity #78

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions zarp/snakemake/run.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""Module for executing Snakemake workflows."""

import os
import logging
from pathlib import Path
import subprocess
from typing import List, Optional
from typing import List, Optional, Union

from zarp.config.enums import SnakemakeRunState
from zarp.config.models import ConfigRun
Expand Down Expand Up @@ -48,14 +49,19 @@ def compile_command(self, snakefile: Path) -> List[str]:
Args:
snakefile: Path to Snakemake descriptor file.
"""
bind_paths: List[str] = [
str(self.exec_dir),
str(self.run_config.working_directory),
str(self.run_config.zarp_directory),
bind_paths: List[Optional[Union[Path, str]]] = [
self.exec_dir,
self.run_config.working_directory,
self.run_config.zarp_directory,
os.environ.get("TMP"),
os.environ.get("TMPDIR"),
]
bind_paths_str: List[str] = [
str(item) for item in bind_paths if item is not None
]
if self.bind_paths is not None:
bind_paths.extend([str(path) for path in self.bind_paths])
bind_paths_arg: str = ",".join(bind_paths)
bind_paths_str.extend([str(path) for path in self.bind_paths])
bind_paths_arg: str = ",".join(bind_paths_str)
cmd_ls = ["snakemake"]
cmd_ls.extend(["--snakefile", str(snakefile)])
cmd_ls.extend(["--cores", str(self.run_config.cores)])
Expand Down
Loading