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

feat: cancel workflow#127 #139

Closed
wants to merge 4 commits into from
Closed

feat: cancel workflow#127 #139

wants to merge 4 commits into from

Conversation

cmeesters
Copy link
Member

@cmeesters cmeesters commented Aug 27, 2024

adds the --slurm-cancel-workflow-upon-failure flag, which allows cancelling the entire workflows upon job failure, superseeds --keep-going.

Summary by CodeRabbit

  • New Features

    • Introduced a new option to cancel the entire workflow upon job failure, providing users with better control over workflow management.
    • Added information about the --keep-going flag and its interaction with the new cancellation setting.
  • Documentation

    • Enhanced documentation for job execution and error handling in Snakemake, including reorganization for clarity regarding executor behavior and runtime configuration options.

Copy link
Contributor

coderabbitai bot commented Aug 27, 2024

Walkthrough

The changes involve the reorganization of Snakemake documentation regarding executor behavior, specifically the handling of job failures. A new boolean attribute, cancel_workflow_upon_failure, has been added to the ExecutorSettings class, affecting workflow cancellation based on job success. Additionally, the documentation now includes information about the --keep-going and --slurm-cancel-workflow-upon-failure flags, enhancing user options for managing job failures.

Changes

Files Change Summary
docs/further.md Reorganized content on executor behavior; added details on job failure handling and new flags for workflow management.
snakemake_executor_plugin_slurm/init.py Introduced cancel_workflow_upon_failure attribute in ExecutorSettings class; modified job checking logic accordingly.

Possibly related PRs

Poem

In the meadow, hopping free,
Changes come, oh joy for me!
With flags to guide my little way,
I’ll dance through jobs both night and day.
If one should fail, I’ll still be spry,
For workflows now can wave goodbye! 🐇✨

Tip

New features

Walkthrough comment now includes:

  • Possibly related PRs: A list of potentially related PRs to help you recall past context.
  • Suggested labels: CodeRabbit can now suggest labels by learning from your past PRs. You can also provide custom labeling instructions in the UI or configuration file.

Notes:

  • Please share any feedback in the discussion post on our Discord.
  • Possibly related PRs, automatic label suggestions based on past PRs, learnings, and possibly related issues require data opt-in (enabled by default).

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Outside diff range, codebase verification and nitpick comments (1)
docs/further.md (1)

186-187: LGTM with a minor suggestion!

The code changes are approved. However, please consider the following suggestion to improve the sentence structure:

Remove the comma before "if" in the sentence "Snakemake will proceed to submit independent jobs, if a job fails." The sentence should be:

Snakemake will proceed to submit independent jobs if a job fails.

Tools
LanguageTool

[typographical] ~186-~186: Usually, there’s no comma before “if”.
Context: ... will proceed to submit independent jobs, if a job fails. This plugin offers an addi...

(IF_NO_COMMA)

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c414f65 and e9efc70.

Files selected for processing (2)
  • docs/further.md (2 hunks)
  • snakemake_executor_plugin_slurm/init.py (2 hunks)
Additional context used
LanguageTool
docs/further.md

[typographical] ~186-~186: Usually, there’s no comma before “if”.
Context: ... will proceed to submit independent jobs, if a job fails. This plugin offers an addi...

(IF_NO_COMMA)

Additional comments not posted (4)
docs/further.md (2)

182-183: LGTM!

The code changes are approved.


184-185: LGTM!

The code changes are approved.

snakemake_executor_plugin_slurm/__init__.py (2)

45-56: LGTM!

The new cancel_workflow_upon_failure attribute in the ExecutorSettings class looks good. It is well-documented and has a sensible default value.


391-392: LGTM!

The conditional check for the cancel_workflow_upon_failure setting in the check_active_jobs function looks good. It correctly invokes the cancel_jobs method with the list of active jobs when a job has failed and the setting is enabled.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e9efc70 and cb7ca5c.

Files selected for processing (1)
  • snakemake_executor_plugin_slurm/init.py (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • snakemake_executor_plugin_slurm/init.py

@cmeesters
Copy link
Member Author

ok, cool - this PR successfully completes all tests. Ready to merge? @johanneskoester

@johanneskoester
Copy link
Contributor

This does not really make sense as a function inside an executor. Instead, it makes sense as a flag for Snakemake itself, next to --keep-going, and can be implemented in an executor agnostic way.

@johanneskoester
Copy link
Contributor

The place to add this would be snakemake/scheduler.py in there error handling method there.

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.

2 participants