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

Define dependencies in submission script #299

Merged
merged 5 commits into from
May 23, 2024
Merged

Define dependencies in submission script #299

merged 5 commits into from
May 23, 2024

Conversation

jan-janssen
Copy link
Member

@jan-janssen jan-janssen commented May 17, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced job submission functionality to support job dependencies.
  • Bug Fixes

    • Improved handling of job dependency lists in submission templates.
  • Tests

    • Updated test scripts to validate job dependency settings in flux and slurm.

These updates improve the accuracy and efficiency of job scheduling by enabling users to define dependencies between jobs.

@jan-janssen jan-janssen requested a review from niklassiemer May 17, 2024 20:19
Copy link

coderabbitai bot commented May 17, 2024

Warning

Rate Limit Exceeded

@jan-janssen has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 56 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 1611cab and 90941d4.

Walkthrough

The recent changes enhance the job submission functionality in pysqa by introducing dependency handling. The submit_job function now includes a dependency_list parameter, and related utility functions have been updated accordingly. Additionally, shell scripts for flux and slurm have been modified to handle job dependencies, ensuring that jobs are executed in the correct order based on specified dependencies.

Changes

File(s) Change Summary
pysqa/ext/modular.py Updated submit_job to include dependency_list and modified _list_command_to_be_executed signature.
pysqa/utils/basic.py Added dependency_list parameter to several functions and adjusted _list_command_to_be_executed.
tests/config/flux/flux.sh Added a conditional block to set job dependencies using the flux command.
tests/config/slurm/slurm.sh Included conditional #SBATCH --dependency=afterok line based on the dependency variable.

In the world of code, dependencies align,
Jobs wait their turn, in a sequence so fine.
Scripts now whisper to flux and slurm,
"Patience, dear jobs, it's not yet your turn."
With harmony in code, the system's at ease,
Thanks to these changes, jobs flow like the breeze. 🌬️


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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

@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: 2

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 52f60c4 and 981bece.
Files selected for processing (4)
  • pysqa/ext/modular.py (1 hunks)
  • pysqa/utils/basic.py (8 hunks)
  • tests/config/flux/flux.sh (1 hunks)
  • tests/config/slurm/slurm.sh (1 hunks)
Additional Context Used
ShellCheck (40)
tests/config/flux/flux.sh (20)

[error] 7-7: You need a space after the '{'.


[warning] 7-7: This } is literal. Check expression (missing ;/\n?) or quote it.


[error] 9-9: You need a space after the '{'.


[warning] 9-9: This } is literal. Check expression (missing ;/\n?) or quote it.


[error] 10-10: You need a space after the '{'.


[warning] 10-10: This } is literal. Check expression (missing ;/\n?) or quote it.


[error] 11-11: You need a space after the '{'.


[warning] 11-11: This } is literal. Check expression (missing ;/\n?) or quote it.


[error] 13-13: You need a space after the '{'.


[warning] 13-13: This } is literal. Check expression (missing ;/\n?) or quote it.


[error] 14-14: You need a space after the '{'.


[warning] 14-14: This } is literal. Check expression (missing ;/\n?) or quote it.


[info] 16-16: The mentioned syntax error was in this brace group.


[error] 16-16: You need a space after the '{'.


[error] 16-16: Couldn't parse this brace group. Fix to allow more checks.


[error] 16-16: You need a space after the '{'.


[warning] 16-16: This } is literal. Check expression (missing ;/\n?) or quote it.


[warning] 16-16: This } is literal. Check expression (missing ;/\n?) or quote it.


[error] 16-16: Expected a '}'. If you have one, try a ; or \n in front of it.


[error] 16-16: Missing '}'. Fix any mentioned problems and try again.

tests/config/slurm/slurm.sh (20)

[error] 7-7: You need a space after the '{'.


[warning] 7-7: This } is literal. Check expression (missing ;/\n?) or quote it.


[error] 9-9: You need a space after the '{'.


[warning] 9-9: This } is literal. Check expression (missing ;/\n?) or quote it.


[error] 10-10: You need a space after the '{'.


[warning] 10-10: This } is literal. Check expression (missing ;/\n?) or quote it.


[error] 12-12: You need a space after the '{'.


[warning] 12-12: This } is literal. Check expression (missing ;/\n?) or quote it.


[error] 13-13: You need a space after the '{'.


[warning] 13-13: This } is literal. Check expression (missing ;/\n?) or quote it.


[error] 15-15: You need a space after the '{'.


[warning] 15-15: This } is literal. Check expression (missing ;/\n?) or quote it.


[info] 18-18: The mentioned syntax error was in this brace group.


[error] 18-18: You need a space after the '{'.


[error] 18-18: Couldn't parse this brace group. Fix to allow more checks.


[error] 18-18: You need a space after the '{'.


[warning] 18-18: This } is literal. Check expression (missing ;/\n?) or quote it.


[warning] 18-18: This } is literal. Check expression (missing ;/\n?) or quote it.


[error] 19-19: Expected a '}'. If you have one, try a ; or \n in front of it.


[error] 19-19: Missing '}'. Fix any mentioned problems and try again.

Additional comments not posted (2)
pysqa/ext/modular.py (1)

66-73: The addition of the dependency_list parameter is correctly implemented.

pysqa/utils/basic.py (1)

Line range hint 351-442: The addition of the dependency_list parameter is correctly implemented across multiple methods.

tests/config/flux/flux.sh Show resolved Hide resolved
tests/config/slurm/slurm.sh Show resolved Hide resolved
Copy link

@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 UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 981bece and 1611cab.
Files selected for processing (6)
  • tests/test_gent.py (1 hunks)
  • tests/test_lsf.py (1 hunks)
  • tests/test_moab.py (1 hunks)
  • tests/test_sge.py (1 hunks)
  • tests/test_slurm.py (1 hunks)
  • tests/test_torque.py (1 hunks)
Additional Context Used
Ruff (1)
tests/test_sge.py (1)

11-11: defusedxml.ElementTree imported but unused; consider using importlib.util.find_spec to test for availability

Additional comments not posted (11)
tests/test_moab.py (2)

45-45: LGTM! Good addition of robustness test for incorrect arguments.


52-52: LGTM! Properly tests the command formation for Moab.

tests/test_lsf.py (2)

56-56: LGTM! Properly tests the command formation for LSF.


61-61: LGTM! Good addition of robustness test for incorrect arguments in LSF.

tests/test_torque.py (2)

44-44: LGTM! Properly tests the command formation for Torque.


49-49: LGTM! Good addition of robustness test for incorrect arguments in Torque.

tests/test_sge.py (2)

113-113: LGTM! Properly tests the command formation for SGE.


118-118: LGTM! Good addition of robustness test for incorrect arguments in SGE.

tests/test_gent.py (2)

59-59: LGTM! Properly tests the command formation for Gent.


64-64: LGTM! Good addition of robustness test for incorrect arguments in Gent.

tests/test_slurm.py (1)

74-74: LGTM! Properly tests the command formation for Slurm.

@jan-janssen jan-janssen merged commit b79b4e0 into main May 23, 2024
17 of 18 checks passed
@jan-janssen jan-janssen deleted the dependencies branch May 23, 2024 16:39
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