-
Notifications
You must be signed in to change notification settings - Fork 30
fix: skip account setting upon user request #224
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
Conversation
WalkthroughThis pull request updates the SLURM executor plugin by enhancing documentation and modifying job submission behavior. The documentation now explains SLURM account configuration, including cases with multiple accounts and the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Workflow
participant Executor
participant SLURM
User->>Workflow: Submit job with executor settings
Workflow->>Executor: run_job(job)
Executor->>Executor: Evaluate no_account flag
alt no_account is False
Executor->>SLURM: Append SLURM account argument (via get_account_arg)
else no_account is True
Executor->>SLURM: Submit without account argument
end
SLURM-->>Executor: Job submission response
Possibly related PRs
Suggested reviewers
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Cherry picking the commit and putting it on top of main worked for me. |
good. I will add some docs, tomorrow. |
…tor-plugin-slurm into fix/no_account
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/further.md (1)
21-22
: Typos in the new documentationThe explanation of the SLURM account configuration is helpful, but there are a couple of typos in the text:
- "attept" should be "attempt"
- "behauvior" should be "behavior"
-Some clusters, however, have a pre-defined default per user and _do not_ allow users to set their account. The plugin will attept to always set an account. To override this behauvior, the `--slurm-no-account` flag can be used. +Some clusters, however, have a pre-defined default per user and _do not_ allow users to set their account. The plugin will attempt to always set an account. To override this behavior, the `--slurm-no-account` flag can be used.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/post_to_mastodon.sh
(1 hunks)docs/further.md
(1 hunks)snakemake_executor_plugin_slurm/__init__.py
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: testing
🔇 Additional comments (3)
.github/workflows/post_to_mastodon.sh (1)
4-5
: Improved error handling by redirecting to stderrThe change properly redirects error messages to standard error (stderr) using
>&2
instead of printing them to standard output. This follows shell scripting best practices for error reporting.snakemake_executor_plugin_slurm/__init__.py (2)
88-96
: Well-defined new no_account settingThe new
no_account
field inExecutorSettings
is properly structured with appropriate defaults and clear help documentation. This addition aligns with the PR objective of allowing users to skip account settings when required.
225-227
: Clean implementation of conditional account settingThe conditional addition of the account argument based on the
no_account
setting is well implemented. This change directly addresses the PR objective by providing a way to skip account settings upon user request.
@DrYak there is now rudimentary documentation. Please review. More detailed documentation changes are upcoming. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
snakemake_executor_plugin_slurm/__init__.py (1)
644-686
: Improve exception chaining in the error handling.The account validation logic has been improved to first try
sshare
and then fall back tosacctmgr
, with appropriate warning when both return empty results. However, there's a minor issue with the exception handling.According to best practices for Python exception handling, you should use explicit exception chaining with
raise ... from e
:raise WorkflowError( f"The 'sshare' reported: '{sshare_report}' " f"and likewise 'sacctmgr' reported: '{sacctmgr_report}'." - ) + ) from eThis helps distinguish between errors in the original operation and errors in exception handling.
🧰 Tools
🪛 Ruff (0.8.2)
671-674: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
snakemake_executor_plugin_slurm/__init__.py
(3 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
snakemake_executor_plugin_slurm/__init__.py
671-674: Within an except
clause, raise exceptions with raise ... from err
or raise ... from None
to distinguish them from errors in exception handling
(B904)
🔇 Additional comments (2)
snakemake_executor_plugin_slurm/__init__.py (2)
88-96
: LGTM: Clean implementation of the no_account setting.The new boolean field follows the established pattern for boolean settings in the ExecutorSettings class, with appropriate default value and helpful documentation.
225-227
: LGTM: Core functionality implemented correctly.The conditional check for the no_account setting works as intended, allowing users to skip account settings upon request, which aligns with the PR objectives.
@DrYak now, the order of account tests with @coderabbitai please, update the PR summary accordingly. |
🧩 Analysis chainI'll need to gather more information about issue #233 and check the code changes to properly update the PR summary. 🏁 Script executed:
Length of output: 3973 @cmeesters I'll update the PR summary to include the information about the new order of account tests and how this PR also addresses issue #233. The PR now accomplishes two main things:
✅ Actions performedSummary regeneration triggered. |
- correct typos and grammar, based on languagetool.org and coderabbitai - mention partitions as another thing that can be blocked by local cluster settings (e.g.: on ETH Zürich's Euler)
Updated doc, looks nice to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@DrYak merci! |
🤖 I have created a release *beep* *boop* --- ## [1.0.1](v1.0.0...v1.0.1) (2025-03-13) ### Bug Fixes * skip account setting upon user request ([#224](#224)) ([08a867a](08a867a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved account setup flow, allowing users to opt-out of configuring account settings. - **Chores** - Updated the project version to 1.0.1, with a corresponding release note entry. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit