Skip to content

Conversation

@jan-janssen
Copy link
Member

@jan-janssen jan-janssen commented Jul 12, 2025

Summary by CodeRabbit

  • New Features
    • Added a new option to enable debug reporting of communicated object sizes in cluster executor classes.
  • Bug Fixes
    • Improved validation for file existence and debug option compatibility.
  • Tests
    • Added tests to ensure proper error handling when enabling unsupported debug options.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 12, 2025

Walkthrough

A new boolean parameter, log_obj_size, was added to the constructors of both FluxClusterExecutor and SlurmClusterExecutor. This parameter is validated using a new check_log_obj_size function, which raises an error if enabled. The input validation module and its tests were updated accordingly.

Changes

File(s) Change Summary
executorlib/executor/flux.py, executorlib/executor/slurm.py Added log_obj_size parameter to class constructors, updated docstrings, and called validation.
executorlib/standalone/inputcheck.py Added check_file_exists and check_log_obj_size validation functions.
tests/test_standalone_inputcheck.py Added a test for check_log_obj_size raising ValueError when set to True.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Executor (Flux/Slurm)
    participant InputCheck

    User->>Executor: Instantiate with log_obj_size
    Executor->>InputCheck: check_log_obj_size(log_obj_size)
    InputCheck-->>Executor: Raise ValueError if log_obj_size is True
    Executor-->>User: Instance created or error raised
Loading

Possibly related PRs

  • [Feature] Log Communication overhead #671: Adds a log_obj_size parameter to the FluxClusterExecutor constructor and propagates it through executor creation, directly modifying the same class and parameter handling.

Poem

In the code where clusters hum and whirr,
A new flag appears—what might occur?
If object sizes you wish to see,
The check will halt you, quite strictly!
With tests in place, our code’s robust—
The rabbit hops on, in logic we trust. 🐇

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

CodeRabbit Configuration 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.

@codecov
Copy link

codecov bot commented Jul 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.90%. Comparing base (4458c86) to head (144b16e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #716      +/-   ##
==========================================
+ Coverage   96.89%   96.90%   +0.01%     
==========================================
  Files          29       29              
  Lines        1320     1325       +5     
==========================================
+ Hits         1279     1284       +5     
  Misses         41       41              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 comments (2)
executorlib/executor/flux.py (1)

105-105: Add log_obj_size validation to FluxJobExecutor

The FluxClusterExecutor calls check_log_obj_size(log_obj_size=…) in its __init__ (around line 345), but FluxJobExecutor never performs that check. To keep behavior consistent, invoke the validator as the first statement in FluxJobExecutor.__init__.

• File: executorlib/executor/flux.py
Method: FluxJobExecutor.__init__
Location: immediately after the signature

Proposed diff:

@@ executorlib/executor/flux.py
     class FluxJobExecutor(BaseExecutor):
         def __init__( 
             …,
             plot_dependency_graph_filename: Optional[str] = None,
             log_obj_size: bool = False,
         ):
+            check_log_obj_size(log_obj_size=log_obj_size)
             super().__init__(…)
             …

Since check_log_obj_size is already imported at the top of this file, no additional imports are needed. This ensures log_obj_size=True is properly validated at instantiation.

executorlib/executor/slurm.py (1)

282-282: Add missing validation to SlurmJobExecutor.

The SlurmJobExecutor class has the log_obj_size parameter but doesn't call check_log_obj_size for validation, unlike SlurmClusterExecutor. This creates inconsistency where some executors validate the parameter while others don't.

Add the validation call in SlurmJobExecutor.__init__:

        resource_dict.update(
            {k: v for k, v in default_resource_dict.items() if k not in resource_dict}
        )
+        check_log_obj_size(log_obj_size=log_obj_size)
        if not disable_dependencies:
🧹 Nitpick comments (2)
executorlib/standalone/inputcheck.py (2)

196-204: Fix type hint inconsistency.

The function accepts Optional[str] but immediately checks for None and raises an error. The type hint should be str instead of Optional[str] to accurately reflect that None values are not accepted.

-def check_file_exists(file_name: Optional[str]):
+def check_file_exists(file_name: str):

212-213: Fix missing space in error message.

There's a missing space between the period and "Please" in the error message.

-            "log_obj_size is not supported for the executorlib.SlurmClusterExecutor and executorlib.FluxClusterExecutor."
-            "Please use log_obj_size=False instead of log_obj_size=True."
+            "log_obj_size is not supported for the executorlib.SlurmClusterExecutor and executorlib.FluxClusterExecutor. "
+            "Please use log_obj_size=False instead of log_obj_size=True."
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4458c86 and 144b16e.

📒 Files selected for processing (4)
  • executorlib/executor/flux.py (5 hunks)
  • executorlib/executor/slurm.py (5 hunks)
  • executorlib/standalone/inputcheck.py (1 hunks)
  • tests/test_standalone_inputcheck.py (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
tests/test_standalone_inputcheck.py (1)
executorlib/standalone/inputcheck.py (1)
  • check_log_obj_size (206-214)
executorlib/executor/flux.py (1)
executorlib/standalone/inputcheck.py (1)
  • check_log_obj_size (206-214)
executorlib/executor/slurm.py (1)
executorlib/standalone/inputcheck.py (1)
  • check_log_obj_size (206-214)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
  • GitHub Check: unittest_openmpi (macos-latest, 3.13)
  • GitHub Check: unittest_openmpi (ubuntu-latest, 3.11)
  • GitHub Check: unittest_openmpi (ubuntu-latest, 3.12)
  • GitHub Check: unittest_flux_openmpi
  • GitHub Check: unittest_openmpi (ubuntu-latest, 3.13)
  • GitHub Check: unittest_flux_mpich
  • GitHub Check: unittest_mpich (ubuntu-latest, 3.11)
  • GitHub Check: unittest_win
  • GitHub Check: unittest_mpich (macos-latest, 3.13)
  • GitHub Check: unittest_mpich (ubuntu-latest, 3.12)
  • GitHub Check: unittest_mpich (ubuntu-latest, 3.13)
  • GitHub Check: notebooks_integration
  • GitHub Check: notebooks
  • GitHub Check: benchmark (ubuntu-latest, 3.13, .ci_support/environment-openmpi.yml)
  • GitHub Check: benchmark (ubuntu-latest, 3.13, .ci_support/environment-mpich.yml)
  • GitHub Check: minimal
🔇 Additional comments (4)
tests/test_standalone_inputcheck.py (1)

124-126: LGTM! Test implementation is correct.

The test properly verifies that check_log_obj_size raises a ValueError when log_obj_size=True, following the same pattern as other validation tests in the file.

executorlib/executor/flux.py (2)

105-105: LGTM! Parameter addition is correct.

The log_obj_size parameter is properly added with appropriate type hint and default value.


345-345: LGTM! Validation is properly implemented.

The validation call correctly uses the check_log_obj_size function to enforce that this feature is currently disabled for the FluxClusterExecutor.

executorlib/executor/slurm.py (1)

157-157: LGTM! Validation is properly implemented for SlurmClusterExecutor.

The validation call correctly enforces that the log_obj_size feature is disabled for SlurmClusterExecutor.

@jan-janssen jan-janssen merged commit bd45608 into main Jul 12, 2025
112 of 122 checks passed
@jan-janssen jan-janssen deleted the log_obj_size branch July 12, 2025 14:06
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