Skip to content

Commit

Permalink
Merge branch 'main' into feat/requeue-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester authored Sep 3, 2024
2 parents 42b4471 + c414f65 commit 4184610
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [0.10.0](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v0.9.0...v0.10.0) (2024-08-23)


### Features

* in job stability ([#137](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/137)) ([c27f5f8](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/c27f5f8b4dcf7c2d9bc34fd4870d13ff24c0dfae))


### Bug Fixes

* add --parsable to sbatch call for a more robust output parsing ([#125](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/125)) ([5e41d05](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/5e41d0577593909f8f0f255c8de29141bfd0bbe3))
* issue [#109](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/109) - preemption is no longer considered a failed status ([#132](https://github.com/snakemake/snakemake-executor-plugin-slurm/issues/132)) ([6dad273](https://github.com/snakemake/snakemake-executor-plugin-slurm/commit/6dad273b2f09ed8f10e3c26b92e2963c382e9fb8))

## [0.9.0](https://github.com/snakemake/snakemake-executor-plugin-slurm/compare/v0.8.0...v0.9.0) (2024-08-06)


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "snakemake-executor-plugin-slurm"
version = "0.9.0"
version = "0.10.0"
description = "A Snakemake executor plugin for submitting jobs to a SLURM cluster."
authors = [
"Christian Meesters <[email protected]>",
Expand Down
5 changes: 4 additions & 1 deletion snakemake_executor_plugin_slurm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
from snakemake_interface_common.exceptions import WorkflowError
from snakemake_executor_plugin_slurm_jobstep import get_cpus_per_task

from .utils import delete_slurm_environment


@dataclass
class ExecutorSettings(ExecutorSettingsBase):
Expand Down Expand Up @@ -97,10 +99,11 @@ def warn_on_jobcontext(self, done=None):
if "SLURM_JOB_ID" in os.environ:
self.logger.warning(
"You are running snakemake in a SLURM job context. "
"This is not recommended, as it may lead to unexpected behavior."
"This is not recommended, as it may lead to unexpected behavior. "
"Please run Snakemake directly on the login node."
)
time.sleep(5)
delete_slurm_environment()
done = True

def additional_general_args(self):
Expand Down
16 changes: 16 additions & 0 deletions snakemake_executor_plugin_slurm/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# utility functions for the SLURM executor plugin

import os


def delete_slurm_environment():
"""
Function to delete all environment variables
starting with 'SLURM_'. The parent shell will
still have this environment. This is needed to
submit within a SLURM job context to avoid
conflicting environments.
"""
for var in os.environ:
if var.startswith("SLURM_"):
del os.environ[var]

0 comments on commit 4184610

Please sign in to comment.