fix: Circumvent problematic Slurm retry behaviour#470
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe SLURM executor is enhanced to propagate the Snakemake job attempt number into nested jobstep environments. An internal ChangesAttempt Number Propagation
🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@snakemake_executor_plugin_slurm/__init__.py`:
- Around line 1125-1126: The array submission path fails to export the per-job
retry attempt into the nested execution command; update the run_array_jobs logic
so that when constructing the nested command (the exec_job string) it
prepends/export the SNAKEMAKE_ATTEMPT environment variable the same way run_job
does (use job.attempt to build "export SNAKEMAKE_ATTEMPT={job.attempt};
{exec_job}"). Locate run_array_jobs and the place where exec_job is assembled
and add the export prefix so each array-task inherits the attempt value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 62424efe-aca5-4ea5-aa79-380e7c660a28
📒 Files selected for processing (1)
snakemake_executor_plugin_slurm/__init__.py
|
Thank you for your contribution! I will need some time to test, as I am busy these days. But I will try to do a preliminary review understanding, that proper tests will fail until the jobstep executor PR is merged, too. |
cmeesters
left a comment
There was a problem hiding this comment.
It would be nice to have a test added to the test suite. But I understand, if this is a bit challenging. Without, however, a release (considering the upcoming holidays) might take a bit longer.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@snakemake_executor_plugin_slurm/__init__.py`:
- Around line 1055-1057: Tests in tests/test_attempt_sync.py expect
_inherited_attempt to be None, but the implementation resets
self.workflow.executor_settings._inherited_attempt to 0; update the tests to
match the implementation by replacing assignments of None with 0 and change
assertions that check "is None" to assert equality/identity with 0 (i.e., assert
_inherited_attempt == 0 or assert _inherited_attempt is 0) so the cleanup
behavior and test expectations are consistent with the _inherited_attempt
default value used in the code.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f760ed6e-0505-4f70-8cae-942e51337eb5
📒 Files selected for processing (2)
snakemake_executor_plugin_slurm/__init__.pytests/test_attempt_sync.py
| class ExecutorSettings(ExecutorSettingsBase): | ||
| """Settings for the SLURM executor plugin.""" | ||
|
|
||
| _inherited_attempt: int = field( |
There was a problem hiding this comment.
I'm afraid, this will translate --slurm--inherited-attempt. The leading underscore does not hide an option.
I want to have hidden options, only for internal use, myself.
Tested to fix #348 combined with another PR for jobstep plugin. This code was generated with help from AI.
Summary by CodeRabbit