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

fix: add centos CI in github action #2942

Merged

Conversation

cheniujh
Copy link
Collaborator

@cheniujh cheniujh commented Nov 4, 2024

add back centos CI by using customized docker image to avoid pull dependency fail

Summary by CodeRabbit

  • Chores
    • Updated CI workflow to replace the build_on_rocky job with a new build_on_centos job.
    • Adjusted Docker image and checkout action version for the CentOS environment.
    • Simplified unit test command for better efficiency.

These changes enhance the build process, ensuring a smoother integration and testing experience for users.

Copy link

coderabbitai bot commented Nov 4, 2024

Walkthrough

The pull request introduces significant changes to the CI workflow defined in .github/workflows/pika.yml. It replaces the build_on_rocky job with a new build_on_centos job, utilizing a different Docker image and adjusting several configurations, including the checkout action version and CMake toolset. The workflow also simplifies the unit testing command. Other jobs for Ubuntu, macOS, and Pika image building remain unchanged.

Changes

File Change Summary
.github/workflows/pika.yml - Removed job: build_on_rocky
- Added job: build_on_centos
- Updated checkout action from v4 to v1
- Changed CMake toolset from gcc-toolset-13 to devtoolset-10
- Simplified unit test command from ./pikatests.sh all clean to ./pikatests.sh all

Possibly related PRs

  • fix:fix CI #2924: This PR modifies the build_on_rocky job in .github/workflows/pika.yml, which is directly related to the changes made in the main PR regarding the removal of the build_on_rocky job and the addition of the build_on_centos job.
  • fix:macos13 #2937: This PR also updates the build_on_rocky job in .github/workflows/pika.yml, specifically changing installation commands, which relates to the overall modifications in the CI workflow in the main PR.

Suggested labels

☢️ Bug

Suggested reviewers

  • Mixficsol

🐇 In the land of code where bunnies hop,
New jobs are born, and old ones stop.
CentOS now builds with a fresh new face,
While Ubuntu and Mac keep their place.
With tests simplified, we leap with glee,
Hooray for changes, oh what a spree! 🐇


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

@github-actions github-actions bot added ☢️ Bug Something isn't working ✏️ Feature New feature or request labels Nov 4, 2024
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: 1

🧹 Outside diff range and nitpick comments (2)
.github/workflows/pika.yml (2)

142-212: Document the transition from Rocky to CentOS.

The Rocky Linux job is commented out rather than removed. While this preserves history, it clutters the workflow file.

Consider:

  1. Removing the commented code as it's preserved in Git history
  2. Adding a comment explaining why CentOS was chosen over Rocky
  3. Documenting the transition in the repository's documentation

Line range hint 87-212: Overall architectural considerations for CI changes.

The transition to CentOS raises several architectural points:

  1. Testing Matrix:

    • Consider using matrix strategy to test against multiple OS versions
    • This would reduce duplication between Ubuntu, CentOS, and macOS jobs
  2. Dependency Management:

    • The custom Docker image obscures dependency management
    • Consider making dependencies explicit in the workflow
  3. Version Consistency:

    • Ensure consistent versions of actions across jobs
    • Document version requirements for tools and dependencies

Consider implementing a matrix strategy:

strategy:
  matrix:
    os: [ubuntu-latest, centos7]
    include:
      - os: ubuntu-latest
        container: ubuntu:latest
      - os: centos7
        container: cheniujh/pika-ci-centos7:v1
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 0c37b04 and c4c9322.

📒 Files selected for processing (1)
  • .github/workflows/pika.yml (2 hunks)
🔇 Additional comments (3)
.github/workflows/pika.yml (3)

94-98: Explain the rationale for downgrading checkout action.

The PR downgrades actions/checkout from v4 to v3 without explanation. This might impact security and performance as v4 includes important updates.

Let's check if there are any compatibility issues with v4:

#!/bin/bash
# Description: Search for checkout action version usage across workflows
# Expected: Find consistent version usage or documented reasons for differences

rg "uses: actions/checkout@v" .github/workflows/

99-111: Review toolchain version and caching strategy.

Several observations about the build configuration:

  1. Switching from gcc-toolset-13 to devtoolset-10 is a significant downgrade
  2. Cache keys have been updated appropriately for CentOS
  3. The CMake configuration remains consistent

Let's verify the toolchain requirements:

#!/bin/bash
# Description: Check minimum compiler requirements in CMake files
# Expected: Find compiler version requirements or dependencies

rg -A 3 "CMAKE_CXX_COMPILER|CMAKE_C_COMPILER|gcc|g\+\+" CMakeLists.txt

Consider:

  1. Documenting the reason for using an older toolchain
  2. Adding compiler version checks in CMake

Line range hint 113-139: Verify test coverage and execution.

Changes in the test execution:

  1. Removed the cleanup step present in Rocky job
  2. Changed ./pikatests.sh all clean to ./pikatests.sh all

Let's check the impact of these changes:

Consider:

  1. Maintaining consistent cleanup steps across all jobs
  2. Documenting why cleanup is handled differently in CentOS
