Skip to content

feat(clp-package): Add option for specifying archive compression level and update max compression level to 19.#774

Merged
kirkrodrigues merged 5 commits into
y-scope:mainfrom
Eden-D-Zhang:config-compression-level
Mar 18, 2025
Merged

feat(clp-package): Add option for specifying archive compression level and update max compression level to 19.#774
kirkrodrigues merged 5 commits into
y-scope:mainfrom
Eden-D-Zhang:config-compression-level

Conversation

@Eden-D-Zhang

@Eden-D-Zhang Eden-D-Zhang commented Mar 17, 2025

Copy link
Copy Markdown
Contributor

Description

This PR adds the compression_level option to archive_output in clp-config.yml. Compression level can be set to an integer value from 1 (lowest compression ratio, highest speed) to 19 (highest compression ratio, lowest speed).

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • Compressed logs at different levels on both clp and clp-s.
  • Verified compression ratio and speed change according to selected level.

Summary by CodeRabbit

  • New Features
    • A new compression-level setting has been introduced, allowing users to control archive compression with values ranging from 1 (fast/low compression) to 19 (slow/high compression), with a default of 3.
    • Job orchestration commands now support specifying the compression level, enabling greater flexibility in processing.
    • Configuration documentation has been enhanced to outline the new compression level option and its value range.

@Eden-D-Zhang Eden-D-Zhang requested a review from a team as a code owner March 17, 2025 20:08
@coderabbitai

coderabbitai Bot commented Mar 17, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request adds support for a configurable compression level across multiple components. The ArchiveOutput class now includes a new compression_level attribute with a default value of 3 and an accompanying validator to ensure its value is within 1 to 19. Additionally, the OutputConfig class in the job orchestration module has been updated to include a similar attribute. Command generation functions now accept a new --compression-level argument, and the YAML configuration file has been updated to provide this setting with an appropriate descriptive comment.

Changes

File(s) Change Summary
components/clp-py-utils/clp_py_utils/clp_config.py
components/job-orchestration/job_orchestration/scheduler/job_config.py
components/package-template/src/etc/clp-config.yml
Added new compression_level attribute (default: 3) to ArchiveOutput (with validate_compression_level) and OutputConfig, and introduced a corresponding setting in the YAML configuration file.
components/job-orchestration/job_orchestration/executor/compress/compression_task.py Added new --compression-level command-line argument to functions that generate commands for CLP and CLP-S compression jobs.
components/core/src/clp/clp/CommandLineArguments.cpp
components/core/src/clp_s/CommandLineArguments.cpp
components/core/src/glt/glt/CommandLineArguments.cpp
Updated command-line argument descriptions to reflect the new compression level range (1 to 19) instead of the previous range (1 to 9).

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant YAML as clp-config.yml
    participant JobConfig as Job Config Loader
    participant AO as ArchiveOutput
    participant CT as CompressionTask

    User->>YAML: Request configuration (compression_level)
    YAML-->>JobConfig: Provide compression_level (default: 3)
    JobConfig->>AO: Initialize ArchiveOutput with compression_level
    AO->>AO: Validate compression_level (1-19)
    JobConfig->>CT: Pass compression_level to command generator
    CT->>CT: Include --compression-level argument in CLI command
Loading

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • 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 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 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 generate docstrings to generate docstrings for 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
components/job-orchestration/job_orchestration/scheduler/job_config.py (2)

47-47: Consider adding a validator for the compression_level attribute

The new compression_level attribute should have constraints to ensure it's within the valid range of 1 to 9, similar to the validator implemented in the ArchiveOutput class. This would provide consistent validation across the codebase.

+    @validator("compression_level")
+    def validate_compression_level(cls, field):
+        if field < 1 or field > 9:
+            raise ValueError("compression_level must be a value from 1 to 9")
+        return field

47-47: Consider adding a default value to the compression_level attribute

To maintain consistency with the ArchiveOutput class which uses a default of 3, consider adding the same default value here.

-    compression_level: int
+    compression_level: int = 3
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9fc5949 and c57ac08.

📒 Files selected for processing (4)
  • components/clp-py-utils/clp_py_utils/clp_config.py (2 hunks)
  • components/job-orchestration/job_orchestration/executor/compress/compression_task.py (2 hunks)
  • components/job-orchestration/job_orchestration/scheduler/job_config.py (1 hunks)
  • components/package-template/src/etc/clp-config.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
components/package-template/src/etc/clp-config.yml

[error] 86-86: trailing spaces

(trailing-spaces)

🪛 GitHub Check: lint-check (ubuntu-latest)
components/package-template/src/etc/clp-config.yml

[failure] 86-86:
86:2 [trailing-spaces] trailing spaces

🪛 GitHub Actions: clp-lint
components/package-template/src/etc/clp-config.yml

[warning] 86-86: Trailing spaces found in the file.

🔇 Additional comments (5)
components/package-template/src/etc/clp-config.yml (1)

87-88: The compression level configuration looks good

The comment clearly describes the valid range and purpose of the compression level setting, and the default value of 3 provides a good balance between compression ratio and speed.

components/job-orchestration/job_orchestration/executor/compress/compression_task.py (2)

143-143: The compression level parameter is properly added to the clp command

The option to specify compression level has been correctly added to the command generation for the clp utility.


184-184: The compression level parameter is properly added to the clp-s command

The option to specify compression level has been correctly added to the command generation for the clp-s utility.

components/clp-py-utils/clp_py_utils/clp_config.py (2)

446-446: Default compression level looks good

Setting the default compression level to 3 provides a good balance between compression ratio and speed, matching the YAML configuration.


472-476: Validator for compression level is properly implemented

The validator correctly ensures that the compression level is within the valid range (1-9) as described in the requirements.

Comment thread components/package-template/src/etc/clp-config.yml Outdated

@kirkrodrigues kirkrodrigues left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. One minor request.

Comment thread components/clp-py-utils/clp_py_utils/clp_config.py Outdated
Comment thread components/clp-py-utils/clp_py_utils/clp_config.py Outdated
Eden-D-Zhang and others added 2 commits March 18, 2025 11:36
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 77bb6fe and 2d1ada3.

📒 Files selected for processing (5)
  • components/clp-py-utils/clp_py_utils/clp_config.py (2 hunks)
  • components/core/src/clp/clp/CommandLineArguments.cpp (1 hunks)
  • components/core/src/clp_s/CommandLineArguments.cpp (1 hunks)
  • components/core/src/glt/glt/CommandLineArguments.cpp (1 hunks)
  • components/package-template/src/etc/clp-config.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/package-template/src/etc/clp-config.yml
  • components/clp-py-utils/clp_py_utils/clp_config.py
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}`: - Prefer `false == ` rather than `!`.

**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}: - Prefer false == <expression> rather than !<expression>.

  • components/core/src/clp/clp/CommandLineArguments.cpp
  • components/core/src/glt/glt/CommandLineArguments.cpp
  • components/core/src/clp_s/CommandLineArguments.cpp
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: ubuntu-jammy-lint
  • GitHub Check: ubuntu-jammy-static-linked-bins
  • GitHub Check: ubuntu-jammy-dynamic-linked-bins
  • GitHub Check: centos-stream-9-static-linked-bins
  • GitHub Check: centos-stream-9-dynamic-linked-bins
  • GitHub Check: build-macos (macos-15, false)
  • GitHub Check: build-macos (macos-15, true)
  • GitHub Check: build-macos (macos-13, false)
  • GitHub Check: build-macos (macos-13, true)
  • GitHub Check: lint-check (macos-latest)
🔇 Additional comments (2)
components/core/src/glt/glt/CommandLineArguments.cpp (1)

281-281: Update compression level range in help text

The help text has been updated to reflect an extended range of compression levels from 1-9 to 1-19, which provides users with more granular control over the compression ratio vs. speed trade-off. This aligns with the broader changes made across the codebase as mentioned in the summary.

Note that there appears to be a slight discrepancy between the PR objectives (which mentions levels 1-9) and this implementation (which supports levels 1-19). Verify that this extended range is intentional and document this capability appropriately in user-facing documentation.

components/core/src/clp/clp/CommandLineArguments.cpp (1)

360-360: Compression level range has been updated.

The description for the compression level option has been updated to reflect an expanded range (from 1-9 to 1-19), allowing for more fine-grained control over the compression ratio vs. speed trade-off.

Comment thread components/core/src/clp_s/CommandLineArguments.cpp
@Eden-D-Zhang Eden-D-Zhang changed the title feat(clp-package): Add option for specifying compression level to clp-config.yml feat(clp-package): Add option for specifying compression level to clp-config.yml and change max compression level to 19. Mar 18, 2025

@kirkrodrigues kirkrodrigues left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the PR title, how about:

feat(clp-package): Add option for specifying archive compression level and update max compression level to 19.

@Eden-D-Zhang Eden-D-Zhang changed the title feat(clp-package): Add option for specifying compression level to clp-config.yml and change max compression level to 19. feat(clp-package): Add option for specifying archive compression level and update max compression level to 19. Mar 18, 2025
@Eden-D-Zhang

Copy link
Copy Markdown
Contributor Author

For the PR title, how about:

feat(clp-package): Add option for specifying archive compression level and update max compression level to 19.

Done.
By the way I don't have permissions to merge so someone else will have to do it.

@kirkrodrigues kirkrodrigues merged commit 4e38b2a into y-scope:main Mar 18, 2025
@Eden-D-Zhang Eden-D-Zhang deleted the config-compression-level branch March 18, 2025 17:51
junhaoliao pushed a commit to junhaoliao/clp that referenced this pull request May 17, 2026
…l and update max compression level to 19. (y-scope#774)

Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@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