Skip to content

feat: adding reservation flag #323

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

Merged
merged 6 commits into from
Jun 12, 2025
Merged

feat: adding reservation flag #323

merged 6 commits into from
Jun 12, 2025

Conversation

cmeesters
Copy link
Member

@cmeesters cmeesters commented Jun 10, 2025

This PR adds a --reservation flag. Usually, for teaching, we recommend relying on SLURM's magnetic flag. This way, users will not need to specify a reservation. However, not all reservations can be made magnetic nor for all courses. Hence, the introduction of a new flag.

Supersedes PR #285

Summary by CodeRabbit

  • New Features

    • Added support for specifying a SLURM reservation when submitting jobs, allowing users to include a reservation string during job submission.
  • Documentation

    • Added a section explaining how to use SLURM reservations, including usage recommendations and best practices for teaching or testing scenarios.
    • Included details about the --slurm-reservation flag and noted that reservation validation and eligibility checks are not performed by the plugin.

Copy link
Contributor

coderabbitai bot commented Jun 10, 2025

Walkthrough

A new optional reservation field was added to the ExecutorSettings dataclass. The Executor.run_job method was updated to include the SLURM --reservation option in the job submission command if this field is set, enabling users to specify a SLURM reservation when submitting jobs. Documentation was added explaining usage and context for SLURM reservations within the plugin.

Changes

File(s) Change Summary
snakemake_executor_plugin_slurm/init.py Added reservation field to ExecutorSettings; updated Executor.run_job to include --reservation argument if set.
docs/further.md Added subsection explaining SLURM reservation usage in the plugin, including recommendations for teaching/testing scenarios.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Executor
    participant SLURM

    User->>Executor: Submit job (with optional reservation)
    Executor->>Executor: Check if reservation is set
    alt Reservation is set
        Executor->>SLURM: Submit job with --reservation argument
    else Reservation not set
        Executor->>SLURM: Submit job without --reservation
    end
    SLURM-->>Executor: Job submission response
    Executor-->>User: Return submission result
Loading

Suggested reviewers

  • dlaehnemann

Poem

A field for reservation, now part of the quest,
SLURM jobs can be tailored, at user’s behest.
With a hop and a dash, the command line grows,
"--reservation" appears, as the bunny well knows!
Now jobs find their place, in clusters so wide—
A rabbit’s delight, with settings supplied. 🐇✨


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
🪧 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>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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

🧹 Nitpick comments (2)
docs/further.md (2)

623-627: Refine wording for clarity and grammar.

The current sentences are a bit awkward and contain a preposition issue.
Apply this diff:

-  This scenario is mostly done when testing or teaching.
+  This is primarily used for testing or teaching scenarios.
-  It does not validate the spelling nor eligibility to this reservation
+  It does not validate the spelling or eligibility for this reservation.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~625-~625: The preposition “for” seems more likely in this position than the preposition “to”.
Context: ...t validate the spelling nor eligibility to this reservation For teaching, it is re...

(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_TO_FOR)


621-628: Include a CLI usage example.

Readers would benefit from a concrete snippet demonstrating how to pass the reservation flag. For example, add:

  ### Running in SLURM reservations

  This is primarily used for testing or teaching scenarios.
  The plugin allows specifying a flag `--reservation=<name>` to use a particular reservation.
  It does not validate the spelling or eligibility for this reservation.
  For teaching, it is recommended that you ask your administrators to set up a reservation with the SLURM `magnetic` flag.
  This will ensure that the `--reservation` flag is not necessary, e.g. if the reservation is associated with a particular course account.

+ ```console
+ $ snakemake --executor slurm --reservation my_course_reservation \
+   -j 100 --workflow-profile path/to/profile --directory /path/to/workdir
+ ```
🧰 Tools
🪛 LanguageTool

[uncategorized] ~625-~625: The preposition “for” seems more likely in this position than the preposition “to”.
Context: ...t validate the spelling nor eligibility to this reservation For teaching, it is re...

(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_TO_FOR)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b2e6cf and e2fa58b.

📒 Files selected for processing (1)
  • docs/further.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/further.md

[uncategorized] ~625-~625: The preposition “for” seems more likely in this position than the preposition “to”.
Context: ...t validate the spelling nor eligibility to this reservation For teaching, it is re...

(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_TO_FOR)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: testing

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

🧹 Nitpick comments (1)
docs/further.md (1)

621-628: Minor grammar and clarity improvement in reservation subsection
The sentence “It does not validate the spelling nor eligibility to this reservation” reads more naturally as “eligibility for this reservation.” Also, add a period to separate it from the next clause.

- It does not validate the spelling nor eligibility to this reservation
- For teaching, it is recommended that you ask your administrators to set up a reservation with the SLURM `magnetic` flag.
+ It does not validate the spelling nor eligibility for this reservation.
+ For teaching, it is recommended that you ask your administrators to set up a reservation with the SLURM `magnetic` flag.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~625-~625: The preposition “for” seems more likely in this position than the preposition “to”.
Context: ...t validate the spelling nor eligibility to this reservation For teaching, it is re...

(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_TO_FOR)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2fa58b and f5b4bf3.

📒 Files selected for processing (1)
  • docs/further.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/further.md

[uncategorized] ~625-~625: The preposition “for” seems more likely in this position than the preposition “to”.
Context: ...t validate the spelling nor eligibility to this reservation For teaching, it is re...

(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_TO_FOR)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: testing

Co-authored-by: Filipe G. Vieira <1151762+fgvieira@users.noreply.github.com>
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

♻️ Duplicate comments (1)
docs/further.md (1)

623-623: Duplicate of earlier suggestion
This description matches the feedback from fgvieira’s previous review.

🧹 Nitpick comments (2)
docs/further.md (2)

624-624: Grammar refinement
Change “nor eligibility to this reservation” to “or eligibility of this reservation” for clarity.

-It does not validate the spelling nor eligibility to this reservation.
+It does not validate the spelling or eligibility of this reservation.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~624-~624: The preposition “for” seems more likely in this position than the preposition “to”.
Context: ...t validate the spelling nor eligibility to this reservation. ### Frequently Asked...

(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_TO_FOR)


621-625: Relocate section for better context
Consider moving “Running in SLURM reservations” out of the nesting-jobs section and into the SLURM-specific resources area under Configuration for improved discoverability.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~624-~624: The preposition “for” seems more likely in this position than the preposition “to”.
Context: ...t validate the spelling nor eligibility to this reservation. ### Frequently Asked...

(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_TO_FOR)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c054ce and d9c4e34.

📒 Files selected for processing (1)
  • docs/further.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/further.md

[uncategorized] ~624-~624: The preposition “for” seems more likely in this position than the preposition “to”.
Context: ...t validate the spelling nor eligibility to this reservation. ### Frequently Asked...

(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_TO_FOR)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: testing
🔇 Additional comments (1)
docs/further.md (1)

623-623: Verify flag naming consistency
Ensure that the CLI flag named here (--slurm-reservation) aligns with the actual implementation (e.g., argument parser definition and the sbatch option).

Search the codebase for occurrences of both --slurm-reservation and --reservation to confirm the correct flag is documented.

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

🧹 Nitpick comments (1)
docs/further.md (1)

621-625: Fix heading spelling and improve clarity in documentation

The heading “Submittings” is misspelled and can be simplified for consistency. Also, rephrase the second sentence to clearly state what isn’t validated.

-### Submittings Jobs into SLURM reservations
+# Submitting Jobs into SLURM Reservations

-The plugin allows specifying a flag `--slurm-reservation=<name>` to use a particular reservation.
-It does not validate the spelling nor eligibility to this reservation.
+The plugin allows specifying a flag `--slurm-reservation=<name>` to use a particular reservation.
+It does not validate the reservation name or check user eligibility.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~624-~624: The preposition “for” seems more likely in this position than the preposition “to”.
Context: ...t validate the spelling nor eligibility to this reservation. ### Frequently Asked...

(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_TO_FOR)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9c4e34 and 8162744.

📒 Files selected for processing (1)
  • docs/further.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/further.md

[uncategorized] ~624-~624: The preposition “for” seems more likely in this position than the preposition “to”.
Context: ...t validate the spelling nor eligibility to this reservation. ### Frequently Asked...

(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_TO_FOR)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: testing

@cmeesters cmeesters merged commit d4e0a0f into main Jun 12, 2025
5 checks passed
@cmeesters cmeesters deleted the feat/reservation branch June 12, 2025 06:22
cmeesters added a commit that referenced this pull request Jun 13, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.4.0](v1.3.6...v1.4.0)
(2025-06-12)


### Features

* adding reservation flag
([#323](#323))
([d4e0a0f](d4e0a0f))


### Documentation

* review and edit new docs
([#237](#237))
([ec82a70](ec82a70))

---
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

- **New Features**
  - Introduced a reservation flag feature.

- **Documentation**
- Updated changelog with version 1.4.0 details and refined
documentation.

- **Chores**
  - Bumped application version to 1.4.0.
- Updated release announcement workflow to use latest Mastodon posting
action.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Christian Meesters <cmeesters@users.noreply.github.com>
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