✅ Verification successful

Cleanup step removal is safe and intentional

After analyzing the test scripts, I can confirm:

  1. The cleanup function in pikatests.sh is called in three scenarios:

    • At the start of every test run
    • When tests fail
    • Optionally at the end if clean parameter is provided
  2. The removal of the cleanup step is safe because:

    • Initial cleanup is always performed before tests start
    • Failed tests trigger cleanup automatically
    • The optional final cleanup was just an additional safety measure
  3. The integration test scripts (start_master_and_slave.sh, start_codis.sh, and integrate_test.sh) manage their own test environments independently.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Analyze test script behavior
# Expected: Understand the difference between 'all' and 'all clean' modes

rg -A 5 "function.*clean" pikatests.sh

Length of output: 245


Script:

#!/bin/bash
# Let's first check if the file exists and its content
fd "pikatests.sh" --type f --exec cat {}

# Also check the integration test scripts to understand the cleanup context
fd "start_master_and_slave.sh|start_codis.sh|integrate_test.sh" --type f --exec cat {}

Length of output: 10980

.github/workflows/pika.yml Outdated 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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between c4c9322 and a003679.

📒 Files selected for processing (1)
  • .github/workflows/pika.yml (2 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/pika.yml

98-98: input "node-version" is not defined in action "actions/checkout@v3". available inputs are "clean", "fetch-depth", "fetch-tags", "github-server-url", "lfs", "path", "persist-credentials", "ref", "repository", "set-safe-directory", "sparse-checkout", "sparse-checkout-cone-mode", "ssh-key", "ssh-known-hosts", "ssh-strict", "submodules", "token"

(action)

🔇 Additional comments (4)
.github/workflows/pika.yml (4)

104-112: LGTM: Cache configuration properly updated

The cache keys have been correctly updated to reflect the CentOS context while maintaining the same cache structure.


143-213: Document CI environment changes

The complete removal of the Rocky Linux CI environment in favor of CentOS should be documented. Please:

  1. Update relevant documentation to reflect this change
  2. Document the rationale for switching from Rocky Linux 9 to CentOS 7

Let's check for CI documentation that needs updating:

#!/bin/bash
# Search for CI documentation
fd -g "*CI*.md" docs/
fd -g "*BUILD*.md" docs/
fd -g "*CONTRIBUTING*.md" .

124-124: Verify unit test command modification

The unit test command has been simplified from ./pikatests.sh all clean to ./pikatests.sh all. Please confirm if removing the clean parameter is intentional and won't affect test isolation.

Let's check the test script implementation:

#!/bin/bash
# Check pikatests.sh implementation to understand the 'clean' parameter
rg -A 5 "clean" pikatests.sh

102-103: Document toolchain downgrade rationale

The change from gcc-toolset-13 to devtoolset-10 represents a significant toolchain downgrade. Please document the reasons for this change, including any compatibility requirements or constraints that necessitated using an older toolset.

Let's check if there are any known compatibility issues with gcc-toolset-13:

.github/workflows/pika.yml Outdated Show resolved Hide resolved
@cheniujh cheniujh removed ✏️ Feature New feature or request ☢️ Bug Something isn't working labels Nov 4, 2024
@github-actions github-actions bot added ☢️ Bug Something isn't working ✏️ Feature New feature or request labels Nov 4, 2024
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

🧹 Outside diff range and nitpick comments (2)
.github/workflows/pika.yml (2)

107-108: Consider creating a composite action for toolset setup

The source /opt/rh/devtoolset-10/enable command is used multiple times. Consider creating a composite action to encapsulate the toolset setup for better maintainability.

Example composite action:

# .github/actions/setup-centos-toolset/action.yml
name: 'Setup CentOS Toolset'
description: 'Sets up the CentOS development toolset'
runs:
  using: 'composite'
  steps:
    - shell: bash
      run: source /opt/rh/devtoolset-10/enable

148-218: Remove commented out Rocky Linux job

Instead of keeping the commented-out job configuration in the workflow file, consider:

  1. Removing it completely since it's tracked in Git history
  2. Or, if needed for reference, moving it to documentation

This will improve the workflow file's readability and maintainability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between a003679 and 72b67a0.

📒 Files selected for processing (1)
  • .github/workflows/pika.yml (2 hunks)
🧰 Additional context used
🪛 yamllint
.github/workflows/pika.yml

[error] 97-97: trailing spaces

(trailing-spaces)

.github/workflows/pika.yml Outdated Show resolved Hide resolved
.github/workflows/pika.yml Outdated 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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 72b67a0 and 9705335.

📒 Files selected for processing (1)
  • .github/workflows/pika.yml (2 hunks)
🔇 Additional comments (4)
.github/workflows/pika.yml (4)

88-91: Skip comment as security concerns are already addressed in past reviews.


99-102: Skip comment as devtoolset version issue is already addressed.


103-111: LGTM: Cache configuration properly updated for CentOS

The cache keys have been correctly updated to reflect the CentOS environment while maintaining the same cache paths.


Line range hint 113-139: Skip comment as test command issue is already addressed.

.github/workflows/pika.yml Outdated Show resolved Hide resolved
.github/workflows/pika.yml 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: 1

🧹 Outside diff range and nitpick comments (2)
.github/workflows/pika.yml (2)

101-102: Ensure consistent CMake flags across jobs

The CMake configuration in the CentOS job is missing compiler launcher flags (CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER) that are present in Ubuntu and macOS jobs. This inconsistency could lead to slower builds on CentOS.

Apply this diff to align with other jobs:

-          cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address
+          cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache

142-212: Document the rationale for migrating from Rocky to CentOS

While the commented Rocky Linux configuration should be removed as suggested in previous reviews, it would be valuable to document why CentOS was chosen over Rocky Linux. Consider adding a comment in the workflow file or updating the repository's CI documentation to explain this architectural decision.

Add a comment before the CentOS job explaining the rationale:

+  # CentOS 7 is used instead of Rocky Linux 9 due to better compatibility with legacy dependencies
+  # and reduced pull failures in CI environment. See PR #2942 for detailed discussion.
   build_on_centos:
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 9705335 and b77a77e.

📒 Files selected for processing (1)
  • .github/workflows/pika.yml (2 hunks)

.github/workflows/pika.yml Outdated 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

🧹 Outside diff range and nitpick comments (2)
.github/workflows/pika.yml (2)

101-102: Add compiler launcher flags for better build performance

The CMake configuration should include compiler launcher flags to optimize build performance with ccache.

-          cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address
+          cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache

121-121: Remove trailing whitespace

-          rm -rf ./buildtrees    
+          rm -rf ./buildtrees
🧰 Tools
🪛 yamllint

[error] 121-121: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between b77a77e and 7caef8e.

📒 Files selected for processing (1)
  • .github/workflows/pika.yml (2 hunks)
🧰 Additional context used
🪛 yamllint
.github/workflows/pika.yml

[error] 121-121: trailing spaces

(trailing-spaces)

@cheniujh cheniujh removed ✏️ Feature New feature or request ☢️ Bug Something isn't working labels Nov 5, 2024
@github-actions github-actions bot added ☢️ Bug Something isn't working ✏️ Feature New feature or request labels Nov 6, 2024
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

🧹 Outside diff range and nitpick comments (2)
.github/workflows/pika.yml (2)

111-112: Remove trailing whitespace

Remove the trailing whitespace on line 112:

-          rm -rf ./buildtrees    
+          rm -rf ./buildtrees
🧰 Tools
🪛 yamllint

[error] 112-112: trailing spaces

(trailing-spaces)


Line range hint 88-138: Consider using job matrix for Linux builds

The Ubuntu and CentOS jobs share similar steps and could be consolidated using a matrix strategy:

jobs:
  build_on_linux:
    strategy:
      matrix:
        os: [ubuntu, centos]
        include:
          - os: ubuntu
            container: ubuntu:latest
          - os: centos
            container: pikadb/pika-ci-centos7:v5
    runs-on: ubuntu-latest
    container: ${{ matrix.container }}

This would:

  1. Reduce workflow maintenance by eliminating duplicated job definitions
  2. Make it easier to add more Linux distributions in the future
  3. Ensure consistent steps across Linux builds

Would you like me to help create a proof of concept for this refactor?

🧰 Tools
🪛 yamllint

[error] 112-112: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7caef8e and a0bce17.

📒 Files selected for processing (1)
  • .github/workflows/pika.yml (2 hunks)
🧰 Additional context used
🪛 yamllint
.github/workflows/pika.yml

[error] 112-112: trailing spaces

(trailing-spaces)

🔇 Additional comments (1)
.github/workflows/pika.yml (1)

94-98: The previous review comment about upgrading the checkout action from v1 to v4 is still valid.

.github/workflows/pika.yml Show resolved Hide resolved
.github/workflows/pika.yml 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

🧹 Outside diff range and nitpick comments (2)
.github/workflows/pika.yml (2)

101-102: Add compiler launcher flags for better build performance

The CMake configuration is missing the compiler launcher flags that are present in Ubuntu and macOS jobs. Add these flags to improve build performance:

-          cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address
+          cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache

112-112: Remove trailing spaces

Fix the formatting by removing trailing spaces from this line.

-          rm -rf ./buildtrees    
+          rm -rf ./buildtrees
🧰 Tools
🪛 yamllint

[error] 112-112: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7caef8e and a0bce17.

📒 Files selected for processing (1)
  • .github/workflows/pika.yml (2 hunks)
🧰 Additional context used
🪛 yamllint
.github/workflows/pika.yml

[error] 112-112: trailing spaces

(trailing-spaces)

@Mixficsol Mixficsol merged commit 4820646 into OpenAtomFoundation:unstable Nov 7, 2024
12 checks passed
chenbt-hz pushed a commit to chenbt-hz/pika that referenced this pull request Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☢️ Bug Something isn't working ✏️ Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants