Skip to content

Add SLURM_CONF to kept environment variables#52

Open
gmanthey wants to merge 1 commit into
snakemake:mainfrom
gmanthey:main
Open

Add SLURM_CONF to kept environment variables#52
gmanthey wants to merge 1 commit into
snakemake:mainfrom
gmanthey:main

Conversation

@gmanthey

@gmanthey gmanthey commented Jul 9, 2026

Copy link
Copy Markdown

Hi all,

first of all, thanks a lot for this great tool, I've been enjoying using snakemake a lot recently! I've only just now, when dealing with a different issue (#46 (comment)), updated to the latest version of this plugin, only to find out that nothing related to slurm submission works anymore. It seems that on my cluster we are using a non-default path to the slurm configuration, which is passed to slurm in the environment variable SLURM_CONF. However this variable is now being removed from the environment, causing various issues.

I've raised this first in a comment on the PR causing the issue, but have now decided to just put in a PR given how simple the fix is.

Cheers!
Georg

Summary by CodeRabbit

  • Bug Fixes
    • Preserves SLURM_CONF when launching nested job steps, helping srun inherit the expected Slurm configuration in step-based executions.

SLURM_CONF keeps a path to the main slurm configuration file in case it is not in the default path. This should always be kept in the environment as otherwise any slurm commands fail.
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 093b7003-636d-4a39-ad3d-ce7b70a5fb8f

📥 Commits

Reviewing files that changed from the base of the PR and between c09349d and f3ecb8f.

📒 Files selected for processing (1)
  • snakemake_executor_plugin_slurm_jobstep/__init__.py

📝 Walkthrough

Walkthrough

The environment-variable allowlist used to sanitize the environment for nested srun/sbatch calls in Executor.run_job was extended to include SLURM_CONF, preventing it from being stripped from popen_env during job step execution.

Changes

Environment variable allowlist update

Layer / File(s) Summary
Add SLURM_CONF to keep_slurm allowlist
snakemake_executor_plugin_slurm_jobstep/__init__.py
The keep_slurm allowlist in Executor.run_job now includes SLURM_CONF, preserving it in the sanitized environment for nested srun/sbatch calls.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: preserving SLURM_CONF in the kept environment variables.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Successfully merging this pull request may close these issues.

1 participant